Model/tests/repositories/epc
Khalim Conn-Kowlessar 77f90e144e review: store epc_building_part.wall_insulation_thickness as JSONB
PR feedback (dancafc): the SQLModel column was Optional[str], but the
domain `SapBuildingPart.wall_insulation_thickness` is Optional[Union[str,
int]] — `_api_resolve_wall_insulation_thickness` returns an int mm when the
API lodges `wall_insulation_thickness == "measured"` (SAP 10.2 §5.7 /
Table 8). The plain str column round-trips that int back as the string
"100", corrupting the Table 8 insulated-wall U-value lookup.

This column was missed in the round-trip-fidelity §1 JSONB sweep
(#1129) — its `Union[str, int]` sibling `roof_insulation_thickness` was
converted, but `wall_insulation_thickness` was not, and no 21.0.0/21.0.1
fixture lodges "measured" so the gap stayed latent. Convert to JSONB
(matching `roof_insulation_thickness` / `flat_roof_insulation_thickness`),
align the column type to Optional[Union[str, int]] (also removes a pyright
type-mismatch), record it in the migration doc §1, and add a round-trip
guard test asserting an int survives as an int (fails as '100' == 100 on
the old str column).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 10:07:24 +00:00
..
__init__.py feat(epc): EPC persistence round-trip fidelity + JSONB code columns (Slice 1 #1129) 2026-05-30 19:26:18 +00:00
test_epc_bulk_read.py perf(repos): bulk get_many / get_for_properties — batch reads, not N round-trips (#1138) 2026-05-31 10:33:24 +00:00
test_epc_idempotent_save.py feat(repos): idempotent EPC + Baseline writes (replace by property_id) (#1138) 2026-05-31 09:41:39 +00:00
test_epc_round_trip.py review: store epc_building_part.wall_insulation_thickness as JSONB 2026-06-05 10:07:24 +00:00