Files
loyalty-agent-service/docs/specs/reward_campaign/counter_definition.md

46 lines
2.0 KiB
Markdown

---
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