fix(rectification): resolve missing birth timezone offsets
Independent Staging Quality Gate / validate (push) Successful in 12m36s
Independent Staging Quality Gate / publish (push) Successful in 9m33s

This commit is contained in:
Jesse_Chen
2026-08-15 21:01:00 +08:00
parent 5b023e9480
commit 47a22319fd
3 changed files with 85 additions and 1 deletions
@@ -8,6 +8,7 @@
*/
import { createHash } from "node:crypto";
import type { SupabaseClient } from "@supabase/supabase-js";
import { resolveMissingBirthTimezoneOffset } from "../../birth-profile-timezone.ts";
import { normalizePersistedBirthDate } from "../../birth-time-intake-model.ts";
import {
resolveActiveSkillPackage,
@@ -180,7 +181,13 @@ export async function loadV9RectificationProfile(
.single();
if (error || !data) throw new RectificationCaseServiceError("profile_unavailable");
const row = data as Record<string, unknown>;
let resolvedData: unknown;
try {
resolvedData = await resolveMissingBirthTimezoneOffset(data);
} catch {
throw new RectificationCaseServiceError("profile_unavailable");
}
const row = resolvedData as Record<string, unknown>;
const birthDate = normalizePersistedBirthDate(row.birth_date);
const latitude = numberOrNull(row.latitude);
const longitude = numberOrNull(row.longitude);