101 lines
2.0 KiB
Python
101 lines
2.0 KiB
Python
from typing import Optional, List
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class User(BaseModel):
|
|
id: int
|
|
uu_id: str
|
|
user_tag: str
|
|
user_type: str
|
|
email: str
|
|
phone_number: str
|
|
related_company: str
|
|
is_confirmed: bool
|
|
active: bool
|
|
|
|
|
|
class Person(BaseModel):
|
|
id: int
|
|
uu_id: str
|
|
firstname: str
|
|
surname: str
|
|
middle_name: Optional[str] = ""
|
|
birthname: Optional[str] = ""
|
|
# national_identity_id: str
|
|
is_confirmed: bool
|
|
active: bool
|
|
user: Optional[User] = None
|
|
|
|
|
|
class OccupantType(BaseModel):
|
|
id: int
|
|
uu_id: str
|
|
occupant_code: str
|
|
occupant_type: str
|
|
is_confirmed: bool
|
|
active: bool
|
|
user_type_uu_id: Optional[str] = None
|
|
|
|
|
|
class BuildPart(BaseModel):
|
|
id: int
|
|
uu_id: str
|
|
part_no: str
|
|
part_level: str
|
|
part_code: str
|
|
part_gross_size: float
|
|
part_net_size: float
|
|
human_livable: bool
|
|
build_id: int
|
|
build_uu_id: str
|
|
is_confirmed: bool
|
|
active: bool
|
|
living_spaces: Optional[List['BuildLivingSpace']] = None
|
|
|
|
|
|
class BuildLivingSpace(BaseModel):
|
|
id: int
|
|
uu_id: str
|
|
expiry_starts: str
|
|
expiry_ends: str
|
|
fix_value: float
|
|
fix_percent: float
|
|
agreement_no: str
|
|
marketing_process: bool
|
|
build_parts_id: int
|
|
build_parts_uu_id: str
|
|
person_id: int
|
|
person_uu_id: str
|
|
occupant_type_id: int
|
|
occupant_type_uu_id: str
|
|
is_confirmed: bool
|
|
active: bool
|
|
person: Optional[Person] = None
|
|
occupant_type: Optional[OccupantType] = None
|
|
|
|
|
|
class BuildingCluster(BaseModel):
|
|
id: int
|
|
uu_id: str
|
|
build_name: str
|
|
build_no: str
|
|
build_date: str
|
|
decision_period_date: str
|
|
expiry_starts: str
|
|
expiry_ends: str
|
|
is_confirmed: bool
|
|
active: bool
|
|
build_parts: List['BuildPart'] = []
|
|
|
|
|
|
class BuildRequirements(BaseModel):
|
|
|
|
building_count: int
|
|
living_space: int
|
|
build_parts: int
|
|
|
|
|
|
# Update forward references for models with circular dependencies
|
|
BuildPart.update_forward_refs()
|
|
BuildingCluster.update_forward_refs()
|