✅ ClaimFlow-specific README
✅ Bun-based monorepo
✅ Docker Postgres setup
✅ Prisma schema for documents, extraction_runs, extraction_events
✅ Prisma client exported from packages/db/index.ts
✅ Shared Zod schemas exist
✅ Shared schema index exports both schema files
✅ .env is ignored
✅ sample-data folder exists
✅ field-matrix exists
✅ synthetic sample data started
✅ expected extraction/validation examples started

DB Design for Day 1

image.png

Verify that tables have been created

docker compose up -d

docker ps

docker exec -it <CONTAINER_ID> sh

psql -U postgres -d cliamflow_ai

\dt

image.png

1. Pick real sample documents
2. Inspect what fields actually appear
3. Decide extraction schema
4. Decide validation rules
5. Then write Zod + Prisma

Initial Sample

sample-multimodal-claims-processing-recommendation-system/sample-claims/sample-claim-docs-1 at main · aws-samples/sample-multimodal-claims-processing-recommendation-system

Schema

image.png

If Gemini Extracts this :

{
  "documentType": "auto_insurance_claim_form",
  "claimNumber": null,
  "policyNumber": "POL-88921",
  "insuredName": "Amit Sharma",
  "claimantName": "Amit Sharma",
  "contactEmail": "[email protected]",
  "contactPhone": "9876543210",
  "vehicle": {
    "registrationNumber": "DL01AB1234",
    "make": "Hyundai",
    "model": "i20",
    "year": "2021",
    "engineNumber": null,
    "chassisNumber": null
  },
  "incident": {
    "incidentDate": "2026-04-18",
    "incidentTime": "18:30",
    "incidentLocation": "Delhi",
    "lossType": "own_damage",
    "description": "Front bumper and left headlight damaged in a collision."
  },
  "damage": {
    "damagedParts": ["front bumper", "left headlight"],
    "damageSeverity": "moderate",
    "estimatedRepairCost": 42000,
    "currency": "INR"
  },
  "police": {
    "wasReportedToPolice": false,
    "policeStation": null,
    "firNumber": null,
    "reportDate": null
  },
  "supportingDocuments": {
    "claimForm": true,
    "damagePhoto": false,
    "repairEstimate": true,
    "policeReport": false
  },
  "missingEvidence": ["damage photo"],
  "overallConfidence": 0.84
}

this passes ClaimExtractionSchema.

Then your validation checks it.

Because this is own_damage, police report may not be required.

But damage photo is missing.

Validation Output

{
  "isValid": false,
  "missingFields": [],
  "conflicts": [],
  "warnings": [
    {
      "field": "supportingDocuments.damagePhoto",
      "message": "Damage photo is missing.",
      "severity": "warning",
      "ruleId": "DAMAGE_PHOTO_RECOMMENDED"
    }
  ],
  "requiredEvidence": ["damagePhoto"],
  "finalStatus": "NEEDS_REVIEW"
}

What validation rules should come from the data?