From 8ac19e422a7c2b37003e0581c9c9fc8dad49457e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 15 Oct 2026 23:54:09 +0200 Subject: [PATCH] docs(api): regenerate the contract for the backup's medication composition --- docs/api/openapi.yaml | 45 +++++++++++++++++++++ src/lib/nutrients/__tests__/catalog.test.ts | 4 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index 35b749d0c..f1aa2a0a4 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -38740,6 +38740,50 @@ components: - pausedAt - resumedAt additionalProperties: {} + ingredients: + default: [] + type: array + items: + type: object + properties: + id: + type: string + minLength: 1 + nutrient: + type: string + minLength: 1 + maxLength: 40 + amountPerUnit: + type: number + exclusiveMinimum: 0 + unit: + type: string + minLength: 1 + maxLength: 8 + enteredAmount: + anyOf: + - type: number + - type: "null" + enteredUnit: + anyOf: + - type: string + maxLength: 8 + - type: "null" + source: + default: MANUAL + type: string + enum: + - MANUAL + - LABEL_AI + createdAt: + type: string + minLength: 1 + required: + - nutrient + - amountPerUnit + - unit + - source + additionalProperties: {} doseChanges: default: [] type: array @@ -39092,6 +39136,7 @@ components: - schedules - sideEffects - pauseEras + - ingredients - doseChanges - inventoryItems - inventoryEvents diff --git a/src/lib/nutrients/__tests__/catalog.test.ts b/src/lib/nutrients/__tests__/catalog.test.ts index 37ba92b62..33709a6d0 100644 --- a/src/lib/nutrients/__tests__/catalog.test.ts +++ b/src/lib/nutrients/__tests__/catalog.test.ts @@ -309,6 +309,8 @@ describe("the batch contract stays the syncable codes (v1.43)", () => { }); expect(nutrientBatchSchema.safeParse(entry("dha")).success).toBe(false); expect(nutrientBatchSchema.safeParse(entry("epa")).success).toBe(false); - expect(nutrientBatchSchema.safeParse(entry("magnesium")).success).toBe(true); + expect(nutrientBatchSchema.safeParse(entry("magnesium")).success).toBe( + true, + ); }); });