Reject invalid refund amounts before automatic action - #5
Conversation
|
Thanks. This duplicates #4 and both conflict - please rebase and keep one implementation. |
c1be14b to
0615758
Compare
|
Rebased this PR onto current Validation on |
Require refund amounts to be finite and greater than zero before automatic action. Escalate invalid values with a clear reason and cover valid, boundary, invalid, and missing-amount policy paths.
0615758 to
3c91621
Compare
|
Follow-up: added the exact-at-limit ($50) regression assertion to the existing policy test without adding another harness. Final pushed head is |
What & why
The refund guardrail currently auto-resolves zero and negative values, and treats non-finite values as ordinary over-limit refunds. This validates the amount before any automatic action so malformed triage output is routed to a human with a clear reason.
Closes #3
Changes
npm testwithout adding dependenciesValidation
npm test— 4/4 pass; repeated successfully 20 consecutive times<= 0to< 0) — fails the invalid-amount regression as expectednpx tsc --noEmit— passnpm run build— passopennextjs-cloudflare build— pass; bundle generated locally, no deploymentgit diff --check— passnpm ci— pre-existing failure: the committed lockfile no longer satisfies the ranged versions inpackage.jsonnpm run lint— pre-existing failure:next lintis no longer a supported Next.js commandChecklist