23 lines
601 B
Rust
23 lines
601 B
Rust
use async_trait::async_trait;
|
|||
|
|
use imphnen_utils::errors::AppError;
|
||
|
|
use uuid::Uuid;
|
||
|
|
|
||
|
|
use super::entity::{UpdateUserInput, UserEntity};
|
||
|
|
|
||
|
|
#[async_trait]
|
||
|
|
pub trait QrUserService: Send + Sync {
|
||
|
|
async fn get_profile(&self, user_id: Uuid) -> Result<UserEntity, AppError>;
|
||
|
|
async fn update_profile(
|
||
|
|
&self,
|
||
|
|
user_id: Uuid,
|
||
|
|
input: UpdateUserInput,
|
||
|
|
) -> Result<UserEntity, AppError>;
|
||
|
|
async fn list_all(&self) -> Result<Vec<UserEntity>, AppError>;
|
||
|
|
async fn update_role(
|
||
|
|
&self,
|
||
|
|
id: Uuid,
|
||
|
|
role: String,
|
||
|
|
) -> Result<UserEntity, AppError>;
|
||
|
|
async fn delete(&self, id: Uuid) -> Result<(), AppError>;
|
||
|
|
}
|