test(anamnesis): drive the life circumstances, AUDIT-C and its backup through real Postgres and the manage matrix

This commit is contained in:
Marc-André Bombeck committed 2026-10-16 01:34:17 +02:00
1 parent 88aa5ccacd
commit 4d2c8c2bbb
8 files changed
+718 -16

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@ import {
correctLifeFact,
removeHealthProfileFact,
} from "@/lib/profile/health-facts";
import { dayStartUtc } from "@/lib/profile/life-derived";
import { dateOnlyAtNoonUtc } from "@/lib/tz/date-only";
import {
validateCorrectedFactValue,
type HealthProfileFactKind,
@@ -63,7 +63,7 @@ export const PATCH = apiHandler(
// circumstances (v1.43, #614).
const now = new Date();
const validFrom = parsed.data.validFrom
? dayStartUtc(parsed.data.validFrom)
? dateOnlyAtNoonUtc(parsed.data.validFrom)
: undefined;
let corrected: { id: string; kind: string } | null;
if (isLifeFactKind(current.kind)) {
+2 -2
View File
@@ -17,7 +17,7 @@ import {
createLifeFact,
readHealthProfileFacts,
} from "@/lib/profile/health-facts";
import { dayStartUtc } from "@/lib/profile/life-derived";
import { dateOnlyAtNoonUtc } from "@/lib/tz/date-only";
import { factWriteSchema } from "@/lib/validations/life-circumstances";
/**
@@ -51,7 +51,7 @@ async function postFact(request: NextRequest): Promise<Response> {
const now = new Date();
const validFrom = parsed.data.validFrom
? dayStartUtc(parsed.data.validFrom)
? dateOnlyAtNoonUtc(parsed.data.validFrom)
: undefined;
try {
const input = parsed.data;