Terminal guards on cancel and revise, and stop swallowing bad input

Fixkamo-shared-library
Shipped
August 26, 2026 at 7:25 PM UTC
Author
Kamo
Commit
eea16de

cancel() and revise() had no isTerminal() guard, so an ACCEPTED quote could be flipped to CANCELLED or REVISED while acceptedAt and acceptedByName survived — a row whose status contradicts its own acceptance record. update() already guarded, so the omission was inconsistent, not deliberate. Three swallowing catches now throw: an unknown ?status returned every quote in the org rather than an error; an unrecognised discountType became NONE, so a promised discount silently vanished at HTTP 200; and an unparseable lead id detached the quote from its lead — on the field whose own javadoc says it is critical because JS mangles it.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing