1.6 KiB
1.6 KiB
F-191 — Implementer Evidence
Feature
POS terminal and daily cash close reconciliation.
Changes
1. src/modules/pos/application/receive-rest-payment.ts
Relaxed the terminal/session mismatch check (lines 64-77 new):
- Original check required
order.cash_session_id === input.cashSessionIdunconditionally. - New logic (F-191): if the original session is OPEN, still requires exact match. If the original session is CLOSED, allows payment from any OPEN session on the same terminal.
- Preserves security: orders on OPEN sessions must use that session (no cross-session payment).
2. src/modules/pos/api/pos.routes.ts
Added GET /pos/sessions/:id route (after close route, line ~564):
- Returns full session details plus
salesCount,salesTotalCents,pendingCount. - Works for both OPEN and CLOSED sessions.
- POS cashier can see session summary including variance (if closed).
Enhanced GET /pos/sessions admin route with new filters:
terminalId— filter by terminaldateFrom,dateTo— filter by date range (inclusive)limitincreased to max 100
Existing code (no changes needed)
CloseCashSessionUseCase— already exists, already storesvarianceCents,closedAtPgCashSessionRepository.close()— already storesdifference_centsPOST /pos/sessions/:id/close— already existsGET /pos/sessions(admin) — already exists, enhanced with filtersexpected_cash_centsmaintenance — already atomic via sale/rest-payment/return
Verification
| Check | Result |
|---|---|
npm test |
269 passed, 96 skipped |
npx tsc --noEmit |
0 errors |
./scripts/verify.sh |
OK |