19 lines
845 B
Python
19 lines
845 B
Python
"""Table config_repartition — % de répartition des contributions."""
|
|
import uuid
|
|
from datetime import date
|
|
from sqlalchemy import Date, ForeignKey, Numeric, Enum as SAEnum
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from app.core.database import Base
|
|
|
|
|
|
class ConfigRepartition(Base):
|
|
__tablename__ = "config_repartition"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)
|
|
groupe_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("groupes.id"), nullable=False)
|
|
destination: Mapped[str] = mapped_column(
|
|
SAEnum("district", "region", "bsg", "intergroupe", name="destination_repartition", create_constraint=False),
|
|
nullable=False,
|
|
)
|
|
pourcentage: Mapped[float] = mapped_column(Numeric(5, 2), nullable=False)
|
|
actif_depuis: Mapped[date] = mapped_column(Date, nullable=False)
|