from __future__ import annotations

from sqlalchemy import ForeignKey, Index, Integer, UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column, relationship

from src.db.base import Base


class RfProjectReportLine(Base):
    __tablename__ = "rf_project_report_line"
    __table_args__ = (
        UniqueConstraint(
            "rf_project_report_id", "expense_item_id", name="uq_v3_rf_project_report_line"
        ),
        Index("ix_v3_rf_project_report_line_rep", "rf_project_report_id"),
        {"schema": "v3"},
    )

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    rf_project_report_id: Mapped[int] = mapped_column(Integer, ForeignKey("v3.rf_project_report.id"))
    expense_item_id: Mapped[int] = mapped_column(Integer, ForeignKey("v3.expense_item.id"))

#     report: Mapped[RfProjectReport] = relationship("RfProjectReport", back_populates="lines")
#     expense_item: Mapped[ExpenseItem] = relationship("ExpenseItem")
#     quarters: Mapped[list[RfProjectReportQuarter]] = relationship(
#         "RfProjectReportQuarter", back_populates="line"
#     )
