"""Шаблоны документов авиационной отрасли.""" from sqlalchemy import String, Text, Integer, Boolean from sqlalchemy.orm import Mapped, mapped_column from app.db.base import Base from app.models.common import TimestampMixin, uuid4_str class DocumentTemplate(Base, TimestampMixin): __tablename__ = "document_templates" id: Mapped[str] = mapped_column(String(36), primary_key=True, default=uuid4_str) code: Mapped[str] = mapped_column(String(32), unique=True, nullable=False, index=True) name: Mapped[str] = mapped_column(String(255), nullable=False) category: Mapped[str] = mapped_column( String(64), nullable=False, doc="checklist|letter|application|certificate|report|act|order|form" ) standard: Mapped[str] = mapped_column( String(32), nullable=False, doc="RF|ICAO|EASA|FAA|INTERNAL" ) description: Mapped[str | None] = mapped_column(Text, nullable=True) html_content: Mapped[str] = mapped_column(Text, nullable=False) version: Mapped[int] = mapped_column(Integer, default=1, nullable=False) is_active: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False) sort_order: Mapped[int] = mapped_column(Integer, default=0, nullable=False)