-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
P1High priorityHigh priorityinsuranceInsurance module relatedInsurance module relatedtech-debtTechnical debt or cleanupTechnical debt or cleanup
Description
Problem
The AddPolicyModal's PolicyCategory type and the Zod insuranceCategoryEnum in types/insurance.ts define completely different category value sets. This causes filter mismatches and potential data inconsistency.
AddPolicyModal (PolicyCategory)
life | health | critical_illness | long_term_care | personal_accident
Zod Schema (insuranceCategoryEnum)
life | critical_illness | hospitalization | disability | accident | custom
Mismatches
| Concept | Modal saves | Zod expects |
|---|---|---|
| Health/Hospital | health |
hospitalization |
| Disability/LTC | long_term_care |
disability |
| Personal Accident | personal_accident |
accident |
| Custom | (not offered) | custom |
Impact
- Coverage column filter in PoliciesTab was sending Zod enum values (
hospitalization,accident) to the backend, but the DB contains modal values (health,personal_accident) — filter returned no results long_term_careis defined as a subcategory ofdisabilityin the Zod schema, but stored as a top-level category by the modal- JourneyTab uses yet another set of category keys (
lifeTpd,criticalIllness,earlyCi,disability,personalAccident)
Fix needed
- Decide on a single canonical set of category values
- Align
AddPolicyModal'sPolicyCategorytype withinsuranceCategoryEnum - Write a DB migration if existing data needs to be remapped
- Update
insuranceSubcategoriesmapping accordingly - Ensure JourneyTab's category keys map correctly to the canonical values
Files involved
frontend/src/types/insurance.ts— Zod enum + subcategory mapfrontend/src/components/insurance/modals/AddPolicyModal.tsx—PolicyCategorytypefrontend/src/components/insurance/tabs/PoliciesTab.tsx—COVERAGE_CATEGORIESfilterfrontend/src/components/insurance/tabs/JourneyTab.tsx—IndividualCategorytype- Backend handler/repository for any migration
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High priorityHigh priorityinsuranceInsurance module relatedInsurance module relatedtech-debtTechnical debt or cleanupTechnical debt or cleanup