from sqlalchemy import Float, Integer, String, Text
from sqlalchemy.orm import Mapped, mapped_column

from app.core.database import Base


class SeasonalGoal(Base):
    __tablename__ = "ordini_seasonal_goals"

    id: Mapped[int] = mapped_column(primary_key=True, index=True)
    year: Mapped[int] = mapped_column(Integer, nullable=False, index=True)
    name: Mapped[str] = mapped_column(String(180), nullable=False)
    goal_type: Mapped[str] = mapped_column(String(40), nullable=False, index=True)
    description: Mapped[str | None] = mapped_column(Text, nullable=True)
    product_match: Mapped[str | None] = mapped_column(String(180), nullable=True)
    secondary_product_match: Mapped[str | None] = mapped_column(String(180), nullable=True)
    supplier_match: Mapped[str | None] = mapped_column(String(180), nullable=True)
    target: Mapped[float | None] = mapped_column(Float, nullable=True)
    secondary_target: Mapped[float | None] = mapped_column(Float, nullable=True)
    unit_label: Mapped[str | None] = mapped_column(String(40), nullable=True)
    bonus_label: Mapped[str | None] = mapped_column(String(160), nullable=True)
