feat: initialize project backend structure and document system specifications across all modules
This commit is contained in:
42
docs/specs/reward_campaign/account_type_group.md
Normal file
42
docs/specs/reward_campaign/account_type_group.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: "Account Type Group"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Account Type Group (ATG)
|
||||
|
||||
## Requirement Definition
|
||||
Groups Account Types (Product Account Level + Type) and orders them in priority sequence. ATGs are assigned to Reward Pools to restrict which accounts can earn into the pool, and to define the priority sequence for deducting points during redemptions at Customer-level pools.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
- Account Types must exist in OLS.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### General Information
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Account Type Group Id | Identifier. | String (10) | Required. Unique. |
|
||||
| Description | Description. | String (100) | Required. |
|
||||
|
||||
#### Account Type Sequence
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Product Account Level | PAL. | Enum (Lookup) | Required. |
|
||||
| Product Account Type | PAT. | Enum (Lookup) | Required. |
|
||||
| Sequence No | Priority sequence (lowest is highest priority). | Integer | Required. |
|
||||
|
||||
### Execution
|
||||
- **Redemption Priority**: When redeeming from a Customer pool, buckets with the same expiry date are deducted in ascending order of the Account Type's Sequence No in the pool's ATG. Account types NOT in the ATG have highest priority.
|
||||
- **Posting Priority**: If a transaction arrives with only a CIF Number (no Account Number), the system uses the ATG to find eligible accounts for that CIF. If multiple exist, the one with the lowest Sequence No in the ATG is selected for the transaction.
|
||||
- **Validation**: Incoming transactions must map to an Account Type that is within the Pool's ATG. If the intersection of Customer's Accounts and the Pool's ATG is null, the transaction is rejected.
|
||||
|
||||
## Exception Flow
|
||||
- TP validation failures reject the transaction.
|
||||
38
docs/specs/reward_campaign/campaign_insight.md
Normal file
38
docs/specs/reward_campaign/campaign_insight.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: "Campaign Insight"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Campaign Insight
|
||||
|
||||
## Requirement Definition
|
||||
Combines data from across multiple data sources into charts to track and display customer and campaign activities, providing a high-level performance overview.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights to the Campaign Insight module.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### Key Metrics Displayed
|
||||
- Total Redeemed Points.
|
||||
- Total Members (Active vs Inactive).
|
||||
- Total Partners.
|
||||
- Total Active Reward Campaigns.
|
||||
|
||||
#### Charts & Visualizations
|
||||
- **Campaign Performance**: Displays the Top N Campaigns by awarded points, comparing "Target Avg Transaction Value" vs actual awards.
|
||||
- **Top Channels**: Breakdown of transactions by entry channel (e.g., EDC, Web, Call Center).
|
||||
- **Points Awarded vs Redeemed**: Time-series comparison of point inflows vs outflows over a period.
|
||||
|
||||
### Execution
|
||||
- **View-only dashboard.**
|
||||
- Real-time or near-real-time aggregation depending on batch job configuration for analytics.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
35
docs/specs/reward_campaign/campaign_rule_contributor.md
Normal file
35
docs/specs/reward_campaign/campaign_rule_contributor.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: "Campaign Rule - Contributor Settings"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Campaign Rule - Contributor Settings
|
||||
|
||||
## Requirement Definition
|
||||
Configures funding contributors for a reward. If a reward is funded by entities other than the transacting merchant (or split between them), Contributors define the split percentage.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Rule must be created.
|
||||
- Contributing merchants (Chains) must exist in OLS.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Contributor | The Chain funding the reward. | Enum (Lookup) | Required. Unique per rule. |
|
||||
| Contributor Percentage | Percentage of cost to fund. | Decimal | Required. > 0. |
|
||||
| Absorb Remainder | Absorbs rounding remainders. | Boolean | Required. Exactly one must be true. |
|
||||
|
||||
### Execution
|
||||
- Total contribution must equal 100%.
|
||||
- Transaction processing splits the awarded value across Contributors based on percentages.
|
||||
- If no contributors are configured, the transacting Merchant (Chain) absorbs 100% of the cost.
|
||||
|
||||
## Exception Flow
|
||||
- Validation failures block saving.
|
||||
40
docs/specs/reward_campaign/campaign_rule_criteria.md
Normal file
40
docs/specs/reward_campaign/campaign_rule_criteria.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: "Campaign Rule Criteria"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Campaign Rule Criteria
|
||||
|
||||
## Requirement Definition
|
||||
Defines the conditions a transaction must meet to trigger a Campaign Rule. Built using a drag-and-drop Query Builder interface.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Rule must be created.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
Criteria are categorized into: Customer, Account, Transaction, Attribute, Counter, Merchant.
|
||||
|
||||
#### Operators
|
||||
| Data Type | Operators | Logic Type / Details |
|
||||
|---|---|---|
|
||||
| String / Lookup | Is in, Is not in, Contains, Equal to, Not equal to, Starts with, Ends with, Is null, Is not null. | Validates against provided text or list of values. |
|
||||
| Number | Equal, Not equal, Less than, Less/equal, Greater, Greater/equal, Between, Null, Not null. | Standard numerical comparison. |
|
||||
| Date | On or before, On or after, Fixed date, Between date range, Between period from N. | Complex date logic (e.g. comparing Day/Month regardless of year, comparing "3 months ago"). |
|
||||
| Day of week | Is the day of week. | Monday-Sunday. |
|
||||
| Time | Is between. | Time-of-day comparison (00:00 - 23:59). |
|
||||
| Boolean | Is. | True / False. |
|
||||
|
||||
### Execution
|
||||
- Supports AND and OR logic grouping.
|
||||
- A single rule can have multiple groups, but inter-group logic must be consistent (all ANDs or all ORs).
|
||||
- NOT toggles support exclusion.
|
||||
- All criteria defined in the rule must evaluate to true (for AND) or at least one (for OR) to trigger the Formula execution.
|
||||
|
||||
## Exception Flow
|
||||
- Validation failure means the rule is not triggered (proceeds to next rule in Execution Sequence).
|
||||
27
docs/specs/reward_campaign/campaign_rule_formula.md
Normal file
27
docs/specs/reward_campaign/campaign_rule_formula.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "Campaign Rule Formula"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Campaign Rule Formula
|
||||
|
||||
## Requirement Definition
|
||||
Configures the mathematical formula used to calculate the reward, redemption value, or counter increment for a given Rule.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Rule must be created.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Execution
|
||||
- Formulas act on the "Amount to Use (A)" defined in the Rule Header.
|
||||
- Support mathematical operations (e.g., A * 0.05, A + 10).
|
||||
- Formulas can be assigned to different tiers based on criteria.
|
||||
- Formulas can be used to update Pool Balances, or simply update a Counter / Attribute without impacting a Pool.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
40
docs/specs/reward_campaign/campaign_structure.md
Normal file
40
docs/specs/reward_campaign/campaign_structure.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: "Campaign Structure"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Campaign Structure
|
||||
|
||||
## Requirement Definition
|
||||
Defines the conceptual structure and mechanics of how reward campaigns operate in OLS, managing the issuance and redemption of various reward types (Points, Cash Rebates, eCoupons, Lucky Draw chances).
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- N/A (Core concepts)
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Types of Campaign Mechanics
|
||||
1. **Award on Every Transaction**: Rewards are determined and given at the time the transaction is processed (real-time or batch).
|
||||
2. **Accumulate Then Award**: Rewards depend on cumulative criteria (e.g., total spend over a month). Transactions update Counters, and at the end of the period, a separate process extracts the Counter value to determine the award.
|
||||
3. **Auto-redemption Campaigns**: Awarded quantities (e.g., Cash Rebates) are immediately "redeemed" and sent to an external system (like a Core Banking system) to credit the customer's account.
|
||||
|
||||
### Reward Pool Structure & Deduction
|
||||
- Earnings are tracked in "Pools" by reward type.
|
||||
- Pools belong to Loyalty Accounts (or specific Accounts/Cards).
|
||||
- Stored value is tracked in Buckets segregated by Expiry Date and Account Type.
|
||||
- **Redemption Sequence**:
|
||||
- Deducted in ascending Expiry Date (earliest expiring first).
|
||||
- If identical expiry dates, sorted by a pre-configured Account Type priority sequence.
|
||||
|
||||
### Counters
|
||||
- A Counter tracks a quantity (e.g., spend amount, transaction frequency) over a defined time period (Bucket).
|
||||
- Entities tracked: Customer, Account, Card, Store, Chain, etc.
|
||||
- Quantities tracked: Gross Amount, Nett Amount, Points, Transaction Count, Custom Quantities.
|
||||
- Counter Periods: Days, Weeks, Months, Quarters, Years, Fixed Date, No Expiry, Days/Months/Quarters from Account Open Date.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
41
docs/specs/reward_campaign/cep_rule.md
Normal file
41
docs/specs/reward_campaign/cep_rule.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
title: "Counter Extract & Process (CEP) Rule"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Counter Extract & Process (CEP) Rule
|
||||
|
||||
## Requirement Definition
|
||||
Extracts values accumulated in a Counter at the end of a defined period and generates a transaction to trigger an Award/Redeem rule based on that accumulated total.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
- A Counter tracking the required metric must exist.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### General & Extraction Settings
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Rule Type | CEP. | Enum | Required. |
|
||||
| Counter to Extract | Counter containing the value. | Enum (Lookup) | Required. |
|
||||
| Bucket to Extract | Current, Previous, Period Before Last. | Enum | Required. |
|
||||
| Rule type to process | Rule type of the destination rule. | Enum (Lookup) | Required. |
|
||||
| Transaction Code | TC used to post the extracted transaction. | Enum (Lookup) | Required. |
|
||||
| -ve Bal. Adjust. TC | TC for negative extracted values. | Enum (Lookup) | Optional. |
|
||||
| Account with blocked Card | Include or Exclude blocked cards. | Boolean | Conditional (if Acct/Card entity). |
|
||||
| Run schedule | Day, Month, Annual, N days AOD, Stmt Cycle. | Enum (Lookup) | Required. Defines execution frequency. |
|
||||
|
||||
### Execution
|
||||
- Evaluated by the CEP Batch scheduled at end-of-day.
|
||||
- The extracted Counter Bucket value becomes the `Amount A` for the destination Rule.
|
||||
- State of Counter Buckets is updated based on Counter Definition (e.g., closed after extraction) to prevent double-processing.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
45
docs/specs/reward_campaign/counter_definition.md
Normal file
45
docs/specs/reward_campaign/counter_definition.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "Counter Definition"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Counter Definition
|
||||
|
||||
## Requirement Definition
|
||||
Defines conceptual entities that track quantities (spend amount, transactions, points) over defined periods of time.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Counter Id | Unique identifier. | String (10) | Required. |
|
||||
| Counter Name | Descriptive name. | String (50) | Required. |
|
||||
| Effective From Date | Start date of counter effectiveness. | Date | Required. |
|
||||
| Effective To Date | End date of counter effectiveness. | Date | Required. |
|
||||
| Entity | Level of tracking (Cust, Acct, Card, Store, etc).| Enum (Lookup) | Required. |
|
||||
| Bucket Period Unit | Time period for buckets (Day, Month, etc). | Enum (Lookup) | Required. |
|
||||
| Bucket End Date | Used if Unit is Fixed Date. | Date | Conditional. |
|
||||
| Bucket Period Duration(N)| Length of the period unit. | Integer | Conditional. |
|
||||
| What to count | Entity to track (Gross Amt, Txns, Points, etc). | Enum (Lookup) | Required. |
|
||||
| Reset type | Reset to 0, or keep remainder. | Enum (Lookup) | Required. |
|
||||
| Reset Value | Threshold at which counter resets and new bucket starts. | Decimal | Required. Default 999999999. |
|
||||
| First Start Date Is Fixed| Boolean flag. | Boolean | Conditional. |
|
||||
| First Start Date | Starting date for the first bucket. | Date | Conditional. |
|
||||
| Update State When | When to close bucket (On extract, On award). | Enum (Lookup) | Required. |
|
||||
| Late Posting Option | Update late value vs Current bucket. | Enum | Required. |
|
||||
|
||||
### Execution
|
||||
- If counter ID has existing values in `counter_stock`, definition cannot be changed (except Name/Desc/End Date).
|
||||
- Late Posting determines how transactions with backdated post dates update counters (update the "Late Counter Value" or force update into the currently active time bucket).
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
33
docs/specs/reward_campaign/external_transaction_code.md
Normal file
33
docs/specs/reward_campaign/external_transaction_code.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "External Transaction Code"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# External Transaction Code
|
||||
|
||||
## Requirement Definition
|
||||
Maps incoming transaction codes from external systems (e.g., Card System) to OLS Transaction Codes.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights in the module.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| External Transaction Code | Source System Transaction Code. | String (10) | Required. |
|
||||
| Description | Description for reference. | String (30) | Required. |
|
||||
|
||||
### Execution
|
||||
- An External System TC is the first key used to locate the corresponding OLS TC for processing.
|
||||
- Each External TC must be mapped to an OLS TC.
|
||||
- Supports Maker-Checker approval workflow (Pending -> Active).
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
36
docs/specs/reward_campaign/item_redemption_rule.md
Normal file
36
docs/specs/reward_campaign/item_redemption_rule.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: "Item Redemption Rule"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Item Redemption Rule
|
||||
|
||||
## Requirement Definition
|
||||
Evaluates item redemption transactions (e.g. redeeming an eVoucher or physical item from a catalog).
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### General Information
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Rule Type | Item Redemption (ITRD). | Enum | Required. |
|
||||
| Message Template ID | SMS/Email template if rule hit. | Enum (Lookup) | Optional. |
|
||||
| Transaction Code | TC used to post the redemption. | Enum (Lookup) | Required. |
|
||||
|
||||
### Execution
|
||||
- Same criteria evaluation approach as Award rules.
|
||||
- There is NO reward pool, formula, or contributor attached to this rule type.
|
||||
- The redemption pool to deduct from is configured separately in the Item Price configuration.
|
||||
- To post an item redemption, the transaction must pass the validation criteria of the Item Redemption Rule linked to the redemption TC.
|
||||
|
||||
## Exception Flow
|
||||
- Criteria failure blocks the item redemption transaction.
|
||||
34
docs/specs/reward_campaign/ols_transaction_code.md
Normal file
34
docs/specs/reward_campaign/ols_transaction_code.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: "OLS Transaction Code"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# OLS Transaction Code
|
||||
|
||||
## Requirement Definition
|
||||
Every transaction processed against Campaign Rules must have an OLS Transaction Code (TC). It acts as the primary key to locate relevant Campaign Rules.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights in the module.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| OLS Transaction Code | The internal transaction code. | String (10) | Required. |
|
||||
| Description | Description of the code. | String (30) | Required. |
|
||||
| External Transaction Code | The mapped external TCs. | List of Strings | Optional. Many External TCs can map to one OLS TC. |
|
||||
| Reversal Indicator | Indicates if this is a reversal. | Boolean | Default False. |
|
||||
|
||||
### Execution
|
||||
- Supports internal transactions (e.g., CEP Batch generated) that do not have an External TC.
|
||||
- Supports Maker-Checker approval workflow (Pending -> Active).
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
68
docs/specs/reward_campaign/pool_definition.md
Normal file
68
docs/specs/reward_campaign/pool_definition.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: "Pool Definition"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Pool Definition
|
||||
|
||||
## Requirement Definition
|
||||
Defines Reward Pools which track stored values (Points, Cash Rebates, Lucky Draw chances, eVouchers). Pools dictate expiry policies, entity tracking levels (Customer, Account, Card), and velocity controls.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
- Pool Conversion Rate must be active.
|
||||
- Account Type Groups (if applicable) must be active.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### General Information
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Pool Id | System-generated identifier. | String (10) | Required. |
|
||||
| Pool Name | Name of the pool. | String (30) | Required. |
|
||||
| Pool Type | Points, Cash Rebate, Lucky Draw, eVoucher. | Enum | Required. |
|
||||
| Expiry Policy | Method to calculate expiry date. | Enum (Lookup) | Required (except eVoucher). |
|
||||
| Policy Parameter N | Numeric parameter for Expiry Policy. | Integer | Conditional based on policy. |
|
||||
| Expiry Date | Fixed expiry date. | Date | Conditional (if policy is Fixed Date). |
|
||||
| Ripening Period | Days before reward is redeemable. | Integer | Conditional. Default 0. |
|
||||
| Conversion Rate Code | Currency representing a unit of reward. | Enum (Lookup) | Conditional. |
|
||||
| Allow Negative Balance | Allow pool to go negative on adjust/cancel. | Boolean | Conditional. Default False. |
|
||||
| Precision | Number of decimal places. | Enum (Lookup) | Conditional. Default 2. |
|
||||
| Account Type Group | Restricts earning to specific accounts. | Enum (Lookup) | Optional. |
|
||||
| Grace Period | Months to keep expired buckets before forfeit. | Integer | Optional. |
|
||||
| Entity Level | Tracks balance at Customer, Account, Card. | Enum | Required. |
|
||||
|
||||
#### Product Specific Policy
|
||||
Overrides general expiry policy for specific Account Types.
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Product Account Level | PAL. | Enum (Lookup) | Required. |
|
||||
| Product Account Type | PAT. | Enum (Lookup) | Required. Unique per row. |
|
||||
| Expiry Policy | Specific expiry policy. | Enum (Lookup) | Required. |
|
||||
|
||||
#### Velocity Control
|
||||
Defines thresholds for sending alerts (Exception Alert Reports).
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Maximum | Threshold limit. | Decimal | Required. |
|
||||
| Transaction Type | Award, Redeem, Adjust. | Enum | Required. |
|
||||
| Units | Per Pool Units or Per Transaction. | Enum | Required. |
|
||||
| Per Entity 1 | Customer, Account, Card. | Enum | Optional (System-wide if null). |
|
||||
| Per Entity 2 | Corporation, Chain, Store, Terminal. | Enum | Optional. |
|
||||
| Per Period | Quarter, Month, Week, Day. | Enum | Required. |
|
||||
| Alert Template | Message template for alert. | Enum | Required. |
|
||||
| Alert Group | Recipient group (SMS/Email). | Enum | Required. |
|
||||
|
||||
### Execution
|
||||
- Precision cannot be reduced after transactions are posted.
|
||||
- Entity Level cannot be moved downwards (e.g., Customer to Card) after transactions are posted.
|
||||
- Evoucher pools have No Expiry, no Precision, and no Negative Balances.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
39
docs/specs/reward_campaign/rep_rule.md
Normal file
39
docs/specs/reward_campaign/rep_rule.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: "Redemption Extract & Process (REP) Rule"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Redemption Extract & Process (REP) Rule
|
||||
|
||||
## Requirement Definition
|
||||
Extracts reward pool balances to automatically output them as Cash Rebates or Partner Points to an external destination system (like a Core Banking system or Airline Partner).
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### Extraction Settings
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Rule Type | REP. | Enum | Required. |
|
||||
| Pool to Extract | Pool containing the balance. | Enum (Lookup) | Required. |
|
||||
| Minimum Pool Balance | Threshold before extraction. | Decimal | Optional. |
|
||||
| Trigger Campaign rule | Validates criteria before extraction. | Boolean | Default False. |
|
||||
| Redeem TC | TC used to post the redemption. | Enum (Lookup) | Required. |
|
||||
| Output Redemption As | Format/System of output (e.g. Cash Rebate file).| Enum (Lookup) | Required. |
|
||||
| Run schedule | Day, Month, Annual, Stmt Cycle, N days AOD. | Enum (Lookup) | Required. Defines execution frequency. |
|
||||
|
||||
### Execution
|
||||
- Evaluated by the REP Batch scheduled at end-of-day.
|
||||
- The full eligible amount of the Pool balance is deducted and output to a file (e.g., `OLSCRTXN`).
|
||||
- If `Trigger Campaign rule` is true, an intermediate Redeem rule evaluates criteria, and the extracted amount is the minimum of (Available Balance, Formula Result).
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
37
docs/specs/reward_campaign/reward_campaign.md
Normal file
37
docs/specs/reward_campaign/reward_campaign.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "Reward Campaign"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Reward Campaign
|
||||
|
||||
## Requirement Definition
|
||||
Acts as the parent container for Business Rules (Campaign Rules) controlling rewards and redemptions. Campaigns can be "Base" (core product) or "Tactical" (short-term objectives).
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Campaign ID | Identifier. | String (10) | Required. |
|
||||
| Campaign Name | Name of the campaign. | String (50) | Required. >= 10 chars. |
|
||||
| Campaign Owner | Owner reference. | String (50) | Optional. |
|
||||
| Campaign Description | Description. | String (500) | Optional. |
|
||||
| Campaign Type | Base or Tactical. | Enum (Lookup) | Required. |
|
||||
| Target Active Customer Count | Expected participant count. | Integer | Optional. Insight metric. |
|
||||
| Target Avg Transaction Value | Expected spend value. | Decimal | Optional. Insight metric. |
|
||||
| Campaign Period | Earliest Rule start to latest Rule end. | Date Range | Read-only based on Rules. |
|
||||
|
||||
### Execution
|
||||
- Campaigns simply group Rules logically. The actual execution logic is defined in the child Campaign Rules.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
64
docs/specs/reward_campaign/reward_campaign_rule.md
Normal file
64
docs/specs/reward_campaign/reward_campaign_rule.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
title: "Reward Campaign Rule"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Reward Campaign Rule
|
||||
|
||||
## Requirement Definition
|
||||
Campaign Rules define the business rules for giving a reward, defining conditions for redemption, or triggering batch updates (CEP/REP). This spec covers standard Award, Redeem, and Adjust rules.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
#### General Information
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Campaign ID | Parent campaign. | Enum (Lookup) | Required. |
|
||||
| Campaign Rule ID | System-generated identifier. | String (10) | Required. |
|
||||
| Campaign Rule Name | Name of the rule. | String (50) | Required. |
|
||||
| Rule Type | Award, Redeem, Adjust. | Enum (Lookup) | Required. |
|
||||
| Effective Date From | Start of effective period. | Date | Required. |
|
||||
| Effective Date To | End of effective period. | Date | Required. |
|
||||
|
||||
#### Rule Setting
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Effective Period is Based On| Transaction Date vs Post Date. | Enum | Required. |
|
||||
| Pool | Reward pool applied to this rule. | Enum (Lookup) | Required. |
|
||||
| Item Code | eVoucher item if Pool Type is eVoucher. | Enum (Lookup) | Conditional. |
|
||||
| Message Template ID | SMS/Email template if rule hit. | Enum (Lookup) | Optional. |
|
||||
| Stop if criteria met | If true, halts further rule evaluation for this TC. | Boolean | Default False. |
|
||||
| Do not update pool | Rule updates Counters/Attributes but not the pool. | Boolean | Default False. |
|
||||
|
||||
#### Transaction Code Linkage
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Transaction Code | TC that triggers this rule. | Enum (Lookup) | Required. |
|
||||
| Execution Sequence | Priority order of execution. | Integer | Required. Unique per Rule Type + TC combo. |
|
||||
|
||||
#### Formula Setting (If Rule Type requires formula)
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Amount to Use (A) | Derived amount (from tx data or counter). | Enum | Required. |
|
||||
| Cap A not more than | Caps the input 'A'. | Decimal | Optional. |
|
||||
| Formula Result is rounded | Down, Nearest, Up. | Enum | Required. |
|
||||
| Award Limit (At Least) | Minimum guaranteed result. | Decimal | Optional. |
|
||||
| Award Limit (No More Than) | Max limit (can be tied to a Counter). | Decimal | Optional. |
|
||||
|
||||
### Execution
|
||||
- An incoming transaction's TC is matched against Rules.
|
||||
- Rules linked to the TC are evaluated in Execution Sequence order.
|
||||
- If Rule Criteria (defined separately) pass, the Formula (defined separately) calculates the reward.
|
||||
- If "Stop if criteria met" is true, processing halts.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
37
docs/specs/reward_campaign/transaction_category.md
Normal file
37
docs/specs/reward_campaign/transaction_category.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "Transaction Category"
|
||||
type: OpenSpec
|
||||
status: Draft
|
||||
domain: Reward Campaign Management
|
||||
---
|
||||
|
||||
# Transaction Category
|
||||
|
||||
## Requirement Definition
|
||||
A reusable group of conditions/criteria that define a specific category of transactions (e.g., "Dining transactions in Foreign Currency"). Allows efficient and reusable setup of Campaign Rule Criteria without needing multiple duplicated rules.
|
||||
|
||||
## Process Flow
|
||||
|
||||
### Pre-Conditions
|
||||
- Users must have access rights.
|
||||
- Criteria attributes must exist in the system.
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Data Schema
|
||||
|
||||
| Field Name | Description | Logic Type | Constraints / Rules |
|
||||
|---|---|---|---|
|
||||
| Transaction Category Code | Unique identifier. | String (5) | Required. |
|
||||
| Transaction Category Name | Name of category. | String (50) | Required. |
|
||||
| Description | Description for reference. | String (100) | Optional. |
|
||||
| Configuration | Groupings of criteria (AND/OR). | Rule Builder | Required. Same structure as Rule Criteria. |
|
||||
|
||||
### Execution
|
||||
- Built using the Query Builder UI.
|
||||
- Supports nested AND/OR logic.
|
||||
- Includes NOT operators for exclusions.
|
||||
- A Transaction Category acts as a single virtual criterion when configuring a Campaign Rule.
|
||||
|
||||
## Exception Flow
|
||||
- N/A
|
||||
Reference in New Issue
Block a user