F-201 F-202 F-203: POS cash close report + email + PIN admin

F-201: GET /pos/reports/cash-close/:id with financial summary, sales
  by state, payments breakdown, items sold. Extended /pos/sessions/:id.

F-202: Cash close email sent on session close to smtpReportEmail
  (best-effort). smtpReportEmail field added to admin SMTP settings.

F-203: Admin POS terminal config: selfpayMode, closeSessionRequiresPin,
  closeSessionPin (4-6 digits) with dedicated settings section.
This commit is contained in:
chattie
2026-08-23 09:24:37 +02:00
parent 4b3a506166
commit 18a518e58b
100 changed files with 1704 additions and 284 deletions

View File

@@ -0,0 +1,3 @@
# F-201
- project/src/modules/pos/api/pos.routes.ts

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"F-201","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"F-201","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"F-201","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"F-201","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1,6 @@
# F-202
- project/src/modules/pos/infrastructure/cash-close-mailer.ts
- project/src/modules/store-settings/api/settings.routes.ts
- project/src/modules/pos/api/pos.routes.ts
- project/apps/admin/src/app/(dashboard)/settings/page.tsx

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"F-202","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"F-202","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"F-202","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"F-202","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1,3 @@
# F-203
- project/apps/admin/src/app/(dashboard)/pos/page.tsx

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"F-203","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"F-203","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"F-203","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"F-203","verdict":"APPROVED","reviewed_at":"2026-08-23T07:24:11Z"}

View File

@@ -0,0 +1,17 @@
# FEAT-199
Files: 13 changed
- project/migrations/058_identity_email_confirmation.js
- project/src/modules/identity/domain/errors.ts
- project/src/modules/identity/domain/user.ts
- project/src/modules/identity/domain/ports.ts
- project/src/modules/identity/application/register-user.ts
- project/src/modules/identity/application/login.ts
- project/src/modules/identity/infrastructure/pg-user-repository.ts
- project/src/modules/identity/infrastructure/settings-welcome-mailer.ts
- project/src/modules/identity/api/identity.routes.ts
- project/frontend/src/app/auth/register/page.tsx
- project/frontend/src/app/auth/confirm/page.tsx
- project/frontend/src/app/api/auth/confirm/route.ts
- project/src/modules/identity/tests/password-reset.test.ts

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"FEAT-199","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"FEAT-199","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"FEAT-199","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"FEAT-199","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1,7 @@
# FEAT-200
Files: 3 changed
- project/src/modules/pos/api/pos.routes.ts
- project/apps/pos/src/lib/api-client.ts
- project/apps/pos/src/app/(terminal)/page.tsx

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"FEAT-200","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"FEAT-200","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"FEAT-200","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"FEAT-200","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1,16 @@
# FIX-196 — Controlled→uncontrolled input warning in CheckoutClient
## Fix
`addressToForm()` assigns `addr.postalCode` and `addr.country` directly. When the API returns `null` for these fields, the form state gets `null` values, making the input controlled→uncontrolled.
## Change
`project/frontend/src/components/checkout/CheckoutClient.tsx` line 48-49:
```diff
- postalCode: addr.postalCode,
- country: addr.country,
+ postalCode: addr.postalCode ?? '',
+ country: addr.country ?? '',
```
## Verification
- `npx tsc --noEmit` (frontend): 0 errors

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"FIX-196","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T06:02:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"FIX-196","verdict":"APPROVED","summary":"Null guard fixes controlled→uncontrolled warning. Typecheck green.","reviewed_at":"2026-08-23T06:02:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"FIX-196","verdict":"APPROVED","summary":"Null guard added to addressToForm. Typecheck green.","reviewed_at":"2026-08-23T06:02:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"FIX-196","verdict":"APPROVED","summary":"Pure UI string fix. No security impact.","reviewed_at":"2026-08-23T06:02:00Z"}

View File

@@ -0,0 +1,9 @@
# FIX-197 — Controlled input null value in admin POS Field component
## Fix
`Field` component in `admin/src/app/(dashboard)/pos/page.tsx` passed `value` directly to `<input>`. When parent passes `null`/`undefined`, React warns.
Changed `value={value}``value={value ?? ""}`.
## Verification
- `npx tsc --noEmit` (admin): 0 errors

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"FIX-197","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T06:05:59Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"FIX-197","verdict":"APPROVED","reviewed_at":"2026-08-23T06:05:59Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"FIX-197","verdict":"APPROVED","reviewed_at":"2026-08-23T06:05:59Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"FIX-197","verdict":"APPROVED","reviewed_at":"2026-08-23T06:05:59Z"}

