Pivot a Property's measure cost onto its scenario-sheet column 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-13 23:09:00 +00:00
parent 1a0e87e593
commit c4e1cc4229

View file

@ -108,4 +108,14 @@ def shape_scenario_sheet(
properties: Sequence[PropertyScenarioData],
) -> ExportSheet:
"""Shape one Scenario's Properties into a wide export sheet (ADR-0065)."""
raise NotImplementedError
columns: tuple[str, ...] = ("property_id", "landlord_property_id")
rows: list[dict[str, Any]] = []
for prop in properties:
row: dict[str, Any] = {
"property_id": prop.property_id,
"landlord_property_id": prop.landlord_property_id,
}
for measure in prop.measures:
row[measure.measure_type] = measure.estimated_cost
rows.append(row)
return ExportSheet(columns=columns, rows=tuple(rows))