Deposit
Deposit records operational bank/cash deposits, usually connected to transport cash handling but also creatable directly. It stores account/partner context, amount, evidence, branch/warehouse context, and retry state for integration failures.
App Entry Points
| App | Target |
|---|---|
| Mobile | DepositList -> DepositDetail; can open from transport detail with prefilled payload |
| POS Terminal | deposit -> DepositDetailForm |
Workflow
Data And API Rules
Form Validation And List Actions
| Action | Guard / behavior |
|---|---|
| Create | Create dept permission is checked independently from menu visibility. |
| Account selection | Cash and bank account options depend on branch/warehouse group context; account ids and names are submitted together. |
| Invoice selection | Multiple selected invoices produce a multi-item deposit payload; totals must agree with the form amount. |
| Confirm/save | Shows a summary of amount, cash account and bank account before submitting. |
| Delete from list | Visible only to delete-authorized departments, requires confirmation, and deletes by deposit id. |
| Retry | Allowed only for the responsible/own record in Mobile; otherwise the UI reports that it is not the user's deposit. |
| Retry filter | hasRetry narrows the list to records requiring integration recovery. |
| Rule | Behavior |
|---|---|
| List source | Terminal split list calls /deposits with whs = selected whGrpCode, pageLimit: 200, and hasRetry. |
| Dedupe | Deposit list dedupes by depositId, falling back to depositNo. |
| Create/update | Detail form can create a new deposit or update an existing one. |
| Transport link | When launched from transport, saving can update transport bank/deposit flags. |
| Retry | Retry should use the existing deposit id and not create duplicate deposits. |
| Evidence | Slip/photo/evidence fields belong to the deposit record and should survive refresh. |
Permissions And Guards
| Topic | Behavior |
|---|---|
| Terminal menu key | deposit |
| deptCode menu set | -2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 13, 16, 14, 27, 30 |
| Create guard | Create button uses canCreateDeposit(...). |
| Branch rule | Available by menu permission and selected warehouse group. |
Mobile vs POS Terminal
| Topic | Mobile | POS Terminal |
|---|---|---|
| Navigation | Deposit stack; may be launched by transport | HomeScreen split-pane menu key deposit |
| Detail | Full-screen deposit form | DepositDetailForm |
| Transport link | Route params/prefill | Detail form callback updates transport |
| Retry | Detail/list action | Split list/detail action |
Developer Handoff Map
| Area | Code |
|---|---|
| Mobile list/detail | apps/mobile/src/screens/depositStack/depositListScreen, depositDetailScreen |
| Terminal detail | apps/pos-terminal/src/screens/HomeScreen/DepositDetailForm.tsx, DepositPanels.tsx |
| Service | apps/*/src/services/deposit.ts / deposit service module |
| Transport dependency | TransportDetailForm.tsx and transport update service |