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