import { AnatomicalSheetDocumentSchema, buildSheetIndex, ReportMigrationMapSchema, type AnatomicalSheetDocument, type ReportMigrationMap, type SheetIndex, type SheetRef, } from '@faunosteo/domain' /** * The reference sheet as the archive check tool reads it: the frozen TypeScript domain * (Zod schemas and index), as the application did before R2. The tool moves to the Rust * core with the PDF reader at R4 (RUST_ARCHITECTURE_REVIEW VI.4); until then it keeps its * own reading, independent of the application's core runtime. */ export interface CompareSheet { status: 'draft' | 'published' ref: SheetRef document: AnatomicalSheetDocument assets: Readonly> migrationMap: ReportMigrationMap } export type CompareSheetIndex = SheetIndex /** The seed files of the reference sheet, parsed and indexed. */ export function compareSheetIndex(seed: { ref: { sheet_id: string; version_id: string | null; document_sha256: string } document: unknown migrationMap: unknown }): CompareSheetIndex { return buildSheetIndex({ status: 'draft', ref: { sheetId: seed.ref.sheet_id, versionId: seed.ref.version_id, documentSha256: seed.ref.document_sha256, }, document: AnatomicalSheetDocumentSchema.parse(seed.document), assets: {}, migrationMap: ReportMigrationMapSchema.parse(seed.migrationMap), }) }