feat: Sprint 1 foundation - FastAPI scaffold, DB schema, auth, seed data, mock WhatsApp, Docker
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"""Unit model — an apartment at Pavilion East/West."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from sqlalchemy import String
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class Unit(Base):
|
||||
__tablename__ = "units"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
||||
property: Mapped[str] = mapped_column(String(10), nullable=False, comment="East or West")
|
||||
apartment_code: Mapped[str] = mapped_column(String(20), unique=True, nullable=False, index=True)
|
||||
building: Mapped[str | None] = mapped_column(String(100), nullable=True)
|
||||
floor: Mapped[int | None] = mapped_column(nullable=True)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<Unit {self.apartment_code}>"
|
||||
Reference in New Issue
Block a user