remove unnecessary field
This commit is contained in:
parent
b893989dce
commit
cb892e1c0c
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user