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 ContractSummary(Base):
    __tablename__ = "contract_summary"
    __table_args__ = {"schema": "v3"}

    line_id: Mapped[int] = mapped_column(Integer, ForeignKey("v3.budget_line.id"), primary_key=True)
    total_amount: Mapped[float | None] = mapped_column(Numeric)
    counterparty: Mapped[str | None] = mapped_column(String)
    reference: Mapped[str | None] = mapped_column(String)
    deadline: Mapped[str | None] = mapped_column(String)
    comment: Mapped[str | None] = mapped_column(String)
    future_payments_y1: Mapped[float | None] = mapped_column(Numeric)
    future_payments_y2: Mapped[float | None] = mapped_column(Numeric)
    other_ssp_amount: Mapped[float | None] = mapped_column(Numeric)
    centralized_flag: Mapped[str | None] = mapped_column(String)

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