Files
docs/standards/mcp/templates/app/domain/treatments/ports/service.py
Vishesh 'ironeagle' Bangotra 0cb35d10a6 Phase 7: serve the vet sample from the template tools and docs
- build.py: _TEMPLATE_COMPONENTS rewritten around the vet sample (53 kinds —
  per-resource slices, jobs, worked appointment_reminder family, tests);
  seed tokens dropped from the manifest ('sample: vet' instead)
- registry.py: get_app_component(kind) no longer renames item/example seeds;
  prompts and tool docs updated to 'copy a slice and adapt'
- templates/README.md, 01_build_recipe, 40_ui_admin, wiki/03 updated off the
  old seed scheme; repo inventory/config now exclude vet (docs move under
  standards; react/vet itself is deleted in a later phase)
- regenerated MCP bundle, vendored templates, and site output
2026-10-20 14:58:17 +05:30

35 lines
1.0 KiB
Python

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