From baa0252cad39d809adc68dfb7e0e6363085a6fb5 Mon Sep 17 00:00:00 2001 From: Franklin Date: Thu, 13 Oct 2022 08:43:33 -0400 Subject: [PATCH] added left status --- src/domain/enums/league_player_status.rs | 5 ++++- src/domain/league.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/domain/enums/league_player_status.rs b/src/domain/enums/league_player_status.rs index 2854cfc..b93b5f9 100644 --- a/src/domain/enums/league_player_status.rs +++ b/src/domain/enums/league_player_status.rs @@ -9,7 +9,8 @@ pub enum LeaguePlayerStatus { Joined, #[default] Requested, - Kicked + Kicked, + Left } impl Display for LeaguePlayerStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -18,6 +19,7 @@ impl Display for LeaguePlayerStatus { LeaguePlayerStatus::Joined => write!(f, "Joined"), LeaguePlayerStatus::Requested => write!(f, "Requested"), LeaguePlayerStatus::Kicked => write!(f, "Kicked"), + LeaguePlayerStatus::Left => write!(f, "Left") } } } @@ -30,6 +32,7 @@ impl FromStr for LeaguePlayerStatus { "Joined" => Ok(Self::Joined), "Requested" => Ok(Self::Requested), "Kicked" => Ok(Self::Kicked), + "Left" => Ok(Self::Requested), _ => Err(Error::Unspecified) //TODO: Create ParseStr error in actix_web_utils } } diff --git a/src/domain/league.rs b/src/domain/league.rs index 263b961..7df1260 100644 --- a/src/domain/league.rs +++ b/src/domain/league.rs @@ -21,7 +21,7 @@ pub struct League { pub state: String, pub visibility: String, /// When is the league happening? - pub date_and_time: DateTime, //TODO: Switch from DateTime to TimeZones + pub date_and_time: DateTime, /// This will be stored as a Decimal in the database but the actual input from the user /// will not be in rust_decimal::Decimal type. pub cost_to_join: Decimal,