final #168

Merged
philipp merged 4 commits from final into staging 2024-01-19 01:00:08 +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);
} }