mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Move the scenario and installed_measure tables into
infrastructure/postgres/modelling/ as full-parity SQLModel definitions
(ScenarioModel, InstalledMeasureModel + MeasureType), completing the cluster
consolidation. backend/app/db/models/recommendations.py is now a pure
re-export shim.
ScenarioModel.goal is the PortfolioGoal enum (legacy planning branches on it),
sourced from domain/modelling/portfolio_goal.py; the repo's to_domain maps it to
its value string, so domain Scenario.goal is now the value ("Increasing EPC")
consistent with the orchestrator's check — fixing the latent name-vs-value
inconsistency the old str column masked (the scenario repo test stored the enum
*name*). Parity columns are nullable (mirror convention; live NOT-NULLs owned by
Drizzle).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
1 KiB
Python
30 lines
1 KiB
Python
"""SQLModel definitions of the Modelling stage's live persistence tables
|
|
(ADR-0017 amendment).
|
|
|
|
One canonical SQLModel per physical table — `plan`, `recommendation`,
|
|
`recommendation_materials`, `scenario`, `installed_measure` — replacing the
|
|
legacy SQLAlchemy `Base` models in `backend/app/db/models/recommendations.py`
|
|
(now a re-export shim, the `epc_property` pattern). `recommendation` carries
|
|
`plan_id`; the `plan_recommendations` m2m is retired.
|
|
"""
|
|
|
|
from infrastructure.postgres.modelling.plan_table import PlanModel, PlanType
|
|
from infrastructure.postgres.modelling.recommendation_table import (
|
|
RecommendationMaterialModel,
|
|
RecommendationModel,
|
|
)
|
|
from infrastructure.postgres.modelling.scenario_table import ScenarioModel
|
|
from infrastructure.postgres.modelling.installed_measure_table import (
|
|
InstalledMeasureModel,
|
|
MeasureType,
|
|
)
|
|
|
|
__all__ = [
|
|
"PlanModel",
|
|
"PlanType",
|
|
"RecommendationModel",
|
|
"RecommendationMaterialModel",
|
|
"ScenarioModel",
|
|
"InstalledMeasureModel",
|
|
"MeasureType",
|
|
]
|