TorbatYar/backend/services/delivery/app/queries/drivers.py
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

39 lines
1.2 KiB
Python

"""Driver query handlers — Phase 10.1."""
from __future__ import annotations
from uuid import UUID
from sqlalchemy.ext.asyncio import AsyncSession
from app.services.drivers import DriverService
from app.specifications.drivers import DriverListSpec
class DriverQueries:
def __init__(self, session: AsyncSession) -> None:
self.service = DriverService(session)
async def get(self, tenant_id: UUID, driver_id: UUID):
return await self.service.get(tenant_id, driver_id)
async def list(
self,
tenant_id: UUID,
*,
offset: int,
limit: int,
spec: DriverListSpec | None,
):
return await self.service.list(
tenant_id, offset=offset, limit=limit, spec=spec
)
async def lifecycle(self, tenant_id: UUID, driver_id: UUID, *, limit: int = 100):
return await self.service.list_lifecycle(tenant_id, driver_id, limit=limit)
async def credentials(self, tenant_id: UUID, driver_id: UUID):
return await self.service.list_credentials(tenant_id, driver_id)
async def documents(self, tenant_id: UUID, driver_id: UUID):
return await self.service.list_documents(tenant_id, driver_id)