Files
imphnen-backend-service/imphnen-dimentorin/src/mentors/domain/repository.rs
T

33 lines
793 B
Rust
Raw Normal View History

use super::mentor::MentorEntity;
use async_trait::async_trait;
use imphnen_utils::AppError;
use paginator_rs::PaginationParams;
use paginator_utils::PaginatorResponse;
use uuid::Uuid;
#[async_trait]
pub trait MentorRepository: Send + Sync {
async fn find_all(
&self,
params: PaginationParams,
) -> Result<PaginatorResponse<MentorEntity>, AppError>;
async fn find_by_id(
&self,
id: Uuid,
include_deleted: bool,
) -> Result<MentorEntity, AppError>;
async fn find_by_user_id(
&self,
user_id: Uuid,
include_deleted: bool,
) -> Result<MentorEntity, AppError>;
async fn create(&self, entity: MentorEntity) -> Result<Uuid, AppError>;
async fn update(&self, entity: MentorEntity) -> Result<(), AppError>;
async fn soft_delete(&self, id: Uuid) -> Result<(), AppError>;
}