"""Post repository interface.""" from abc import abstractmethod from app.domain.entities.post import Post from app.domain.repositories.base import Repository class PostRepository(Repository[Post]): """Repository interface for Blog Posts.""" @abstractmethod async def get_by_slug(self, slug: str) -> Post | None: """Get post by slug.""" ... @abstractmethod async def get_by_author(self, author_id: str) -> list[Post]: """Get all posts by author.""" ... @abstractmethod async def get_published(self) -> list[Post]: """Get all published posts.""" ... @abstractmethod async def get_by_tag(self, tag: str) -> list[Post]: """Get posts by tag.""" ... @abstractmethod async def slug_exists(self, slug: str) -> bool: """Check if slug already exists.""" ... @abstractmethod async def search(self, query: str) -> list[Post]: """Search posts by query string.""" ...