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