Carry Property identity and Effective-EPC fields onto the export row 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-13 23:15:40 +00:00
parent 6fc94b1cc4
commit 9c1e79efc6

View file

@ -49,8 +49,30 @@ _BATTERY_MEASURE_COLUMNS: tuple[str, ...] = ("solar_pv_with_battery",)
# battery variant.
_ALL_MEASURE_COLUMNS: tuple[str, ...] = MEASURE_COLUMNS + _BATTERY_MEASURE_COLUMNS
# Property identity columns, leading every sheet before the measure columns.
_ID_COLUMNS: tuple[str, ...] = ("property_id", "landlord_property_id")
# Property identity and Effective-EPC descriptive columns, leading every sheet
# before the measure columns. The descriptive fields are already override-resolved
# by the repository (property_overrides → lodged EPC → predicted, ADR-0065).
_ID_COLUMNS: tuple[str, ...] = (
"property_id",
"landlord_property_id",
"uprn",
"address",
"postcode",
"property_type",
"walls",
"roof",
"floor",
"windows",
"heating",
"hot_water",
"lighting",
"total_floor_area",
"number_of_rooms",
"lodgement_date",
"is_expired",
"current_epc_rating",
"current_sap_points",
)
# Per-Property roll-ups of the selected measures' attributed impact, trailing the
# measure columns (ADR-0065).
@ -173,7 +195,24 @@ def shape_scenario_sheet(
for prop in properties:
row: dict[str, Any] = {
"property_id": prop.property_id,
"landlord_property_id": prop.landlord_property_id,
"landlord_property_id": _blank(prop.landlord_property_id),
"uprn": _blank(prop.uprn),
"address": _blank(prop.address),
"postcode": _blank(prop.postcode),
"property_type": _blank(prop.property_type),
"walls": _blank(prop.walls),
"roof": _blank(prop.roof),
"floor": _blank(prop.floor),
"windows": _blank(prop.windows),
"heating": _blank(prop.heating),
"hot_water": _blank(prop.hot_water),
"lighting": _blank(prop.lighting),
"total_floor_area": _blank(prop.total_floor_area),
"number_of_rooms": _blank(prop.number_of_rooms),
"lodgement_date": _blank(prop.lodgement_date),
"is_expired": _blank(prop.is_expired),
"current_epc_rating": _blank(prop.current_epc_rating),
"current_sap_points": _blank(prop.current_sap_points),
}
# Every measure column is present, blank unless this Property has it, so
# all scenario sheets share one contract (ADR-0065).