feat: initialize project backend structure and document system specifications across all modules

This commit is contained in:
SonPhung
2026-07-24 09:05:41 +07:00
parent 506008c69f
commit 4534e4ecb8
74 changed files with 7989 additions and 44 deletions

View File

@@ -0,0 +1,51 @@
---
title: "A/Bn Testing"
type: OpenSpec
status: Draft
domain: OneMarketing
---
# A/Bn Testing
## Requirement Definition
Evaluates and optimizes marketing elements (content or target customers) to identify better performing campaigns. Supports A/Bn Content testing (same target, different messages) and A/Bn Target Customer testing (same message, different targets).
## Process Flow
### Pre-Conditions
- Third-party data/results must be available for OLS to collect and analyze.
- Users must have access rights in the "A/Bn Testing" module.
## Business Rules
### Data Schema (A/Bn Message Content Testing)
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Campaign ID | Unique identifier. | String (20) | Required. No special characters. |
| Campaign Description | Description. | String (100) | Optional. |
| Effective Date From | Start date. | Date | Optional. |
| Effective End date | End date. | Date | Required. |
| Message Channel | SMS, Email, Push. | Enum | Required. |
| Target Customer | OMR Criteria setup for targeting. | Rule | Required. |
| Variant Content | Multiple variants (A, B, N) defining content based on channel. | Array of Messages | Required. Must be unique within the campaign. |
| Run Schedule | Schedule parameters. | Complex | Required. |
### Data Schema (A/Bn Target Customer Testing)
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Campaign ID | Unique identifier. | String (20) | Required. No special characters. |
| Campaign Description | Description. | String (100) | Optional. |
| Effective Date From | Start date. | Date | Optional. |
| Effective End date | End date. | Date | Required. |
| Variant Target Customer | Multiple variants (A, B, N) defining OMR Criteria. | Array of Rules | Required. Must be unique within the campaign. |
| Run Schedule | Schedule parameters. | Complex | Required. |
### Execution
- ABn batch job triggers effective testing requests based on schedule.
- For content testing, sends variant messages to the same subset of targets. Tracks open rates, click-through rates.
- For target testing, evaluates which criteria setup reaches the most/best customers.
## Post-Conditions
- Results are reported back to the user to make data-driven decisions on campaign rollout.

View File

@@ -0,0 +1,36 @@
---
title: "Blacklist"
type: OpenSpec
status: Draft
domain: OneMarketing
---
# Blacklist
## Requirement Definition
A list of customers excluded from marketing campaigns for strategic reasons (e.g., fraud).
## Process Flow
### Pre-Conditions
- Users must have access rights in the "Black List" module.
## Business Rules
### Data Schema
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| ID | Blacklist identifier. | String (10) | Required. |
| Name List | Name of the blacklist. | String (50) | Required. |
| Description | Description. | String (200) | Optional. |
| Input Type | Input from screen or Upload file. | Enum | Required. |
| Customer List | List of selected CIF numbers. | Array of Strings (Lookup) | Required if Input Type is "Input from screen". Requires >= 4 digits to search. |
| Upload File | Uploaded CSV/XLS file. | File | Required if Input Type is "Upload file". Max 50MB. |
### Execution
- Users can review or download the customer list.
- Blacklisted customers are strictly blocked from receiving notifications from OMR.
## Exception Flow
- Validation errors for file type/size during upload display an error message.

View File

@@ -0,0 +1,42 @@
---
title: "Marketing Frequency Cap"
type: OpenSpec
status: Draft
domain: OneMarketing
---
# Marketing Frequency Cap
## Requirement Definition
Controls the frequency and volume of notifications delivered to customers to prevent overwhelming them. Caps can be set daily, weekly, or monthly per customer across different channels.
## Process Flow
### Pre-Conditions
- Users must have access rights in the "Frequency Capping" module.
## Business Rules
### Data Schema
#### Edit Mode Configuration
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Frequency Cap Id | Record identifier. | String (10) | Required. |
| Notification Channel | SMS, Email, or Push Notifications. | Enum | Required. |
| Effective Date From | Start date of the cap. | Date | Required. Only one effective cap per channel at any given time. |
| Effective Date To | End date of the cap. | Date | Required. |
| Capping Period | Daily, Weekly, or Monthly. | Enum | Required. Each period must have only one cap value. |
| Maximum number | Max messages per unique customer. | Integer (12) | Required. |
| Include Whitelist | Disallows/allows whitelist customers to receive more notifications. | Boolean | Default: False. |
| Customer list | Selected whitelist customers to ignore rules. | Array of Strings (Lookup) | Required if Include Whitelist is True. |
| Description | Description of the capping. | String (100) | Optional. |
### Execution
- Frequency Capping is applied to all marketing campaigns at the customer level.
- System automatically tracks notification counts per customer per channel and period unit.
- If the customer reaches the cap, further notifications are blocked.
- Whitelisted customers are excluded from the frequency cap unless explicitly included.
## Post-Conditions
- System enforces defined limits during OMR batch processing.

View File

@@ -0,0 +1,62 @@
---
title: "Marketing Campaign (OneMarketing Request)"
type: OpenSpec
status: Draft
domain: OneMarketing
---
# Marketing Campaign (OneMarketing Request)
## Requirement Definition
Filters target customers that satisfy specific marketing criteria. Triggers either notification messages or reward campaigns (via OLS Transaction Code) for the target customers.
## Process Flow
### Pre-Conditions
- Users must have access rights in the "Marketing Request" module.
- Depending on rights, users can view, add, edit, or approve requests.
- All OMR criteria must be defined as attributes.
## Business Rules
### OMR Criteria Logic
- Uses Query Builder for marketing criteria.
- Criteria can be dragged/dropped from the right panel.
- Supports AND/OR conditions between criteria groups.
- Introduces NOT toggle for exclusion criteria.
### Data Schema
#### General Information
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Request ID | Unique identifier. | String (20) | Required. No special characters. |
| Description | Description. | String (100) | Required. |
| Effective Date From | Start date. | Date | Required. |
| Effective Date To | End date. | Date | Required. |
| Marketing Function | Notification [N] or Trigger Campaign Rule [TCR]. | Enum | Required. |
#### Run Schedule and Message Content
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Trigger Method | Schedule or Event trigger. | Enum | Required. |
| Run Schedule | Once Time [O], Daily [D], Weekly [W], Monthly [M], Annually [A]. | Enum | Required if Trigger Method is Schedule. |
| Schedule Details | Specific details (e.g., Repeat every, Fixed Date, Time of day). | Complex | Required based on Run Schedule. |
| Business Event | Specific event triggering the request. | Array of Strings (Lookup) | Required if Trigger Method is Event trigger. |
| Message Template | The marketing message to send. | String (Lookup) | Required if Marketing Function is Notification. |
| OLS Transaction Code | TC used to trigger campaign rule. | String (Lookup) | Required if Marketing Function is Trigger Campaign Rule. |
#### Targeting
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Trigger Method | OMR Criteria or Upload file. | Enum | Required. |
| Targeting Data | The selected OMR criteria setup or the uploaded file. | Rule / File | Required based on Trigger Method. |
### Batch Job Processing
- OMR job checks effective requests based on processing date.
- Finds valid jobs based on schedule.
- Creates notifications or extracts transactions based on criteria.
- Stops sending when frequency capping limits are reached.
## Post-Conditions
- Marketing content is sent to target customers, or target customers trigger a Campaign Rule.

View File

@@ -0,0 +1,69 @@
---
title: "Marketing Message"
type: OpenSpec
status: Draft
domain: OneMarketing
---
# Marketing Message
## Requirement Definition
Manages (CRUD) all message templates used in the system. A Message Template can be built for different channels (SMS, Push Notification, Email). The message can be based on pre-defined parameters or HTML files.
## Process Flow
### Pre-Conditions
- Users must have access rights in the "Marketing Message" module.
- Depending on rights, users can view, add, edit, or approve message templates manually.
- OMR criteria must be defined as attributes available in the right panel for drag-and-drop setup.
## Business Rules
### Data Schema (SMS Message)
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Message ID | Unique identifier. | String (10) | Required. No special characters. |
| Message Description | Description. | String (100) | Required. |
| SMS Type | Promotion/Marketing or Transaction. | String (Lookup) | Required. |
| Effective Date From | Start date of the effective period. | Date | Required. |
| Effective End Date | End date of the effective period. | Date | Required. |
| SMS Brand Name | Select SMS Sender. | String (Lookup) | Required. |
| Message | Message content. Supports drag/drop parameters. | String (5000) | Required. Unicode (non-GSM). No images, subject, or attachments. |
### Data Schema (Email Message)
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Message ID | Unique identifier. | String (10) | Required. No special characters. |
| Message Description | Description. | String (100) | Required. |
| Email Type | Promotion/Marketing or Transaction. | String (Lookup) | Required. |
| Effective Date From | Start date of the effective period. | Date | Required. |
| Effective End Date | End date of the effective period. | Date | Required. |
| Use Type | Use Message or Upload Template. | Enum | Required. |
| Sender Name | Name of sender. | String (100) | Required. |
| From Email | Configured email address. | String (100) | Required. |
| Subject | Subject of email. | String (100) | Required. |
| Preview Text | Preheader of Email. | String (100) | Optional. Defaults to first line of content if not provided. |
| Message / Upload File | HTML content or uploaded template file. | String / File | Required based on Use Type. |
### Data Schema (Push Notification)
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Message ID | Unique identifier. | String (10) | Required. No special characters. |
| Message Description | Description. | String (100) | Required. |
| Notification Type | Promotion/Marketing or Transaction. | String (Lookup) | Required. |
| Effective Date From | Start date of the effective period. | Date | Required. |
| Effective End Date | End date of the effective period. | Date | Required. |
| Message Title | Primary text at the top. | String (50) | Required. |
| Message | Main content. Supports drag/drop parameters. | String | Required. |
| Image Type | Single (No image), Richer (1 image), Carousel (>1 images). | Enum | Required. |
| Upload Image | Images for Richer or Carousel push. | Image / URL | Required if Image Type is not Single. |
| Link URL | URL to navigate to. | String (100) | Required. |
### Testing Message
- A "Send sample" function exists for all channel types to test the message rendering using a sample phone number, email, or CIF number.
## Post-Conditions
- All configured messages are available for use in Marketing Request, Campaign Rule, and Item Master.

View File

@@ -0,0 +1,36 @@
---
title: "Whitelist"
type: OpenSpec
status: Draft
domain: OneMarketing
---
# Whitelist
## Requirement Definition
A list of customers who have given consent or shown strong interest and are excluded from standard frequency cap rules, ensuring they receive all communications without limit.
## Process Flow
### Pre-Conditions
- Users must have access rights in the "Whitelist" module.
## Business Rules
### Data Schema
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| ID | Whitelist identifier. | String (10) | Required. |
| Name List | Name of the whitelist. | String (50) | Required. |
| Description | Description. | String (200) | Optional. |
| Input Type | Input from screen or Upload file. | Enum | Required. |
| Customer List | List of selected CIF numbers. | Array of Strings (Lookup) | Required if Input Type is "Input from screen". Requires >= 4 digits to search. |
| Upload File | Uploaded CSV/XLS file. | File | Required if Input Type is "Upload file". Max 50MB. |
### Execution
- Users can review or download the customer list.
- Whitelisted customers bypass frequency capping restrictions by default, unless a specific frequency cap explicitly opts to "Include Whitelist".
## Exception Flow
- Validation errors for file type/size during upload display an error message.