The cpayAmountField schema applies .coerce.number().finite(). coerce turns the JSON string "Infinity" into a float, and a DOUBLE column would store it — poisoning every downstream sum / aging-bucket calculation.
The "accepts negative cpayAmount" test in customerpayment.test.js comments that the schema "blocks 0 and the infinities" — but only the zero case has an explicit test. injbAmount in invoicejob.test.js has the Infinity case covered; cpayAmount doesn't.
Fix: add POST + PATCH cases covering "Infinity" / "-Infinity" rejection. Mirrors invoicejob's coverage.
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/
The
cpayAmountFieldschema applies.coerce.number().finite().coerceturns the JSON string"Infinity"into a float, and a DOUBLE column would store it — poisoning every downstream sum / aging-bucket calculation.The "accepts negative cpayAmount" test in
customerpayment.test.jscomments that the schema "blocks 0 and the infinities" — but only the zero case has an explicit test.injbAmountininvoicejob.test.jshas the Infinity case covered; cpayAmount doesn't.Fix: add POST + PATCH cases covering
"Infinity"/"-Infinity"rejection. Mirrors invoicejob's coverage.Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/