"""# Summary Pets persistence ports — integer-id document and repository factory. """ from mongo_ops import BaseDocument from pydantic import Field from domain.pets.models import Pet from infra.db.repos import create_repo class PetDocument(Pet, BaseDocument): """Persisted pet document. The integer ``id`` shadows the ObjectId.""" id: int | None = Field(default=None, validation_alias="_id") def create_pet_repo(): """Create the pet repository selected by ``settings.repo_backend``. Returns: IntIdMemoryRepository | IntIdMongoRepository: Repository wired to the ``pets`` collection/store. """ return create_repo("pets", PetDocument)