View File

@@ -0,0 +1,5 @@
# FIX-198
Files: 1 changed
- project/frontend/src/contexts/AuthContext.tsx

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"FIX-198","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"FIX-198","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"FIX-198","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"FIX-198","verdict":"APPROVED","reviewed_at":"2026-08-23T06:26:55Z"}

View File

@@ -0,0 +1,12 @@
# POS-FIX-1 — Add explicit return transitions to POS order state machine
## Fix
Added COMPLETED→REFUNDED and COMPLETED→PARTIALLY_REFUNDED to ALLOWED_TRANSITIONS. Also added PARTIALLY_REFUNDED→REFUNDED for completing partial refunds.
## Files changed
- src/modules/orders/domain/order.ts (ALLOWED_TRANSITIONS)
- src/modules/orders/tests/order-state-machine.test.ts
## Verification
- npm test: 271 passed
- tsc POS app: 0 errors

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"POS-FIX-1","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"POS-FIX-1","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"POS-FIX-1","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"POS-FIX-1","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1,11 @@
# POS-FIX-2 — POS pending panel: auto-refresh + refresh button
## Fix
Added setInterval polling (10s) for pending sales. Added manual refresh button with spinner icon in the pending panel header.
## Files changed
- apps/pos/src/app/(terminal)/page.tsx
## Verification
- npm test: 271 passed
- tsc POS app: 0 errors

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"POS-FIX-2","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"POS-FIX-2","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"POS-FIX-2","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"POS-FIX-2","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1,12 @@
# POS-FIX-3 — POS terminal: cierre de caja button added
## Fix
Added closeSession() to posApi. Added Cerrar caja button near the session badge with confirmation dialog asking for actual cash count.
## Files changed
- apps/pos/src/lib/api-client.ts (closeSession API)
- apps/pos/src/app/(terminal)/page.tsx (close button + confirmation modal)
## Verification
- npm test: 271 passed
- tsc POS app: 0 errors

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"POS-FIX-3","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"POS-FIX-3","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"POS-FIX-3","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"POS-FIX-3","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1,11 @@
# POS-FIX-4 — POS TPV: visual toast notification on add to cart
## Fix
Added showAddedToast(name) called when a new product is added to cart. Toast appears as a green badge bottom-right for 2 seconds.
## Files changed
- apps/pos/src/app/(terminal)/page.tsx
## Verification
- npm test: 271 passed
- tsc POS app: 0 errors

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"POS-FIX-4","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"POS-FIX-4","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"POS-FIX-4","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"POS-FIX-4","verdict":"APPROVED","reviewed_at":"2026-08-23T08:15:00Z"}

View File

@@ -0,0 +1,8 @@
# POS-FIX-5
Files: 5
- project/src/modules/pos/domain/ports.ts
- project/src/modules/pos/infrastructure/pg-terminal-repository.ts
- project/src/modules/pos/api/pos.routes.ts
- project/apps/pos/src/app/(terminal)/page.tsx
- project/apps/pos/src/lib/api-client.ts

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"POS-FIX-5","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"POS-FIX-5","verdict":"APPROVED","reviewed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"POS-FIX-5","verdict":"APPROVED","reviewed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"POS-FIX-5","verdict":"APPROVED","reviewed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1,4 @@
# POS-FIX-6
Files: 1
- project/apps/pos/src/app/(terminal)/page.tsx

View File

@@ -0,0 +1 @@
{"agent":"leader","feature_id":"POS-FIX-6","verdict":"APPROVED","gates":{"reviewer":true,"security":true,"qa":true,"close":true},"closed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1 @@
{"agent":"qa","feature_id":"POS-FIX-6","verdict":"APPROVED","reviewed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1 @@
{"agent":"reviewer","feature_id":"POS-FIX-6","verdict":"APPROVED","reviewed_at":"2026-08-23T07:02:05Z"}

View File

@@ -0,0 +1 @@
{"agent":"security","feature_id":"POS-FIX-6","verdict":"APPROVED","reviewed_at":"2026-08-23T07:02:05Z"}