remove unnecessary field
Some checks failed
CI/CD Pipeline / test (push) Failing after 2m7s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
philipp 2024-01-19 00:46:51 +01:00
parent b893989dce
commit cb892e1c0c

View File

@ -104,7 +104,6 @@ pub enum LoginError {
pub(crate) struct Fee { pub(crate) struct Fee {
pub(crate) sum_in_cents: i32, pub(crate) sum_in_cents: i32,
pub(crate) parts: Vec<(String, i32)>, pub(crate) parts: Vec<(String, i32)>,
pub(crate) family: bool,
pub(crate) name: String, pub(crate) name: String,
} }
@ -118,10 +117,6 @@ impl Fee {
} }
} }
pub fn family(&mut self) {
self.family = true;
}
pub fn add(&mut self, desc: String, price_in_cents: i32) { pub fn add(&mut self, desc: String, price_in_cents: i32) {
self.sum_in_cents += price_in_cents; self.sum_in_cents += price_in_cents;
@ -149,7 +144,6 @@ impl User {
if let Some(family) = Family::find_by_opt_id(db, self.family_id).await { if let Some(family) = Family::find_by_opt_id(db, self.family_id).await {
fee.name(format!("{} + Familie", self.name)); fee.name(format!("{} + Familie", self.name));
fee.family();
for member in family.members(db).await { for member in family.members(db).await {
fee.merge(member.fee_without_families(db).await); fee.merge(member.fee_without_families(db).await);
} }