Appearance
Point of Sale
| Backlog field | Value |
|---|---|
| Story ID | AP-SAL-006 |
| Epic | Sales |
| Story type | Business workflow |
| Review status | Draft - business analyst and business owner review required |
| Source evidence | AppsPortal.Apis controller, application command/query handlers, validators, domain entities, and matching MFE workflow where available |
| Last source review | 2026-07-10 |
User story
As cashiers, I want to open sessions and issue or return POS invoices so that cash and stock remain tied to the responsible session.
Posting reference: AppsPortal Posting Ledger explains debit/credit construction. Delegation and Interaction Contracts explains module ownership, delegated commands, linked records, commit boundaries, and reversal propagation.
Acceptance criteria
- Only authorized users can view or execute the feature's actions.
- Required business data, active dependencies, tenant/branch scope, and current document state are validated.
- Invalid requests return actionable validation errors without applying a partial change.
- Search, list, view, print, and export operations use the same authorized business scope.
- Material create, edit, status, approval, posting, reversal, and integration actions are auditable where applicable.
- Financial or stock effects are applied atomically and no more than once.
Posting details
- POS Session Post is an orchestration transaction over all eligible session sales, returns, receipts, and refunds.
- Validate the session is not already Posted, branch/device/user context, selected treasury, child documents, stock, payment methods, accounts, and period.
- Delegate session Stock Out and Stock In to Inventory; delegate Payment In and Payment Out to Finance; each delegate creates its own linked journals/subledger effects.
- Store/retain the child links and mark the POS Session Posted only after every category succeeds.
- The session is the commit boundary: one failed child prevents partial stock, cash, or session closure.
General ledger posting
| Child transaction | Debit | Credit | Condition |
|---|---|---|---|
| Sale | Receivable/cash and COGS | Revenue/tax and Warehouse GL | Uses Sales Invoice plus Stock Out for storable items. |
| Return | Sales Return/tax reversal and Warehouse GL | Receivable/refund and COGS | Stock In only for storable items. |
| Receipt/refund | Bank/Treasury or party account | Party account or Bank/Treasury | Delegated Payment In/Out. |
| Service sale/return | Commercial accounts only | Commercial accounts only | No Stock Out/In. |
Other module and document effects
| Area | Effect | Conditional/no effect |
|---|---|---|
| Inventory | Delegates Stock Out for sold storable items and Stock In for returned storable items. | Services do not affect inventory. |
| Finance | Delegates receipts/refunds and updates treasury/bank transactions. | Non-cash/unpaid child documents follow their own payment rules. |
| Session | Stores all child links and closes only after every child commits. | Any child failure leaves session unposted. |
Core acceptance scenarios
- Given an open POS session whose child sales/returns and selected treasury are valid, when the authorized user closes/posts the session, then delegated Stock In, Stock Out, Payment In, and Payment Out effects commit before the session becomes Posted.
- Given one child category fails validation, when the operation is attempted, then the session and all delegated batch effects remain unposted.
- Given the same Post request is retried after success, when the source is no longer Draft, then no duplicate journal, stock, balance, payment, or lifecycle effect is created.
Business rules
Required
Open session, authorized branch/device/user, treasury/payment methods, warehouse, and valid sale/return lines are required.
Optional or conditional
Customer, discount, tax exemptions, notes, and mixed methods are conditional.
Action behavior
Posting a session batches linked Stock In/Out and Payment In/Out, marks session Posted, and commits atomically.
Blocking rule or downstream effect
Session close fails when linked documents, cash reconciliation, stock, accounts, or period are invalid.
Frontend page coverage
The following UI coverage is sourced from the pulled MFE route configuration. A Module-level supporting artifact mapping is evidence of a reachable screen, but requires BA confirmation that it belongs to this story rather than a more specific feature story.
| Route/page | Component | Mode | Route permission/guard | Mapping confidence | Source |
|---|---|---|---|---|---|
| (module default) | PosSalesInvoiceComponent | List/navigation | Permission: AppSalesPermissions.POSSalesInvoice_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/sales/src/app/remote-entry/transaction/transaction.module.ts:100 |
| (module default) | ReturnPosSalesInvoiceComponent | List/navigation | Permission: AppSalesPermissions.POSReturnSalesInvoice_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/sales/src/app/remote-entry/transaction/transaction.module.ts:136 |
| pos-return-sales-invoice | MainReturnPosSalesInvoiceComponent | List/navigation | Permission: AppSalesPermissions.POSReturnSalesInvoice_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/sales/src/app/remote-entry/transaction/transaction.module.ts:126 |
| pos-sales-invoice | MainPosSalesInvoiceComponent | List/navigation | Permission: AppSalesPermissions.POSSalesInvoice_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/sales/src/app/remote-entry/transaction/transaction.module.ts:90 |
| view/:id | ReturnPosSalesInvoiceViewComponent | View/detail | Permission: AppSalesPermissions.POSReturnSalesInvoice_View; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/sales/src/app/remote-entry/transaction/transaction.module.ts:148 |
| view/:id | ViewPosSalesInvoiceComponent | View/detail | Permission: AppSalesPermissions.POSSalesInvoice_View; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/sales/src/app/remote-entry/transaction/transaction.module.ts:112 |
Observed frontend fields and validation
| Component | Control | Observed frontend rule | Component source |
|---|---|---|---|
| - | - | No reactive formControlName controls were found for the routed components; review template-driven/shared child components. | Route sources above |
Observed frontend actions
| Component | Click action/handler | Business review requirement | Component source |
|---|---|---|---|
| PosSalesInvoiceComponent | onView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/sales/src/app/remote-entry/transaction/pages/pos-sales-invoice/pos-sales-invoice-list/pos-sales-invoice.component.ts |
| ReturnPosSalesInvoiceComponent | onView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/sales/src/app/remote-entry/transaction/pages/return-pos-sales-invoice/return-pos-sales-invoice-list/return-pos-sales-invoice.component.ts |
Page-specific frontend acceptance criteria
- (module default) - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Permission: AppSalesPermissions.POSReturnSalesInvoice_List; Guards: PolicyAuthGuard
- pos-return-sales-invoice - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Permission: AppSalesPermissions.POSReturnSalesInvoice_List; Guards: PolicyAuthGuard
- pos-sales-invoice - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Permission: AppSalesPermissions.POSSalesInvoice_List; Guards: PolicyAuthGuard
- view/:id - View/detail: Load an authorized immutable/detail representation with status-aware actions, linked records, print/export where exposed, and not-found/forbidden handling. Security observed: Permission: AppSalesPermissions.POSSalesInvoice_View; Guards: PolicyAuthGuard