feat: reconstruct top-level extract_fans_count from its persisted mirror 🟩

The deterministic calculator reads sap_ventilation.extract_fans_count (which
already round-trips); the top-level epc.extract_fans_count is its mirror (the
mapper sets both from one source). Reconstruct it from the same column so
EpcPropertyData round-trips complete, dropping the allow-list exception.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-06-26 18:54:43 +00:00
parent 1d236e3490
commit 6faa5171af
2 changed files with 6 additions and 4 deletions

View file

@ -582,6 +582,12 @@ class EpcPostgresRepository(EpcRepository):
else None
),
multiple_glazed_proportion=p.multiple_glazed_proportion,
# Top-level mirror of sap_ventilation.extract_fans_count (the mapper
# sets both from the same source). The deterministic calculator reads
# the sap_ventilation copy, not this one; reconstruct it from the same
# column anyway so EpcPropertyData round-trips complete, with no
# allow-list exception for a field that trivially mirrors a persisted one.
extract_fans_count=p.ventilation_extract_fans_count,
calculation_software_version=p.calculation_software_version,
mechanical_vent_duct_placement=p.mechanical_vent_duct_placement,
mechanical_vent_duct_insulation=p.mechanical_vent_duct_insulation,

View file

@ -35,10 +35,6 @@ from repositories.epc.epc_postgres_repository import EpcPostgresRepository
# ``ClassName.field`` (a single field) or ``ClassName`` (the whole dataclass is
# an un-persisted, tracked gap awaiting its FE columns / child table).
_UNPERSISTED_ALLOWLIST: dict[str, str] = {
# Redundant top-level field: the calculator reads
# `sap_ventilation.extract_fans_count` (which round-trips via
# `_to_ventilation`), never this top-level duplicate.
"EpcPropertyData.extract_fans_count": "redundant; scoring uses sap_ventilation.extract_fans_count",
# Not read by the calculator (dormant); no DB column yet.
"EpcPropertyData.air_tightness": "dormant — not read by the calculator; no FE column",
"EpcPropertyData.lzc_energy_sources": "dormant — not read by the calculator; no FE column",