Removed dev-dtos as a dep

This commit is contained in:
Franklin 2023-09-30 11:05:05 -04:00
parent 040bd2a4cc
commit 96f0ea15cf
6 changed files with 1256 additions and 96 deletions

1332
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -15,4 +15,3 @@ serde = { version = "1.0", features = ["derive"] }
chrono = { version = "0.4", features = [ "serde" ] }
err = { git = "https://git.franklinblanco.dev/franklinblanco/err.git" }
dev-dtos = { git = "https://git.franklinblanco.dev/franklinblanco/dev-dtos.git" }

View File

@ -1,7 +1,7 @@
use std::{fmt::Display, str::FromStr};
use serde::{Serialize, Deserialize};
use err::Error;
use err::{Error, trace};
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub enum LeaguePlayerStatus {
@ -49,7 +49,7 @@ impl FromStr for LeaguePlayerStatus {
"Left" => Ok(Self::Requested),
"Invited" => Ok(Self::Invited),
"Canceled" => Ok(Self::Canceled),
_ => Err(Error::Unspecified),
_ => Err(Error::new(trace!()).error_type(err::ErrorType::Unspecified)),
}
}
}

View File

@ -1,7 +1,7 @@
use std::{fmt::Display, str::FromStr};
use chrono::{Utc, DateTime};
use err::Error;
use err::{Error, trace};
use serde::{Serialize, Deserialize};
@ -89,7 +89,7 @@ impl FromStr for LeagueVisibility {
"Public" => Ok(LeagueVisibility::Public),
"Private" => Ok(LeagueVisibility::Private),
"Unlisted" => Ok(LeagueVisibility::Unlisted),
_ => Err(Error::Unspecified)
_ => Err(Error::new(trace!()).error_type(err::ErrorType::Unspecified)),
}
}
}

View File

@ -1,8 +1,7 @@
use chrono::NaiveDate;
use dev_dtos::{dtos::user::user_dtos::UserForCreationDto, domain::user::credential_type::CredentialType};
use serde::{Serialize, Deserialize};
use crate::{domain::player::Player, APP_NAME};
use crate::domain::player::Player;
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub struct PlayerForCreationDto {
@ -33,11 +32,11 @@ pub struct PlayerForUpdateDto {
pub auth_token: String,
}
impl PlayerForCreationDto {
/*impl PlayerForCreationDto {
pub fn convert_player_into_user_for_creation(player: &PlayerForCreationDto) -> UserForCreationDto{
UserForCreationDto { app: APP_NAME.to_owned(), credential: player.phone_number.clone(), credential_type: CredentialType::PhoneNumber, password: player.password.clone(), name: player.name.clone() }
}
}
}*/
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub struct PlayerProfileDto {

View File

@ -1,4 +1,2 @@
pub mod domain;
pub mod dto;
pub const APP_NAME: &str = "LEAGUE_APP";
pub mod dto;