feat: identity: define type aliases for services
This commit is contained in:
parent
cef61fe229
commit
51894cfcb7
6 changed files with 16 additions and 4 deletions
|
@ -9,10 +9,12 @@ pub mod service;
|
|||
use super::errors::*;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait DeleteUserUseCase {
|
||||
pub trait DeleteUserUseCase: Send + Sync {
|
||||
async fn delete_user(
|
||||
&self,
|
||||
cmd: command::DeleteUserCommand,
|
||||
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
||||
);
|
||||
}
|
||||
|
||||
pub type DeleteUserServiceObj = std::sync::Arc<dyn DeleteUserUseCase>;
|
||||
|
|
|
@ -9,10 +9,12 @@ pub mod service;
|
|||
use super::errors::*;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait LoginUseCase {
|
||||
pub trait LoginUseCase: Send + Sync {
|
||||
async fn login(
|
||||
&self,
|
||||
cmd: command::LoginCommand,
|
||||
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
||||
) -> events::LoginEvent;
|
||||
}
|
||||
|
||||
pub type LoginServiceObj = std::sync::Arc<dyn LoginUseCase>;
|
||||
|
|
|
@ -8,7 +8,9 @@ pub mod service;
|
|||
use super::errors::*;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait MarkUserVerifiedUseCase {
|
||||
pub trait MarkUserVerifiedUseCase: Send + Sync {
|
||||
async fn mark_user_verified(&self, cmd: command::MarkUserVerifiedCommand)
|
||||
-> IdentityResult<()>;
|
||||
}
|
||||
|
||||
pub type MarkUserVerifiedServiceObj = std::sync::Arc<dyn MarkUserVerifiedUseCase>;
|
||||
|
|
|
@ -15,3 +15,5 @@ pub trait RegisterUserUseCase: Send + Sync {
|
|||
cmd: command::RegisterUserCommand,
|
||||
) -> IdentityResult<events::UserRegisteredEvent>;
|
||||
}
|
||||
|
||||
pub type RegisterUserServiceObj = std::sync::Arc<dyn RegisterUserUseCase>;
|
||||
|
|
|
@ -14,3 +14,5 @@ pub trait ResendVerificationEmailUseCase: Send + Sync {
|
|||
cmd: command::ResendVerificationEmailCommand,
|
||||
) -> IdentityResult<()>;
|
||||
}
|
||||
|
||||
pub type ResendVerificationEmailServiceObj = std::sync::Arc<dyn ResendVerificationEmailUseCase>;
|
||||
|
|
|
@ -9,10 +9,12 @@ pub mod service;
|
|||
use super::errors::*;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait UpdatePasswordUseCase {
|
||||
pub trait UpdatePasswordUseCase: Send + Sync {
|
||||
async fn update_password(
|
||||
&self,
|
||||
cmd: command::UpdatePasswordCommand,
|
||||
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
||||
) -> events::PasswordUpdatedEvent;
|
||||
}
|
||||
|
||||
pub type UpdatePasswordServiceObj = std::sync::Arc<dyn UpdatePasswordUseCase>;
|
||||
|
|
Loading…
Reference in a new issue