
from sqlalchemy.ext.asyncio import AsyncSession

from src.db.models.rf_project_report_line import RfProjectReportLine
from src.repository.rf_project_report_line_repository import RfProjectReportLineRepository
from src.db.models.app_user import AppUser




class RfProjectReportLineService:
    def __init__(self, db: AsyncSession):
        self.db = db
        self.prl_repo = RfProjectReportLineRepository(db)

    async def get(
            self, 
            user: AppUser, 
            line_id: int,
    ) -> RfProjectReportLine | None:
        return await self.prl_repo.get(line_id=line_id)

    async def get_list(
            self, 
            user: AppUser, 
            line_ids: list[int],
    ) -> list[RfProjectReportLine]:
        return await self.prl_repo.get_list(line_ids=line_ids)

    async def get_ids(
            self,
            project_report_id: int,
    ) -> list[int]:
        return await self.prl_repo.get_ids(project_report_id=project_report_id)
