feat(validation): complete validation editor and master data modules
This commit is contained in:
parent
2b5c765e41
commit
f73a24df13
73 changed files with 10194 additions and 0 deletions
21
validation-suite/backend/mercury/app/models/location.py
Normal file
21
validation-suite/backend/mercury/app/models/location.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from sqlalchemy import ForeignKey, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.db.base import Base, TimestampMixin, UUIDMixin
|
||||
|
||||
|
||||
class Location(Base, UUIDMixin, TimestampMixin):
|
||||
__tablename__ = "locations"
|
||||
|
||||
customer_id: Mapped[str] = mapped_column(ForeignKey("customers.id", ondelete="CASCADE"), index=True)
|
||||
name: Mapped[str] = mapped_column(String(160))
|
||||
street: Mapped[str | None] = mapped_column(String(220))
|
||||
postal_code: Mapped[str | None] = mapped_column(String(20))
|
||||
city: Mapped[str | None] = mapped_column(String(120))
|
||||
room: Mapped[str | None] = mapped_column(String(120))
|
||||
|
||||
customer: Mapped["Customer"] = relationship(back_populates="locations")
|
||||
devices: Mapped[list["Device"]] = relationship(back_populates="location")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue