PRD / Khái niệm
Hiểu các khái niệm cốt lõi của NotiBoost là cần thiết để sử dụng hiệu quả.
Event
Event là một sự kiện phát sinh từ hệ thống sản phẩm của bạn.
Cấu trúc Event
{
"event_name": "order_created",
"event_id": "evt_001",
"occurred_at": "2025-12-01T10:00:00Z",
"user_id": "u_123",
"properties": {
"order_id": "A001",
"amount": 350000
}
}
Event Fields
- event_name - Tên của event, ví dụ: order_created, payment_success
- event_id - ID duy nhất cho event này
- occurred_at - Thời điểm event xảy ra
- user_id - ID của user liên quan
- properties - Các thuộc tính bổ sung của event
Rules
Rules định nghĩa khi nào và flow nào được trigger dựa trên event properties.
Ví dụ Rule
{
"name": "order_created_rule",
"condition": "event_name == 'order_created' AND properties.amount > 100000",
"action": "trigger_flow",
"flow_id": "flow_order_confirm"
}
Đặc điểm của Rules
- Condition-based: Đánh giá dựa trên event properties
- Deterministic: Cùng event luôn match cùng rule
- Versioned: Có thể version và rollback
- Hot-reloadable: Thay đổi không cần restart
Flows
Flow là một notification workflow định nghĩa cách xử lý và gửi notification.
Components của Flow
- Rules - Rules trigger flow này
- Steps - Các bước trong workflow
- Channels - Channels được sử dụng để gửi
- Fallback - Chiến lược fallback khi fail
Channels
Channels là các kênh gửi notification.
Channel Types
- ZNS - Zalo Notification Service - Native Zalo messaging
- Email - Email messaging cho notifications
- App Push - Mobile push notifications
- SMS - SMS - Fallback channel
Orchestration
Orchestration là quá trình điều phối notification flows.
Orchestration Patterns
- Sequential - Gửi notifications theo thứ tự tuần tự
- Parallel - Gửi notifications song song
- Conditional - Gửi dựa trên điều kiện
- Delayed - Gửi với delay
Determinism
NotiBoost sử dụng deterministic logic:
- Cùng event luôn tạo ra cùng kết quả
- Mọi quyết định đều có thể giải thích
- Có thể debug và tái hiện
- Không có AI hay machine learning
