diff --git a/src/model/user.rs b/src/model/user.rs index 5b3c08c..4e1af76 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -2,6 +2,7 @@ use std::ops::{Deref, DerefMut}; use argon2::{password_hash::SaltString, Argon2, PasswordHasher}; use chrono::{Datelike, Local, NaiveDate}; +use chrono_tz::Etc::UTC; use log::info; use rocket::{ async_trait, @@ -22,6 +23,8 @@ const FAMILY_TWO: i32 = 30000; const FAMILY_THREE_OR_MORE: i32 = 35000; const STUDENT_OR_PUPIL: i32 = 8000; const REGULAR: i32 = 22000; +const UNTERSTUETZEND: i32 = 2500; +const FOERDERND: i32 = 8500; #[derive(FromRow, Debug, Serialize, Deserialize)] pub struct User { @@ -181,7 +184,11 @@ impl User { ); } - if Family::find_by_opt_id(db, self.family_id).await.is_none() { + if self.has_role(db, "Unterstützend").await { + fee.add("Unterstützendes Mitglied".into(), UNTERSTUETZEND); + } else if self.has_role(db, "Förderndes Mitglied").await { + fee.add("Förderndes Mitglied".into(), FOERDERND); + } else if Family::find_by_opt_id(db, self.family_id).await.is_none() { if self.has_role(db, "Student").await || self.has_role(db, "Schüler").await { fee.add("Schüler/Student".into(), STUDENT_OR_PUPIL); } else {