staging #169

Merged
philipp merged 83 commits from staging into main 2024-01-19 07:43:06 +01:00
Showing only changes of commit cb892e1c0c - Show all commits

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);
} }