Ship fleet, availability, pricing, dispatch, routing, tracking, and settlement on delivery-service 0.10.8.0 with migrations and phase tests green. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
967 B
Python
33 lines
967 B
Python
"""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)
|