The backend uses PHPUnit against local PostgreSQL. The test base must refuse a remote database. Existing focused coverage includes Order intake, payment-status filtering, Trip loading/completion gates, Ops warehouse routes, commercial catalogue contracts, idempotency, legacy ingestion/projection, quotation effective status, serial scanning and upload URLs.
The frontend production workflow runs a full Next.js build, which includes TypeScript/build validation. The Ops slice additionally uses TypeScript, ESLint and unit tests for BU-specific rules such as Trip completion, scanning, tab access, payment limits and stock labels.
Use the repository’s lockfiles and documented commands. Do not substitute a different package manager or silently regenerate lockfiles during diagnosis.
| Change area | Minimum behaviour to verify |
|---|---|
| Authentication/access | Login, local membership, module denial and branch denial |
| Customer/Order | Phone lookup, Draft save, Confirm Gate and permanent numbering |
| Trip | Assignment, loading gate, proof, serial direction and Job Done |
| Payment | Record, evidence requirement, verify, issue/resolution and outstanding math |
| Recurring | Schedule creation, receipt verification, Paid/Due recalculation and voiding |
| Refund | Independent approver, processing, payout proof and Paid balance effect |
| Inventory | One serial movement and one batch movement with correct source/destination |
| Procurement | Partial receipt, serial capture and inbound movement |
| Legacy sync | Ingestion, projection, mapping reuse and health output |
| OE/Ops | Correct BU routing, user ownership and one field action through OE |
Monitor more than HTTP health:
Start from the affected business reference: internal Order ID, customer-facing Order number, Trip number, payment reference, refund reference, PO number or serial. Then trace:
Do not “fix” a stuck record by editing its status directly. Find the failed guard or dependency and use the intended service action or a reviewed forward repair.
| Symptom | Likely area |
|---|---|
| User can authenticate but sees no system | Missing/inactive local membership or branch access |
| Ibnu Sina absent from Ops picker | Not enabled in the build, OE inert, or user not invited/provisioned |
| Trip cannot start | Warehouse loading incomplete or short-load reason missing |
| Trip cannot complete | Missing required product photos or serial direction |
| Payment cannot verify | Evidence rule, wrong state or permission |
| Export says complete but accounting has nothing | AutoCount stub/outbox not connected to a real writer |
| Stock is in the wrong place | Missing movement, wrong direction or incomplete lorry/return step |
| Legacy records stop updating | Ingestion/projection scheduler, queue or mapping issue |
Production PostgreSQL and Storage require separately owned backup policies. Record recovery-point and recovery-time objectives with the infrastructure owner. Restore tests must include database relationships, storage objects and the integration state needed to prevent replay duplication.
After restoring an older database, pause inbound legacy/integration writes until the restored high-water marks, mappings and idempotency state are understood. Replaying without them can duplicate Orders, payments or stock movements.