From 050f983152f05a3eb979c1816996d08bde512bd1 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 5 Jun 2026 13:53:22 +0000 Subject: [PATCH] =?UTF-8?q?Extract=20door=20height=20from=20API=20response?= =?UTF-8?q?=20into=20height=5Fmm=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/magicplan/domain/mapper.py | 2 +- infrastructure/postgres/magic_plan_tables.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/datatypes/magicplan/domain/mapper.py b/datatypes/magicplan/domain/mapper.py index f674db6f..e5d3c9d1 100644 --- a/datatypes/magicplan/domain/mapper.py +++ b/datatypes/magicplan/domain/mapper.py @@ -110,7 +110,7 @@ def _map_window_ventilation( def _map_door(wi: api.WallItem) -> Door: return Door( width_mm=round(wi.size.x * 1000, 0), - height_mm=0.0, + height_mm=round(wi.size.z * 1000, 0), ventilation=_map_door_ventilation(wi.custom_displayable_fields), ) diff --git a/infrastructure/postgres/magic_plan_tables.py b/infrastructure/postgres/magic_plan_tables.py index abd06e1c..6623f6b1 100644 --- a/infrastructure/postgres/magic_plan_tables.py +++ b/infrastructure/postgres/magic_plan_tables.py @@ -96,11 +96,12 @@ class MagicPlanDoorModel(SQLModel, table=True): id: Optional[int] = Field(default=None, primary_key=True) magic_plan_room_id: int = Field(foreign_key="magic_plan_room.id") width_mm: Optional[float] = None + height_mm: Optional[float] = None type: Optional[str] = None @classmethod def from_domain(cls, door: Door, room_id: int) -> "MagicPlanDoorModel": - return cls(magic_plan_room_id=room_id, width_mm=door.width_mm) + return cls(magic_plan_room_id=room_id, width_mm=door.width_mm, height_mm=door.height_mm) class MagicPlanWindowVentilationModel(SQLModel, table=True):