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
35
validation-suite/backend/mercury/app/models/equipment.py
Normal file
35
validation-suite/backend/mercury/app/models/equipment.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
from datetime import date
|
||||
|
||||
from sqlalchemy import Date, Enum, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.db.base import Base, TimestampMixin, UUIDMixin
|
||||
|
||||
|
||||
class EquipmentKind(str, enum.Enum):
|
||||
temperature_logger = "temperature_logger"
|
||||
pressure_logger = "pressure_logger"
|
||||
sensor = "sensor"
|
||||
|
||||
|
||||
class EquipmentStatus(str, enum.Enum):
|
||||
green = "green"
|
||||
yellow = "yellow"
|
||||
red = "red"
|
||||
|
||||
|
||||
class Equipment(Base, UUIDMixin, TimestampMixin):
|
||||
__tablename__ = "equipment"
|
||||
|
||||
kind: Mapped[EquipmentKind] = mapped_column(Enum(EquipmentKind))
|
||||
manufacturer: Mapped[str | None] = mapped_column(String(140))
|
||||
model: Mapped[str | None] = mapped_column(String(140))
|
||||
serial_number: Mapped[str] = mapped_column(String(140), unique=True, index=True)
|
||||
calibrated_on: Mapped[date | None] = mapped_column(Date)
|
||||
calibration_due_on: Mapped[date | None] = mapped_column(Date)
|
||||
certificate_document_id: Mapped[str | None] = mapped_column(String(80))
|
||||
status: Mapped[EquipmentStatus] = mapped_column(Enum(EquipmentStatus), default=EquipmentStatus.green)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue