fix(rectification): resolve missing birth timezone offsets
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user