groupe-meditation/backend/app/models/poste.py

21 lines
991 B
Python
Raw Normal View History

2026-03-04 14:01:00 -05:00
"""Table postes."""
import uuid
from sqlalchemy import String, Text, Integer, Boolean, Interval, Enum as SAEnum, ForeignKey
2026-03-04 14:01:00 -05:00
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base
class Poste(Base):
__tablename__ = "postes"
id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)
groupe_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("groupes.id"), nullable=False)
2026-03-04 14:01:00 -05:00
nom: Mapped[str] = mapped_column(String(100), nullable=False)
categorie: Mapped[str] = mapped_column(SAEnum("executif", "service", "physique", name="categorie_poste"), nullable=False)
description: Mapped[str | None] = mapped_column(Text)
duree_recommandee: Mapped[str | None] = mapped_column(Interval)
prerequis: Mapped[str | None] = mapped_column(Text)
2026-04-17 04:04:04 -04:00
informations: Mapped[str | None] = mapped_column(Text)
2026-03-04 14:01:00 -05:00
ordre_affichage: Mapped[int | None] = mapped_column(Integer)
2026-04-17 04:04:04 -04:00
actif: Mapped[bool] = mapped_column(Boolean, default=True)