From ca611467ffa9af773c8c3f70993582d3fefbae3f Mon Sep 17 00:00:00 2001 From: chattie Date: Sat, 22 Aug 2026 19:07:28 +0200 Subject: [PATCH] feat(F-180): completed feature --- backlog/features.json | 12 +++++---- .../apps/pos/src/components/DiscountPanel.tsx | 24 +++++++++-------- work/artifacts/F-180/architect.md | 3 +++ work/artifacts/F-180/documenter.md | 3 +++ work/artifacts/F-180/implementer.md | 3 +++ work/artifacts/F-180/leader-close.json | 1 + work/artifacts/F-180/qa.json | 1 + work/artifacts/F-180/reviewer.json | 1 + work/artifacts/F-180/security.json | 1 + work/current.md | 4 +-- work/runtime-status.json | 26 +++++++++---------- 11 files changed, 48 insertions(+), 31 deletions(-) create mode 100644 work/artifacts/F-180/architect.md create mode 100644 work/artifacts/F-180/documenter.md create mode 100644 work/artifacts/F-180/implementer.md create mode 100644 work/artifacts/F-180/leader-close.json create mode 100644 work/artifacts/F-180/qa.json create mode 100644 work/artifacts/F-180/reviewer.json create mode 100644 work/artifacts/F-180/security.json diff --git a/backlog/features.json b/backlog/features.json index 5283478..99eecbc 100644 --- a/backlog/features.json +++ b/backlog/features.json @@ -7064,13 +7064,15 @@ "description": "POS discount input must accept 3,50 or 3.50 as EUR instead of raw cents", "priority": "high", "risk": "med", - "status": "pending", + "status": "done", "created_at": "2026-08-22", "gates": { - "reviewer": false, - "security": false, - "qa": false - } + "reviewer": true, + "security": true, + "qa": true, + "close": true + }, + "completed_at": "2026-08-22T17:07:28Z" }, { "id": "F-181", diff --git a/project/apps/pos/src/components/DiscountPanel.tsx b/project/apps/pos/src/components/DiscountPanel.tsx index c79439d..9c99aef 100644 --- a/project/apps/pos/src/components/DiscountPanel.tsx +++ b/project/apps/pos/src/components/DiscountPanel.tsx @@ -15,13 +15,15 @@ export default function DiscountPanel({ unitPriceCents, onApply, onClose }: Disc const [value, setValue] = useState(''); const [error, setError] = useState(''); - const discountCents = - mode === 'percent' - ? Math.round(((Number(value) || 0) / 100) * unitPriceCents) - : Number(value) || 0; + const numericValue = Number(value.replace(',', '.')); + const discountCents = Number.isFinite(numericValue) + ? mode === 'percent' + ? Math.round((numericValue / 100) * unitPriceCents) + : Math.round(numericValue * 100) + : 0; const handleApply = () => { - if (!value) return; + if (!value || numericValue <= 0) return; if (discountCents > unitPriceCents) { setError('Descuento mayor al precio'); return; } onApply(discountCents); onClose(); @@ -36,13 +38,13 @@ export default function DiscountPanel({ unitPriceCents, onApply, onClose }: Disc