feat(schema): bump report to v2 + observation findings + drop pathology
ObservationSchema now carries a hierarchical Finding (zoneId + path + labelFrSnapshot + labelEnSnapshot + requiresVetReferral?) plus a renamed freeTextFindings list, replacing the flat pathologyIds / freeTextPathologies pair. Snapshot labels keep already-exported reports readable if the catalog is later edited. ReportSchema.version bumped from 1 → 2. PDF import surfaces a distinct, French-language error message on legacy v1 attachments instead of the generic "not an osteo PDF" line, via a new IncompatibleReportVersionError detected before the strict Zod parse runs. Store seed and tests updated for the new shape. The standalone Pathology Zod schema and its test are removed — the new findings tree is the single source of truth for what an observation can carry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f80e161d61
commit
d08d773d74
13 files changed
+146
-108
No files matched your search
@@ -16,10 +16,10 @@ beforeEach(() => {
|
||||
})
|
||||
|
||||
describe('reportStore.initReport', () => {
|
||||
it('sets a report with version=1, id, and createdAt', () => {
|
||||
it('sets a report with version=2, id, and createdAt', () => {
|
||||
useReportStore.getState().initReport(draft)
|
||||
const r = useReportStore.getState().report!
|
||||
expect(r.version).toBe(1)
|
||||
expect(r.version).toBe(2)
|
||||
expect(r.id.length).toBeGreaterThan(0)
|
||||
expect(r.createdAt).toMatch(/^\d{4}-\d{2}-\d{2}T/)
|
||||
expect(r.practitioner.name).toBe('Dr. Dupont')
|
||||
|
||||
Reference in new issue
Block a user