mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-22 08:48:34 +00:00
The DB schema, value enums, and migrations already defined all nine landlord override categories, but the application layer was hardwired to the original four (property_type, built_form_type, wall_type, roof_type). The other five (main_fuel, glazing, construction_age_band, water_heating, main_heating_system) were classified and written to their tables by the backend, but the frontend never read them or offered edit dropdowns — so the verify panel rendered them as "not classified", and any Unknown in those categories slipped past the ADR-0006 finalise gate. Replace the per-category switch statements (duplicated across ~6 sites) with a single CATEGORY_TABLES registry (categories.ts) as the source of truth. Adding a category is now one registry row. A completeness test asserts the registry, CLASSIFIER_FIELDS, and the property_overrides override_component enum never drift apart — the exact hole that left five categories unwired. - categories.ts: registry + derived CATEGORY_VALUES + isLandlordCategory guard - landlordOverrides/server.ts: getLandlordOverrides reads all 9 (fixes the latent crash where the page mapped 9 fields against a 4-key result) - bulkUpload/server.ts: lookupOverrides / unknownForField / getUnknownOverrides / upsertUserOverride / validation now registry-driven, all 9 - OnboardingProgress.tsx: edit dropdowns use the shared 9-category CATEGORY_VALUES - landlord-overrides page: SourceBadge now renders os_places (ADR-0007) distinctly instead of mislabelling it "classifier" Enum value sets are already in sync FE<->Model (verified); only member order drifts on 3 enums, which is cosmetic and left untouched (Postgres cannot reorder enums). Follow-up (backend): Model's override_source SAEnum still lacks os_places. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bulkUpload | ||
| landlordOverrides | ||
| postcodeSearch | ||
| scenarios | ||
| services | ||
| chartUtils.ts | ||
| session.ts | ||
| utils.ts | ||