mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
feat(sync): carry the automatic-recording marker on intake upserts
This commit is contained in:
1 parent
e93b4f249f
commit
55bfb0a439
3 files changed
+13
No files matched your search
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user