Model/domain/modelling
Khalim Conn-Kowlessar 62a968119c feat(modelling): domain Scenario + ScenarioPostgresRepository (#1157)
Slice 1 of the #1157 build. The FE creates a Scenario and passes only
its id to the pipeline; the Modelling stage reads it back here.

- domain/modelling/scenario.py: thin `Scenario(id, goal, goal_value,
  budget, is_default)` — the slice the stage uses today (goal/budget for
  the Optimiser later; is_default drives plan.is_default). No phases
  (ADR-0005); legacy file-path/aggregate columns not modelled.
- infrastructure/postgres/scenario_table.py: `ScenarioRow` SQLModel
  mirror of the live `scenario` table (ADR-0017), declaring only the
  read columns; goal mapped as its string value.
- ScenarioPostgresRepository.get_many(scenario_ids) -> list[Scenario]:
  bulk read, input-order-preserving, raises on a missing id.

The method shape lives on the concrete repo for now; it is promoted to
an @abstractmethod on the port when the real orchestrator is wired and
the bare-stub instantiations retire (keeps the stubbed Modelling wiring
composing meanwhile). 2 tests, pyright strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 11:19:52 +00:00
..
__init__.py feat(modelling): Overlay Applicator folds EpcSimulation onto EpcPropertyData 2026-06-02 22:13:51 +00:00
contingencies.py feat(modelling): floor Recommendation Generator + ground-floor-area geometry 2026-06-03 09:12:29 +00:00
floor_recommendation.py feat(modelling): floor insulation-type overlay field + cascade pins (#1159) 2026-06-03 09:41:54 +00:00
overlay_applicator.py feat(modelling): Overlay Applicator folds EpcSimulation onto EpcPropertyData 2026-06-02 22:13:51 +00:00
package_scorer.py feat(modelling): Package Scorer — compose overlays + score on the calculator 2026-06-03 08:41:30 +00:00
product.py feat(modelling): ProductRepository + Postgres materials-table source 2026-06-03 08:32:38 +00:00
recommendation.py feat(modelling): wall Recommendation Generator — cavity-fill detection + overlay 2026-06-02 22:49:33 +00:00
roof_recommendation.py feat(modelling): loft overlay 270→300 mm + Elmhurst cascade pin (#1158) 2026-06-03 09:39:21 +00:00
scenario.py feat(modelling): domain Scenario + ScenarioPostgresRepository (#1157) 2026-06-03 11:19:52 +00:00
scoring.py feat(modelling): per-measure scoring — marginal cascade + per-Option signal (#1156) 2026-06-03 08:50:49 +00:00
simulation.py feat(modelling): floor insulation-type overlay field + cascade pins (#1159) 2026-06-03 09:41:54 +00:00
wall_recommendation.py feat(modelling): price the cavity Option from area x Product — closes #1155 2026-06-03 08:35:52 +00:00