Model/infrastructure/postgres
Khalim Conn-Kowlessar c1c7b06f09 refactor(modelling): consolidate plan/recommendation models into infrastructure
Move the live plan, recommendation, recommendation_materials and (retiring)
plan_recommendations tables into a new infrastructure/postgres/modelling/
subpackage as single SQLModel definitions (the epc_property pattern), absorbing
the rebuild's partial PlanRow/RecommendationRow mirrors and carrying full
legacy column parity plus recommendation.plan_id. Out-of-cluster references are
plain indexed ints (mirror convention); the live FKs are owned by the Drizzle
schema. backend/app/db/models/recommendations.py becomes a re-export shim
(ScenarioModel/InstalledMeasure stay for a later slice).

Fix the export conftest to create SQLModel-first (so Base funding_package's FK
to the now-SQLModel plan resolves) and skip the redundant drop_all on its
function-scoped throwaway DB (the epc enum type is now shared across both
metadatas). Resolves the pre-existing dual-definition collision: the rebuild
and legacy export suites are now co-runnable. No behaviour change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 21:00:14 +00:00
..
modelling refactor(modelling): consolidate plan/recommendation models into infrastructure 2026-06-03 21:00:14 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
config.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
engine.py tests wrong environemnt 2026-05-29 16:17:06 +00:00
epc_property_table.py feat(epc): persist renewable_heat_incentive — full round-trip equality (#1137) 2026-06-01 16:28:48 +00:00
landlord_built_form_type_override_table.py pr review, move domain and orhcestration 2026-06-01 14:00:31 +00:00
landlord_override_enums.py landlord overrid orchestration 2026-05-26 15:27:45 +00:00
landlord_property_type_override_table.py pr review, move domain and orhcestration 2026-06-01 14:00:31 +00:00
landlord_roof_type_override_table.py pr review, move domain and orhcestration 2026-06-01 14:00:31 +00:00
landlord_wall_type_override_table.py pr review, move domain and orhcestration 2026-06-01 14:00:31 +00:00
product_table.py feat(modelling): ProductRepository + Postgres materials-table source 2026-06-03 08:32:38 +00:00
property_baseline_performance_table.py refactor(billing): relocate Bill Derivation to domain/billing/ (cross-stage) 2026-06-03 17:19:23 +00:00
property_table.py refactor(property): PropertyRow.id non-Optional (PR #1139 review) 2026-06-01 16:28:48 +00:00
scenario_table.py feat(modelling): domain Scenario + ScenarioPostgresRepository (#1157) 2026-06-03 11:19:52 +00:00
solar_table.py feat(ingestion): relocate EpcClientService to infrastructure + SolarRepo (#1133) 2026-06-01 16:28:48 +00:00
subtask_table.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
task_table.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00