"""# Summary CRUD service wiring for the vet aggregate via the hexa container. """ from hexa import build from domain.vets.models import Vet from domain.vets.ports.db import VetDocument from infra.adapters.service import CrudsServiceAdaptor class VetCrudsService(CrudsServiceAdaptor[Vet, VetDocument]): """Vet CRUD service resolving :class:`VetDocument` from a repo. Notes: Instances are created by :func:`get_vet_service`. The ``model`` and ``schema`` class attributes bind the domain model and its document type. """ model = Vet schema = VetDocument def get_vet_service(repo) -> VetCrudsService: """Build a vet CRUD service wired to ``repo``. Args: repo (Any): Integer-id vet repository from :func:`create_vet_repo`. Returns: VetCrudsService: Ready-to-use vet CRUD service. """ return build(VetCrudsService, instances={"repo": repo})