TTTOP TECH MAPPUBLIC DOCUMENTATION

04 · Operating model

Business
Flows

27 current flows traced from user action through frontend, API, backend and database to status change and next flow

Customer & authSavingsContracts & paymentsSales & service

Flow inventory

HTML ให้ภาพรวมสำหรับคนอ่าน ส่วน Markdown อธิบายทั้ง 27 flows ตาม pipeline ครบ

01—05

Customer & Access

Self-registration, staff creation, login, KYC/profile completion, credential reset.

06—10

Savings Down Payment

Create account, deposit, verify/allocate, READY_FOR_CONTRACT, atomic conversion.

11—17

Contracts & Installments

Create/update/activate, submit and verify payment intent, payoff, cancellation.

18—20

Cash Sales

Create sale, void, refund with financial safeguards and audit helpers.

21—27

Commercial & Operations

Promotion claim/admin, products, staff access, collections, satisfaction, dashboard.

Golden path: savings to active contract

Current implementation path—no new rule added.

1 · CreateStaff → contracts.htmlPOST /savings/accounts → account SAVING, period OPEN
2 · DepositStaff/customer → transaction POST → savings_transactions.PENDING
3 · VerifyVerifier → verify route → allocations → periods PARTIAL/PAID
4 · Reach targetVerified sum ≥ target → account READY_FOR_CONTRACT
5 · ConvertMatching pending contract → atomic convert → account CONVERTED, contract PENDING_APPROVAL
6 · ActivateApproval/prerequisites → activate route → contract ACTIVE, schedules generated/validated
7 · PaySlip upload → payment intent PENDING → verification → schedule PAID

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