02 · Integration surface
API
Route Map
Single PHP router, 59 current method/route records: 57 active and 2 deliberately disabled with HTTP 410
MAP/CODE CONFLICT: metadata เดิมระบุ 74 APIs แต่ array รายการเดิมว่าง Current code inspection พบ 59 method/route records ตามที่สรุปที่นี่
Route groups
ตารางนี้เป็น human-readable overview; route-by-route read/write/caller/handler ครบทุก record อยู่ใน Markdown
| Domain | Representative routes | Reads / writes | Status |
|---|---|---|---|
| Auth | POST /auth/staff/loginPOST /auth/customer/loginPOST /auth/customer/registerPOST /auth/customer/change-password | employees/roles or customers; auth metadata | ACTIVE |
| Customers | GET/POST /customersGET/PUT/DELETE /customers/:idPOST /customers/:id/reset-password | customer profile and service summaries | ACTIVE |
| Savings | GET/POST /savings/accountsPOST .../transactionsPOST .../verifyPOST .../convert | accounts, transactions, periods, allocations, contracts | ACTIVE |
| Contracts | GET/POST /contractsPUT /contracts/:idPOST .../activatePOST .../cancel | contracts, KYC, schedules, promotions, audit | ACTIVE |
| Direct payoff | POST /contracts/:id/payoff | No writes; use PAYOFF payment intent | DISABLED 410 |
| Contract deletion | DELETE /contracts/:id | No writes; use cancellation workflow | DISABLED 410 |
| Payments | POST /payment-slipsGET /payment-intentsPOST /contracts/:id/payment-intentsPOST /payment-intents/:id/verify | managed files, intents, payments, schedules, contracts | ACTIVE |
| Cash sales | GET/POST /cash-salesPOST .../voidPOST .../refund | cash sales/refunds/promotions/audit | ACTIVE |
| Promotions | /promotions, /promotions/:id/packages, /promotion-events, eligible/claim/validate | campaign/package/benefit/rule/event tables | ACTIVE |
| Products & employees | GET/POST /productsGET/POST /employeesPATCH /employees/:id/toggle | products; employees/roles | ACTIVE |
| Service & dashboard | GET /dashboard/summaryGET /follow-ups/todayGET /follow-ups/satisfactionPOST /follow-upsPOST /support/payment-pause-requests | financial aggregates and follow_up_logs | ACTIVE |
Enforcement model
PUBLIC
3 unauthenticated entries
Staff login, customer login, customer registration.
AUTH
Deny by default
Other routes require authenticated scope; customer routes apply ownership checks.
ADMIN
Privileged mutations
Employee changes, selected promotion changes, customer deletion, cash void/refund.
FINANCE
Idempotency & audit
Payment intents and financial actions use transaction locking, idempotency, and audit helpers.