Repository navigation
feat(invoices): allow deposits to exceed the invoice amount - #2189
Conversation
- Remove the DEPOSITS_EXCEED_INVOICE_TOTAL invariant everywhere: deposit create/update, refund decrease/delete, invoice amount decrease and quotation conversion; delete the error code, client handling and en/de keys - Loosen the refund cap to max(invoice amount, gross deposit sum), checked on refund create and increase (REFUND_EXCEEDS_INVOICE details gain depositTotal and refundCap) - Deposit form shows a non-blocking over-deposit warning (role=status); the convert-quotation overpaid banner is now advisory and no longer disables Confirm - Tests cover ACs 1-7 and over-deposit aggregates (residual clamps to 0, no NaN/negative); wiki API contract/schema and user guides updated Fixes #2188 Co-Authored-By: Claude backend-developer <noreply@anthropic.com> Co-Authored-By: Claude frontend-developer <noreply@anthropic.com> Co-Authored-By: Claude translator <noreply@anthropic.com> Co-Authored-By: Claude qa-integration-tester <noreply@anthropic.com> Co-Authored-By: Claude e2e-test-engineer <noreply@anthropic.com> Co-Authored-By: Claude docs-writer <noreply@anthropic.com> Co-Authored-By: Claude dev-team-lead <noreply@anthropic.com>
|
VERDICT: APPROVE [security-engineer] Scoped review (deposit/invoice/quotation-conversion services + tests): no security findings. Removed checks were business-invariant validators, not authz/input guards; auth gates, AJV schemas and parameterized drizzle queries are untouched. Refund cap computed server-side in-transaction. Informational: lowering/deleting a deposit after refunds can leave refunds above the cap (data integrity only, no security impact). |
|
VERDICT: APPROVE [ux-designer] Design review (client scope). Token adherence: the overpaid banner swaps to --color-warning / -bg / -text-on-light, which match shared bannerWarning and switch in dark mode. The deposit form warning reuses sharedStyles.bannerWarning, so there is no duplication. A11y: the advisory banners use role=status (no redundant aria-live), the amount input gets aria-describedby only while the warning shows, and Confirm stays enabled. Copy: en and de are in parity and are advisory in tone. No hardcoded values. No findings. |
|
VERDICT: REQUEST_CHANGES [product-owner] Requirements review of #2188 (ACs 1-13): all functional ACs are met. One documentation finding blocks approval. Verified:
Finding 1 (fix-in-session, low effort): wording in Non-blocking, no action: CI shards were still pending at review time; the merge-time Board: issue #2188 stays In Progress until merge, then UAT. The warning and banner are rendered artefacts with visual ACs, so this is not Done-on-merge. Use |
|
VERDICT: REQUEST_CHANGES [product-architect] Review of PR #2189 (feat(invoices): allow deposits to exceed the invoice amount) Architecture / contract compliance: looks good.
Findings
No deferrals. |
…ver-deposits (#2188) - Final payment is max(0, invoice total - deposits - refunds already received); over-deposits display as 0 and pending refunds show under "Refunds due to you" - Invoice amount edits enforce only the itemized-amount floor; drop the misplaced refund-cap bullet Fixes #2188 Co-Authored-By: Claude docs-writer <noreply@anthropic.com> Co-Authored-By: Claude dev-team-lead <noreply@anthropic.com>
|
VERDICT: APPROVE [product-owner] Round 2: commit 5af573b closes my round-1 finding. The edit-invoice-total section now lists one constraint (itemized amount floor); the misplaced refund-cap bullet and the 'two invariants' wording are gone. The invoice-deposits.md formula (max(0, total - deposits - refunds)) and the 'Refunds due to you' label match the shipped UI string. No new findings. |
|
VERDICT: APPROVE [product-architect] Round 2 re-review of fix commit 5af573b against my round-1 finding (comment 6035535024).
Finding resolved. No new findings. |
…val specs Co-Authored-By: Claude dev-team-lead <noreply@anthropic.com>
|
🎉 This PR is included in version 2.19.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
DEPOSITS_EXCEED_INVOICE_TOTALinvariant everywhere it was checked: deposit create/update, refund decrease/delete (Deposits: lowering or deleting a refund is not checked against the net-deposit rule #2127), invoice amount decrease, and quotation conversion (server and client). Also removes the error code, its client handling, and the en/de i18n keys.max(invoice amount, gross deposit sum). It is checked on refund create and on refund increase.REFUND_EXCEEDS_INVOICEdetails gaindepositTotalandrefundCap.bannerWarning,role="status", linked througharia-describedby) when net deposits would exceed the invoice amount. The convert-quotation overpaid banner is now advisory: it uses warning tokens and no longer disables Confirm.99016a6), and so are the user guides.Fixes #2188
Test plan
finalPaymentAmountandopenAmountnever negative or NaNcomputeDepositExcess, warning visibility, accessibility and non-blocking save, convertcanConfirmwith a shortfall, en/de i18n parityCo-Authored-By: Claude backend-developer noreply@anthropic.com
Co-Authored-By: Claude frontend-developer noreply@anthropic.com
Co-Authored-By: Claude translator noreply@anthropic.com
Co-Authored-By: Claude qa-integration-tester noreply@anthropic.com
Co-Authored-By: Claude e2e-test-engineer noreply@anthropic.com
Co-Authored-By: Claude docs-writer noreply@anthropic.com
Co-Authored-By: Claude dev-team-lead noreply@anthropic.com
🤖 Generated with Claude Code