mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
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:
parent
1a0e87e593
commit
c4e1cc4229
1 changed files with 11 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue