"""Settlement query handlers — Phase 10.8."""
from __future__ import annotations

from uuid import UUID

from sqlalchemy.ext.asyncio import AsyncSession

from app.services.settlement import SettlementService
from app.specifications.settlement import SettlementIntentListSpec


class SettlementQueries:
    def __init__(self, session: AsyncSession) -> None:
        self.service = SettlementService(session)

    async def get(self, tenant_id: UUID, intent_id: UUID):
        return await self.service.get(tenant_id, intent_id)

    async def list(
        self,
        tenant_id: UUID,
        *,
        offset: int,
        limit: int,
        spec: SettlementIntentListSpec | None,
    ):
        return await self.service.list(
            tenant_id, offset=offset, limit=limit, spec=spec
        )

    async def lines(self, tenant_id: UUID, intent_id: UUID):
        return await self.service.list_lines(tenant_id, intent_id)
