"""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, limit: int | None = None, offset: int | None = None, ) -> list[Post]: """Get all posts by author.""" ... @abstractmethod async def get_published( self, limit: int | None = None, offset: int | None = None, ) -> list[Post]: """Get all published posts.""" ... @abstractmethod async def get_by_tag( self, tag: str, limit: int | None = None, offset: int | None = None, ) -> 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, limit: int | None = None, offset: int | None = None, ) -> list[Post]: """Search posts by query string.""" ...