KamoCRM

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

Fixkamo-shared-library
Shipped
26 ஆகஸ்ட், 2026 அன்று 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?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing