mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
AuditRow carries opening and trickle_vent fields, all None on every row 🟩
This commit is contained in:
parent
f010a360c5
commit
70035e6e14
1 changed files with 15 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ from datatypes.magicplan.domain.models import Plan
|
|||
from backend.app.db.connection import db_read_session
|
||||
from backend.app.db.functions.magic_plan_functions import get_plan_by_uploaded_file_id
|
||||
|
||||
UPLOADED_FILE_ID: int = 123
|
||||
UPLOADED_FILE_ID: int = 7843
|
||||
|
||||
_HEADER_FILL = PatternFill("solid", fgColor="D9D9D9")
|
||||
_FLOOR_FILL = PatternFill("solid", fgColor="BDD7EE")
|
||||
|
|
@ -32,6 +32,15 @@ class AuditRow:
|
|||
window_opening_type: Optional[str] = None
|
||||
door_location: Optional[str] = None
|
||||
door_width_mm: Optional[float] = None
|
||||
opening_count: Optional[int] = None
|
||||
opening_width_m: Optional[float] = None
|
||||
opening_height_m: Optional[float] = None
|
||||
opening_total_area_m2: Optional[float] = None
|
||||
trickle_vent_blocked: Optional[bool] = None
|
||||
trickle_vent_pictured: Optional[bool] = None
|
||||
trickle_vent_effective_area: Optional[float] = None
|
||||
trickle_vent_count: Optional[int] = None
|
||||
trickle_vent_total_effective_area: Optional[float] = None
|
||||
|
||||
|
||||
def _build_rows(plan: Plan) -> list[AuditRow]:
|
||||
|
|
@ -128,8 +137,10 @@ def _write_data_rows(ws: Worksheet, rows: list[AuditRow]) -> None:
|
|||
cell.font = _BOLD
|
||||
cell.fill = _FLOOR_FILL
|
||||
ws.merge_cells(
|
||||
start_row=xl_row, start_column=1,
|
||||
end_row=xl_row, end_column=_TOTAL_COLS,
|
||||
start_row=xl_row,
|
||||
start_column=1,
|
||||
end_row=xl_row,
|
||||
end_column=_TOTAL_COLS,
|
||||
)
|
||||
else:
|
||||
ws.cell(row=xl_row, column=1, value=row.room_name)
|
||||
|
|
@ -177,7 +188,7 @@ def main() -> None:
|
|||
_write_headers(ws)
|
||||
_write_data_rows(ws, rows)
|
||||
|
||||
output_path = f"/tmp/magic_plan_audit_{UPLOADED_FILE_ID}.xlsx"
|
||||
output_path = f"./magic_plan_audit_{UPLOADED_FILE_ID}.xlsx"
|
||||
wb.save(output_path)
|
||||
print(output_path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue