Model/domain/modelling
Khalim Conn-Kowlessar 9ef97be958 refactor(modelling): type measure_type fields as MeasureType
Tighten the recommendation/plan vocabulary off generic str:
MeasureOption.measure_type and PlanMeasure.measure_type are now MeasureType
(also _GlazingTarget.measure_type, MeasureDependency.triggers ->
frozenset[MeasureType], and the optimiser's chosen/required-type locals).
Because MeasureType is a StrEnum the change is transparent to persistence
(the `recommendation` varchar column), the optimiser group-by key, and every
`== "solar_pv"`-style comparison — so pyright now enforces the enum at every
construction site with no runtime behaviour change.

The catalogue boundary stays str: ProductRepository.get(measure_type: str)
and Product.measure_type are unchanged (they map arbitrary DB/JSON rows), so
the fake product repos in tests need no edit. Test construction helpers coerce
their str arg via MeasureType(...); direct constructions use members.

Suite green: tests/domain/modelling + orchestration + harness 253 pass + 3
xfail; pyright clean on production + tests (pre-existing moto + property-
override-rowcount baselines untouched).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 20:13:31 +00:00
..
generators refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
optimisation refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
scoring feat(modelling): SolarOverlay + _fold_solar (sixth overlay surface) 2026-06-08 10:10:15 +00:00
__init__.py feat(modelling): Overlay Applicator folds EpcSimulation onto EpcPropertyData 2026-06-02 22:13:51 +00:00
ashp_rates.json refactor(modelling): load ASHP rates from a committed costs file 2026-06-06 23:19:53 +00:00
contingencies.py feat(modelling): Products.solar_bundle_cost + committed solar rate sheet 2026-06-08 12:10:27 +00:00
measure_type.py feat(modelling): MeasureType StrEnum as the canonical measure vocabulary 2026-06-08 19:54:04 +00:00
plan.py refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
portfolio_goal.py refactor(modelling): move PortfolioGoal to domain/modelling/ 2026-06-03 22:44:48 +00:00
product.py feat(modelling): persist recommendation.material_id from the catalogue 2026-06-04 08:26:58 +00:00
products.py feat(modelling): Products.solar_bundle_cost + committed solar rate sheet 2026-06-08 12:10:27 +00:00
recommendation.py refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
scenario.py feat(modelling): domain Scenario + ScenarioPostgresRepository (#1157) 2026-06-03 11:19:52 +00:00
simulation.py feat(modelling): SolarOverlay + _fold_solar (sixth overlay surface) 2026-06-08 10:10:15 +00:00
solar_potential.py feat(modelling): typed SolarPotential projection over Google buildingInsights 2026-06-08 09:55:55 +00:00
solar_rates.json feat(modelling): Products.solar_bundle_cost + committed solar rate sheet 2026-06-08 12:10:27 +00:00
valuation.py feat(modelling): ValuationUplift domain class (percentage-primary) 2026-06-04 08:33:19 +00:00