use async_trait::async_trait; use paginator_utils::PaginatorResponse; use uuid::Uuid; use super::material::MaterialEntity; use imphnen_utils::AppError; #[async_trait] pub trait MaterialRepository: Send + Sync { async fn find_all_paginated( &self, page: u64, per_page: u64, category: Option, published_only: bool, ) -> Result, AppError>; async fn find_by_id(&self, id: Uuid) -> Result; async fn find_by_slug(&self, slug: &str) -> Result; async fn find_categories(&self) -> Result, AppError>; async fn create(&self, entity: MaterialEntity) -> Result; async fn update(&self, id: Uuid, entity: MaterialEntity) -> Result<(), AppError>; async fn delete(&self, id: Uuid) -> Result<(), AppError>; }