04 · Operating model
Business
Flows
27 current flows traced from user action through frontend, API, backend and database to status change and next flow
Flow inventory
HTML ให้ภาพรวมสำหรับคนอ่าน ส่วน Markdown อธิบายทั้ง 27 flows ตาม pipeline ครบ
Customer & Access
Self-registration, staff creation, login, KYC/profile completion, credential reset.
Savings Down Payment
Create account, deposit, verify/allocate, READY_FOR_CONTRACT, atomic conversion.
Contracts & Installments
Create/update/activate, submit and verify payment intent, payoff, cancellation.
Cash Sales
Create sale, void, refund with financial safeguards and audit helpers.
Commercial & Operations
Promotion claim/admin, products, staff access, collections, satisfaction, dashboard.
Golden path: savings to active contract
Current implementation path—no new rule added.
contracts.html → POST /savings/accounts → account SAVING, period OPENsavings_transactions.PENDINGPARTIAL/PAIDREADY_FOR_CONTRACTCONVERTED, contract PENDING_APPROVALACTIVE, schedules generated/validatedPENDING → verification → schedule PAIDFinancial lifecycle constraints
Direct payoff: POST /contracts/:id/payoff returns 410. The supported path is PAYOFF payment intent → verification → contract CLOSED.
Direct deletion: DELETE /contracts/:id returns 410. Use cancellation where allowed.
Savings conversion: active atomic handler exists; old “BROKEN” label is a MAP/CODE CONFLICT.