2025-12-14 17:28:04 +03:00

38 lines
1.1 KiB
Python

"""
Интерфейс репозитория для Document
"""
from abc import ABC, abstractmethod
from uuid import UUID
from typing import Optional
from src.domain.entities.document import Document
class IDocumentRepository(ABC):
"""Интерфейс репозитория документов"""
@abstractmethod
async def create(self, document: Document) -> Document:
"""Создать документ"""
pass
@abstractmethod
async def get_by_id(self, document_id: UUID) -> Optional[Document]:
"""Получить документ по ID"""
pass
@abstractmethod
async def update(self, document: Document) -> Document:
"""Обновить документ"""
pass
@abstractmethod
async def delete(self, document_id: UUID) -> bool:
"""Удалить документ"""
pass
@abstractmethod
async def list_by_collection(self, collection_id: UUID, skip: int = 0, limit: int = 100) -> list[Document]:
"""Получить документы коллекции"""
pass