Model/domain/property_baseline/property_baseline_performance.py
Khalim Conn-Kowlessar c3691d9af2 refactor(property-baseline): rename baseline → property_baseline aggregate (PR #1139 review)
Wholesale rename of the Baseline aggregate to PropertyBaseline for clarity /
to disambiguate from baselines that appear elsewhere in Modelling. Scoped to
this aggregate only — the distinct Rebaselining term (rebaseline_reason,
StubRebaseliner, RebaselineNotImplemented) is deliberately untouched.

- domain/baseline → domain/property_baseline; BaselinePerformance →
  PropertyBaselinePerformance.
- repositories/baseline → repositories/property_baseline; BaselineRepository
  / BaselinePostgresRepository → PropertyBaseline*.
- orchestration/baseline_orchestrator.py → property_baseline_orchestrator.py;
  BaselineOrchestrator → PropertyBaselineOrchestrator. BaselineStage →
  PropertyBaselineStage.
- infrastructure/postgres: baseline_performance_table.py →
  property_baseline_performance_table.py; table `baseline_performance` →
  `property_baseline_performance`; Model renamed.
- UnitOfWork attribute `.baseline` → `.property_baseline`.
- Docs: ADR-0004 references + migration doc (renamed to
  property-baseline-performance-table.md) updated.

CONTEXT.md glossary term ("Baseline Performance") left as-is pending a
ubiquitous-language call (raised on the PR). 123 tests pass; pyright strict
clean (only the unrelated pre-existing moto import errors remain).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 14:54:59 +00:00

28 lines
1 KiB
Python

from __future__ import annotations
from dataclasses import dataclass
from domain.property_baseline.performance import Performance
from domain.property_baseline.rebaseliner import RebaselineReason
@dataclass(frozen=True)
class PropertyBaselinePerformance:
"""A Property's current performance aggregate (CONTEXT.md, ADR-0004).
Holds both halves — ``lodged`` (what the gov register says) and
``effective`` (what the modelling pipeline scored against) — plus the
``rebaseline_reason`` recording *why* they differ (``"none"`` when equal).
Both halves are always populated, even when equal.
Carries the part of the energy block that needs no derivation: annual
``space_heating_kwh`` / ``water_heating_kwh`` read off the EPC's RHI.
Fuel split and bills (the rest of EPC Energy Derivation) land in a
follow-up once a Fuel Rates source exists.
"""
lodged: Performance
effective: Performance
rebaseline_reason: RebaselineReason
space_heating_kwh: float
water_heating_kwh: float