Some checks are pending
CI / backend-lint-and-test (push) Waiting to run
- FastAPI with async SQLAlchemy models for IFC elements - IFC file upload and parsing via IfcOpenShell - REST API for projects, elements, and properties - Vue.js 3 frontend shell with Three.js dependency - Docker Compose for full-stack local development - PostgreSQL 16 as database - CI pipeline for Forgejo Actions - Project documentation and API overview
41 lines
695 B
Python
41 lines
695 B
Python
"""Pydantic response schemas for API serialization."""
|
|
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class PropertyOut(BaseModel):
|
|
id: UUID
|
|
pset_name: str
|
|
name: str
|
|
value: str
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ElementOut(BaseModel):
|
|
id: UUID
|
|
global_id: str
|
|
ifc_type: str
|
|
name: str
|
|
description: str
|
|
storey: str
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ElementDetailOut(ElementOut):
|
|
properties: list[PropertyOut] = []
|
|
|
|
|
|
class ProjectOut(BaseModel):
|
|
id: UUID
|
|
name: str
|
|
filename: str
|
|
description: str
|
|
ifc_schema: str
|
|
element_count: int = 0
|
|
|
|
model_config = {"from_attributes": True}
|
|
|