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::*;
|
use super::errors::*;
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait DeleteUserUseCase {
|
pub trait DeleteUserUseCase: Send + Sync {
|
||||||
async fn delete_user(
|
async fn delete_user(
|
||||||
&self,
|
&self,
|
||||||
cmd: command::DeleteUserCommand,
|
cmd: command::DeleteUserCommand,
|
||||||
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type DeleteUserServiceObj = std::sync::Arc<dyn DeleteUserUseCase>;
|
||||||
|
|
|
@ -9,10 +9,12 @@ pub mod service;
|
||||||
use super::errors::*;
|
use super::errors::*;
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait LoginUseCase {
|
pub trait LoginUseCase: Send + Sync {
|
||||||
async fn login(
|
async fn login(
|
||||||
&self,
|
&self,
|
||||||
cmd: command::LoginCommand,
|
cmd: command::LoginCommand,
|
||||||
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
||||||
) -> events::LoginEvent;
|
) -> events::LoginEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type LoginServiceObj = std::sync::Arc<dyn LoginUseCase>;
|
||||||
|
|
|
@ -8,7 +8,9 @@ pub mod service;
|
||||||
use super::errors::*;
|
use super::errors::*;
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait MarkUserVerifiedUseCase {
|
pub trait MarkUserVerifiedUseCase: Send + Sync {
|
||||||
async fn mark_user_verified(&self, cmd: command::MarkUserVerifiedCommand)
|
async fn mark_user_verified(&self, cmd: command::MarkUserVerifiedCommand)
|
||||||
-> IdentityResult<()>;
|
-> IdentityResult<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type MarkUserVerifiedServiceObj = std::sync::Arc<dyn MarkUserVerifiedUseCase>;
|
||||||
|
|
|
@ -15,3 +15,5 @@ pub trait RegisterUserUseCase: Send + Sync {
|
||||||
cmd: command::RegisterUserCommand,
|
cmd: command::RegisterUserCommand,
|
||||||
) -> IdentityResult<events::UserRegisteredEvent>;
|
) -> IdentityResult<events::UserRegisteredEvent>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type RegisterUserServiceObj = std::sync::Arc<dyn RegisterUserUseCase>;
|
||||||
|
|
|
@ -14,3 +14,5 @@ pub trait ResendVerificationEmailUseCase: Send + Sync {
|
||||||
cmd: command::ResendVerificationEmailCommand,
|
cmd: command::ResendVerificationEmailCommand,
|
||||||
) -> IdentityResult<()>;
|
) -> IdentityResult<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type ResendVerificationEmailServiceObj = std::sync::Arc<dyn ResendVerificationEmailUseCase>;
|
||||||
|
|
|
@ -9,10 +9,12 @@ pub mod service;
|
||||||
use super::errors::*;
|
use super::errors::*;
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait UpdatePasswordUseCase {
|
pub trait UpdatePasswordUseCase: Send + Sync {
|
||||||
async fn update_password(
|
async fn update_password(
|
||||||
&self,
|
&self,
|
||||||
cmd: command::UpdatePasswordCommand,
|
cmd: command::UpdatePasswordCommand,
|
||||||
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
//) -> errors::ProcessAuthorizationServiceResult<String>;
|
||||||
) -> events::PasswordUpdatedEvent;
|
) -> events::PasswordUpdatedEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type UpdatePasswordServiceObj = std::sync::Arc<dyn UpdatePasswordUseCase>;
|
||||||
|
|
Loading…
Reference in a new issue