import { readFileSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** Written once by `global-setup.ts` after seeding, read by every spec that * needs the seeded workspace/child/parent ids or the deterministic * multi-week band it created — see that file for how each value is * derived. */ export const FIXTURE_PATH = path.join(__dirname, '../.auth/fixture.json') export interface SeedFixture { workspaceId: string childId: string personalDataUuid: string childBirthDate: string band: { /** ISO date of the band's true first day. */ startDate: string /** ISO date of the band's true last day. */ endDate: string parentPersonalDataUuid: string dayType: 'sjukpenning' | 'lagsta' | 'vacation' } } export function loadSeedFixture(): SeedFixture { const raw = readFileSync(FIXTURE_PATH, 'utf-8') return JSON.parse(raw) as SeedFixture }