Model/backend/app/db/models
Khalim Conn-Kowlessar 559616d3bb feat(epc): EPC persistence round-trip fidelity + JSONB code columns (Slice 1 #1129)
Relocate EpcPropertyModel + child tables from the dying backend/ tree to
infrastructure/postgres/epc_property_table.py (re-export shim keeps
documents_parser working). Add EpcRepository port + EpcPostgresRepository with
a full reverse mapper (epc_property tables -> EpcPropertyData).

Round-trip test surfaced two fidelity gaps:
 1. Union[int,str] SAP code fields were str()-coerced on save, losing the int
    (API) vs str (Site Notes) distinction. Now stored as JSONB (type-preserving).
 2. The schema was a partial projection. Closed the cheap gaps on the model
    (heating shower/bath counts, roof_construction_type, curtain_wall_age,
    addendum, mechanical_vent_duct_insulation_level, SAP 10.2 §2 ventilation
    fields + a ventilation_present flag). Structural gaps tracked as follow-ups;
    renewable_heat_incentive (P0, #1137) excluded from the assertion until landed.

Round-trip passes for RdSAP-Schema-21.0.0 and 21.0.1; pyright strict clean.
Migration inventory for the DB: docs/migrations/epc-property-round-trip-fidelity.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 16:28:48 +00:00
..
tests typing and renaming 🟪 2026-05-07 13:26:49 +00:00
addresses.py working on integration test 2026-02-23 12:13:59 +00:00
bulk_address_uploads.py added backend funciton to functions 2026-04-22 14:21:39 +00:00
condition.py working on integration test 2026-02-23 12:13:59 +00:00
energy_assessments.py removed create_type from enum (only created if it doesn't exist) 2026-02-26 18:21:37 +00:00
epc.py working on integration test 2026-02-23 12:13:59 +00:00
epc_property.py feat(epc): EPC persistence round-trip fidelity + JSONB code columns (Slice 1 #1129) 2026-06-01 16:28:48 +00:00
funding.py working on integration test 2026-02-23 12:13:59 +00:00
hubspot_deal_data.py booking status 2026-06-01 16:28:47 +00:00
hubspot_project_data.py hubspot projects data is scraped 2026-06-01 16:28:47 +00:00
hubspot_user.py Adding use model for storage of users 2026-04-30 18:53:15 +00:00
inspections.py working on integration test 2026-02-23 12:13:59 +00:00
magic_plan.py Store uploaded_file_id on magic_plan_plan row 🟥 2026-05-13 10:50:28 +00:00
materials.py working on integration test 2026-02-23 12:13:59 +00:00
non_intrusive_surveys.py working on integration test 2026-02-23 12:13:59 +00:00
organisation.py move HubspotDealData object to dedicated file 2026-04-09 10:46:52 +00:00
portfolio.py address fields are not optional 2026-04-24 10:22:41 +00:00
postcode_search.py lambda code works locally 2026-03-06 12:51:08 +00:00
recommendations.py define new domain object 2026-04-13 16:18:17 +00:00
solar.py working on integration test 2026-02-23 12:13:59 +00:00
tasks.py task and sub tasks imrpvoed 2026-05-12 16:24:11 +00:00
uploaded_file.py Coordination Hub fallback stores correct file_source in DB 🟥 2026-05-19 11:07:41 +00:00
users.py working on integration test 2026-02-23 12:13:59 +00:00
whlg.py working on integration test 2026-02-23 12:13:59 +00:00