mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
docs(api): register the onboarding disclaimer endpoint in the contract
The one-time disclaimer acknowledgment route shipped without an OpenAPI entry, leaving a gap in the contract the iOS client consumes. Add the POST path and regenerate the spec.
This commit is contained in:
1 parent
ddbb25d5d4
commit
397423dddc
2 files changed
+115
No files matched your search
@@ -54,7 +54,59 @@ const tourUpdateResponse = z
|
||||
description: "The persisted completion flag and resume point after the write.",
|
||||
});
|
||||
|
||||
const disclaimerAckRequest = z
|
||||
.object({
|
||||
version: z
|
||||
.string()
|
||||
.min(1)
|
||||
.max(64)
|
||||
.describe(
|
||||
"The disclaimer copy version the client rendered. A freshness signal only — the server pins and persists its own canonical version.",
|
||||
),
|
||||
})
|
||||
.meta({
|
||||
id: "DisclaimerAckRequest",
|
||||
description: "Acknowledge the one-time medical disclaimer shown at onboarding.",
|
||||
});
|
||||
|
||||
const disclaimerAckResponse = z
|
||||
.object({
|
||||
acknowledgedVersion: z
|
||||
.string()
|
||||
.describe("The canonical disclaimer version the server stamped."),
|
||||
})
|
||||
.meta({
|
||||
id: "DisclaimerAckResponse",
|
||||
description: "The persisted disclaimer acknowledgment version.",
|
||||
});
|
||||
|
||||
export const onboardingPaths: NonNullable<ZodOpenApiObject["paths"]> = {
|
||||
"/api/onboarding/disclaimer": {
|
||||
post: {
|
||||
tags: ["Onboarding"],
|
||||
summary: "Acknowledge the one-time medical disclaimer",
|
||||
description:
|
||||
"Stamps the user's medical-disclaimer acknowledgment. Idempotent: a repeat acknowledgment of the same version refreshes the timestamp. The body version is a freshness signal so a stale shell cannot record copy it never rendered; the server persists its own canonical version.",
|
||||
requestBody: {
|
||||
required: true,
|
||||
content: { "application/json": { schema: disclaimerAckRequest } },
|
||||
},
|
||||
responses: {
|
||||
"200": {
|
||||
description: "Disclaimer acknowledged.",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: dataEnvelope(
|
||||
disclaimerAckResponse,
|
||||
"DisclaimerAckEnvelope",
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
...stdResponses,
|
||||
},
|
||||
},
|
||||
},
|
||||
"/api/onboarding/tour": {
|
||||
post: {
|
||||
tags: ["Onboarding"],
|
||||
|
||||
Reference in new issue
Block a user