From 55bfb0a439c56d6836817c1ad92c9506d256cfda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 11 Oct 2026 13:56:28 +0200 Subject: [PATCH] feat(sync): carry the automatic-recording marker on intake upserts --- docs/api/openapi.yaml | 4 ++++ src/app/api/sync/changes/route.ts | 4 ++++ src/lib/openapi/routes/sync.ts | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index 6fd507f91..b80bf1f11 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -44340,6 +44340,9 @@ components: type: boolean source: type: string + autoRecorded: + type: boolean + description: v1.42.2 — the server recorded this dose because the medication has `autoMarkTaken` on. Counts as taken. syncVersion: type: integer minimum: 0 @@ -44356,6 +44359,7 @@ components: - takenAt - skipped - source + - autoRecorded - syncVersion - updatedAt additionalProperties: false diff --git a/src/app/api/sync/changes/route.ts b/src/app/api/sync/changes/route.ts index 43c379a9d..28d268df6 100644 --- a/src/app/api/sync/changes/route.ts +++ b/src/app/api/sync/changes/route.ts @@ -163,6 +163,8 @@ interface IntakeUpsert { takenAt: string | null; skipped: boolean; source: string; + /** v1.42.2 — recorded by the server (`autoMarkTaken`), not the person. */ + autoRecorded: boolean; syncVersion: number; updatedAt: string; } @@ -389,6 +391,7 @@ export const GET = apiHandler(async (request: NextRequest) => { takenAt: true, skipped: true, source: true, + autoRecorded: true, syncVersion: true, deletedAt: true, updatedAt: true, @@ -543,6 +546,7 @@ export const GET = apiHandler(async (request: NextRequest) => { takenAt: row.takenAt?.toISOString() ?? null, skipped: row.skipped, source: row.source, + autoRecorded: row.autoRecorded, syncVersion: row.syncVersion, updatedAt: row.updatedAt.toISOString(), }); diff --git a/src/lib/openapi/routes/sync.ts b/src/lib/openapi/routes/sync.ts index e3eff84a5..ce59001c3 100644 --- a/src/lib/openapi/routes/sync.ts +++ b/src/lib/openapi/routes/sync.ts @@ -158,6 +158,11 @@ const syncIntakeUpsert = z takenAt: z.iso.datetime({ offset: true }).nullable(), skipped: z.boolean(), source: z.string(), + autoRecorded: z + .boolean() + .describe( + "v1.42.2 — the server recorded this dose because the medication has `autoMarkTaken` on. Counts as taken.", + ), syncVersion: z .number() .int()