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):