29 lines
895 B
Rust
29 lines
895 B
Rust
use derive_more::Display;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::forge::auth::application::port::out::db::errors::OutDBPortError;
|
|
use crate::forge::auth::application::port::out::forge::errors::OutForgePortError;
|
|
|
|
pub type RequestAuthorizationServiceResult<V> = Result<V, RequestAuthorizationServiceError>;
|
|
|
|
#[derive(Debug, Display, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
|
pub enum RequestAuthorizationServiceError {
|
|
InteralError,
|
|
}
|
|
|
|
impl From<OutDBPortError> for RequestAuthorizationServiceError {
|
|
fn from(v: OutDBPortError) -> Self {
|
|
match v {
|
|
OutDBPortError::DuplicateState => Self::InteralError,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl From<OutForgePortError> for RequestAuthorizationServiceError {
|
|
fn from(v: OutForgePortError) -> Self {
|
|
match v {
|
|
OutForgePortError::InteralError => Self::InteralError,
|
|
}
|
|
}
|
|
}
|