from datetime import datetime
from sqlalchemy import String, Integer, Boolean, DateTime
from sqlalchemy.orm import Mapped, mapped_column
from app.database import Base


class WorkerConfig(Base):
    __tablename__ = "worker_configs"

    queue_name: Mapped[str] = mapped_column(String(100), primary_key=True)
    max_concurrency: Mapped[int] = mapped_column(Integer, nullable=False, default=8)
    min_concurrency: Mapped[int] = mapped_column(Integer, nullable=False, default=2)
    enabled: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
    updated_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow)
