feat(POS-002): completed feature

This commit is contained in:
chattie
2026-08-21 21:55:43 +02:00
parent c68cb25ed6
commit 0a1d32ecc3
33 changed files with 1169 additions and 107 deletions

View File

@@ -132,9 +132,13 @@ POS-NNN [P?] [Phase] Title
- **Why:** Customer returns are an everyday reality.
- **Scope IN:** `POST /pos/sales/:id/refund` with line-level granularity. Refunds create negative `payments_transactions` rows and `inventory_movements.operation='set_available'` rows.
- **Refund policy (per operator decision 2026-08-21):**
- Refunds allowed up to **15 days** after sale. Server returns 409 if the sale is older.
- Refunds > **50 €** require `pos_manager` or `admin` role; smaller refunds accept `pos_cashier`.
- Limits are configurable in `store_settings` (`refund_window_days`, `refund_manager_threshold_cents`).
- **Scope OUT:** Refund UI (POS-026).
- **Touches:** `project/src/modules/pos/api/pos.routes.ts`, `project/src/modules/pos/application/refund-pos-sale.ts`.
- **Acceptance:** partial refund returns `PARTIALLY_REFUNDED`, full refund returns `REFUNDED`; stock added back; audit logged with actor.
- **Acceptance:** partial refund returns `PARTIALLY_REFUNDED`, full refund returns `REFUNDED`; stock added back; audit logged with actor; refund window respected; manager threshold enforced.
### `POS-014` [P0] [Phase 2] POS API — sale cancellation (within window)
@@ -280,9 +284,10 @@ POS-NNN [P?] [Phase] Title
- **Why:** Touch-friendly UI is a separate design.
- **Scope IN:** CSS variables for hit-target size and spacing; conditional class `touch` on root; bigger QuickProduct tiles; on-screen numeric keypad always visible during cash payment.
- **Hardware target (per operator decision 2026-08-21):** 10-inch tablet in landscape, with `(pointer: coarse)` media query as the detection signal. Minimum hit target 48×48 px (CSS variable `--touch-target-min`); preferred 56×56 px. Cash payment screen reserves ≥ 60% of viewport for the keypad.
- **Scope OUT:** Native number pad (deferred to native bridge).
- **Touches:** `apps/pos/src/styles/touch.css`, `apps/pos/src/components/pos/**` styles.
- **Acceptance:** manual test on a 10-inch touchscreen tablet shows no accidental taps; keypad is reachable without a physical keyboard.
- **Acceptance:** manual test on a 10-inch touchscreen tablet (and on a 10-inch tablet portrait) shows no accidental taps; keypad is reachable without a physical keyboard.
### `POS-031` [P2] [Phase 5] Keyboard shortcuts (desktop)
@@ -344,17 +349,18 @@ POS-NNN [P?] [Phase] Title
- **Touches:** `project/src/shared/hardware/native-bridge-spec/**` (new, optional).
- **Acceptance:** README documents the HTTP contract and how a bridge would slot in.
### `POS-038` [P2] [Phase 6] Vendor adapter: SumUp (deferred)
### `POS-038` [P3] [Phase 6] Vendor adapter: SumUp (DEFERRED)
- **Why:** SumUp is a likely first datáfono vendor.
- **Status:** P3 until operator picks SumUp.
- **Status:** **DEFERRED indefinitely** (operator decision 2026-08-21: stays manual). This ticket remains in the backlog as a placeholder; reopen only if the operator commits to SumUp.
- **Scope IN:** native bridge process (`pos-sumup-bridge`) + `apps/pos/src/lib/hardware/sumup-payment-terminal-adapter.ts`.
- **Touches:** new out-of-repo Node project (not in this codebase).
- **Acceptance:** SumUp terminal charges the customer; auth code returns to POS; payment is recorded in `payments_transactions`.
### `POS-039` [P3] [Phase 6] Scale adapter
### `POS-039` [P3] [Phase 6] Scale adapter (DEFERRED)
- **Why:** Some products are sold by weight.
- **Status:** **DEFERRED indefinitely** (operator decision 2026-08-21: no scale at first). Ticket remains as a placeholder; reopen only if a scale is procured.
- **Scope IN:** Scale adapter interface (already in POS-034); browser manual entry in Phase 5; native bridge in Phase 7+.
- **Scope OUT:** Vendor-specific bridges.
- **Touches:** `apps/pos/src/lib/hardware/scale-adapter.ts`.