from __future__ import annotations

from sqlalchemy import CheckConstraint, Date, ForeignKey, Integer, Numeric, String
from sqlalchemy.orm import Mapped, mapped_column, relationship

from src.db.base import Base


class Ckk(Base):
    __tablename__ = "ckk"
    __table_args__ = {"schema": "v3"}

    line_id: Mapped[int] = mapped_column(Integer, ForeignKey("v3.budget_line.id"), primary_key=True)
    ceiling_amount: Mapped[float | None] = mapped_column(Numeric)
    expenses_q1: Mapped[float | None] = mapped_column(Numeric)
    expenses_q2: Mapped[float | None] = mapped_column(Numeric)
    expenses_q3: Mapped[float | None] = mapped_column(Numeric)
    expenses_q4: Mapped[float | None] = mapped_column(Numeric)
    expenses_next_year_q1: Mapped[float | None] = mapped_column(Numeric)
    expenses_next_year_q2: Mapped[float | None] = mapped_column(Numeric)
    expenses_next_year_q3: Mapped[float | None] = mapped_column(Numeric)
    expenses_next_year_q4: Mapped[float | None] = mapped_column(Numeric)
    rf_schedule: Mapped[str | None] = mapped_column(String)
    delivery_deadline: Mapped[str | None] = mapped_column(String)
    procurement_plan: Mapped[str | None] = mapped_column(String)
    procurement_method: Mapped[str | None] = mapped_column(String)
    comment: Mapped[str | None] = mapped_column(String)

#     line = relationship("BudgetLine", uselist=False)
