"""# 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)