"""Repository contract; the service depends on this interface, not MongoClient."""
from typing import Protocol
from bson import ObjectId
from .models import Document, CreateResult, ReadResult, UpdateResult, DeleteResult

class AnimalRepository(Protocol):
    """Inputs are validated by AnimalService. Implementations own their resources."""
    def create(self, data: Document) -> CreateResult: ...
    def read(self, filters: Document, limit: int) -> ReadResult: ...
    def update(self, record_id: ObjectId, changes: Document) -> UpdateResult: ...
    def delete(self, record_id: ObjectId) -> DeleteResult: ...
    def close(self) -> None: ...
