mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
fix(targets): accept a child's weight target below 30 kg
A weight target was refused below 30 kg on every save path (the own targets editor and a managed record's settings parse the same schema), while a weight reading is accepted from 1 kg. A guardian setting 20 to 23 kg for a child got only "please check your entries". The target floor is now the measurement floor. The weight bands on the dashboard and the weight page started their low red zone at a hard-coded 30 kg, so a target below it lost that zone; the edge now follows the same floor. Bands are clipped to the chart's own domain, so an adult's chart looks the same. `buildWeightBandsFromHeight` had no caller left and goes; the band builder's 30/250 defaults, which every caller overrode, go with it. The unit-adapter test keeps its inward-rounding check at the new floor (1 kg is 2.2046 lb, offered as 2.3).
This commit is contained in:
1 parent
46b1cd6f34
commit
02856e7f37
10 files changed
+63
-30
No files matched your search
@@ -96,7 +96,7 @@ beforeEach(() => {
|
||||
|
||||
describe("PUT /api/user/thresholds — 422 multi-issue (v1.4.43 W6)", () => {
|
||||
it("surfaces TWO simultaneous validation errors", async () => {
|
||||
// WEIGHT bounds are min=30, max=300. Sending min > max + a value
|
||||
// WEIGHT bounds are min=1, max=300. Sending min > max + a value
|
||||
// out of bounds on PULSE forces two range errors.
|
||||
const res = await PUT(
|
||||
putReq({
|
||||
|
||||
Reference in new issue
Block a user