28 lines
1.4 KiB
Python
28 lines
1.4 KiB
Python
|
|
"""Table decisions — suivi des décisions de réunion d'affaires."""
|
||
|
|
import uuid
|
||
|
|
from datetime import date, datetime, timezone
|
||
|
|
from sqlalchemy import String, Date, DateTime, Text, ForeignKey, Enum as SAEnum
|
||
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
||
|
|
from app.core.database import Base
|
||
|
|
|
||
|
|
|
||
|
|
class Decision(Base):
|
||
|
|
__tablename__ = "decisions"
|
||
|
|
|
||
|
|
id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)
|
||
|
|
groupe_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("groupes.id"), nullable=False)
|
||
|
|
reunion_id: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("reunions.id"))
|
||
|
|
sujet: Mapped[str] = mapped_column(String(255), nullable=False)
|
||
|
|
description: Mapped[str | None] = mapped_column(Text)
|
||
|
|
statut: Mapped[str] = mapped_column(
|
||
|
|
SAEnum("en_attente", "en_cours", "complete", name="statut_decision"),
|
||
|
|
default="en_attente",
|
||
|
|
)
|
||
|
|
responsable_id: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("membres.id"))
|
||
|
|
proposeur: Mapped[str | None] = mapped_column(String(100))
|
||
|
|
secondeur: Mapped[str | None] = mapped_column(String(100))
|
||
|
|
date_decision: Mapped[date] = mapped_column(Date, nullable=False)
|
||
|
|
date_completion: Mapped[date | None] = mapped_column(Date)
|
||
|
|
cree_par: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("membres.id"))
|
||
|
|
cree_le: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
|