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
This commit is contained in:
2026-10-20 14:58:17 +05:30
parent 56aa1322fb
commit 0cb35d10a6
107 changed files with 3292 additions and 937 deletions

View File

@@ -0,0 +1,3 @@
"""# Summary
Parents domain slice."""

View File

@@ -0,0 +1,39 @@
"""# Summary
Parents domain — pet owners referenced by :class:`domain.pets.models.Pet`.
"""
from pydantic import BaseModel
class Metadata(BaseModel):
"""Optional presentation metadata carried alongside a resource.
Attributes:
createdOn (str | None): ISO creation timestamp. Defaults to None.
updatedOn (str | None): ISO update timestamp. Defaults to None.
"""
createdOn: str | None = None
updatedOn: str | None = None
model_config = {"extra": "ignore"}
class Parent(BaseModel):
"""A pet owner.
Attributes:
id (int | None): Server-assigned identifier. Defaults to None.
name (str): Parent's full name.
email (str): Email address.
phone (str | None): Contact phone number. Defaults to None.
metadata (Metadata | None): Presentation metadata. Defaults to None.
"""
id: int | None = None
name: str
email: str
phone: str | None = None
metadata: Metadata | None = None
model_config = {"extra": "ignore"}

View File

@@ -0,0 +1,3 @@
"""# Summary
Parents domain ports."""

View File

@@ -0,0 +1,27 @@
"""# Summary
Parents persistence ports — integer-id document and repository factory.
"""
from mongo_ops import BaseDocument
from pydantic import Field
from config import settings
from domain.parents.models import Parent
from infra.db.repos import create_repo
class ParentDocument(Parent, BaseDocument):
"""Persisted parent document. The integer ``id`` shadows the ObjectId."""
id: int | None = Field(default=None, validation_alias="_id")
def create_parent_repo():
"""Create the parent repository selected by ``settings.repo_backend``.
Returns:
IntIdMemoryRepository | IntIdMongoRepository: Repository wired to the
``parents`` collection/store.
"""
_ = settings # backend chosen centrally by create_repo
return create_repo("parents", ParentDocument)

View File

@@ -0,0 +1,33 @@
"""# Summary
CRUD service wiring for the parent aggregate via the hexa container.
"""
from hexa import build
from domain.parents.models import Parent
from domain.parents.ports.db import ParentDocument
from infra.adapters.service import CrudsServiceAdaptor
class ParentCrudsService(CrudsServiceAdaptor[Parent, ParentDocument]):
"""Parent CRUD service resolving :class:`ParentDocument` from a repo.
Notes:
Instances are created by :func:`get_parent_service`. The ``model`` and
``schema`` class attributes bind the domain model and its document type.
"""
model = Parent
schema = ParentDocument
def get_parent_service(repo) -> ParentCrudsService:
"""Build a parent CRUD service wired to ``repo``.
Args:
repo (Any): Integer-id parent repository from :func:`create_parent_repo`.
Returns:
ParentCrudsService: Ready-to-use parent CRUD service.
"""
return build(ParentCrudsService, instances={"repo": repo})