mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
feat: persist floor heat-loss flags through the EPC round-trip 🟩
Add is_exposed_floor / is_above_partially_heated_space to EpcFloorDimensionModel and wire from_domain + _to_floor_dimension. Column names match the FE schema (feature/epc-pv-and-floor-heatloss-schema). Live DB migration is run post-merge (drizzle-kit generate picks them up). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c04692f9f5
commit
e5d94adc36
2 changed files with 9 additions and 0 deletions
|
|
@ -702,6 +702,11 @@ class EpcFloorDimensionModel(SQLModel, table=True):
|
|||
heat_loss_perimeter_m: float
|
||||
floor_insulation: Optional[int] = Field(default=None)
|
||||
floor_construction: Optional[int] = Field(default=None)
|
||||
# Heat-loss flags (SAP 10.2 §3.3): a floor over outside air / over a
|
||||
# partially-heated space takes a different U-value path. Default False
|
||||
# matches the domain default for an ordinary ground floor.
|
||||
is_exposed_floor: bool = Field(default=False)
|
||||
is_above_partially_heated_space: bool = Field(default=False)
|
||||
|
||||
@classmethod
|
||||
def from_domain(
|
||||
|
|
@ -716,6 +721,8 @@ class EpcFloorDimensionModel(SQLModel, table=True):
|
|||
heat_loss_perimeter_m=dim.heat_loss_perimeter_m,
|
||||
floor_insulation=dim.floor_insulation,
|
||||
floor_construction=dim.floor_construction,
|
||||
is_exposed_floor=dim.is_exposed_floor,
|
||||
is_above_partially_heated_space=dim.is_above_partially_heated_space,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -812,6 +812,8 @@ class EpcPostgresRepository(EpcRepository):
|
|||
floor=f.floor,
|
||||
floor_insulation=f.floor_insulation,
|
||||
floor_construction=f.floor_construction,
|
||||
is_exposed_floor=f.is_exposed_floor,
|
||||
is_above_partially_heated_space=f.is_above_partially_heated_space,
|
||||
)
|
||||
|
||||
@private
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue