Model/datatypes
Jun-te Kim ae81a81e79 Drop lodged building parts that carry no construction age band
2 modelling_e2e properties (LODGED, e.g. uprn 100061733327 cert
3235-4627-4400-0610-7292 / uprn 100020397707 cert 8081-7022-7669-5038-0996)
failed with NotNullViolation on epc_building_part.construction_age_band.

The certs lodge a leading building part with floor geometry but no construction
descriptors — {floor_area, room_height, double_glazed, glazed_perimeter}, no age
band / identifier / wall / roof. A glazed-perimeter conservatory-shell / lodging
artifact. It maps to construction_age_band=None → violates the NOT-NULL column,
and the engine reads parts[0].construction_age_band as the primary era (so the
junk part also poisoned the calc's primary age band).

Fix: from_api_response drops building parts with no construction_age_band, but
only when banded parts remain (a fully band-less cert is left untouched). The
real Main + Extension parts survive and parts[0] becomes the real Main Dwelling.

Verified both certs now map with only their banded parts. Regression test +
mapper-corpus / accuracy gates green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 11:30:23 +00:00
..
epc Drop lodged building parts that carry no construction age band 2026-06-24 11:30:23 +00:00
__init__.py further breaking up code 2023-07-20 12:24:34 +01:00
datatypes.py further breaking up code 2023-07-20 12:24:34 +01:00
enums.py completed build of new demo portfolio - some fixed required still 2023-11-20 14:42:16 +00:00