Closed sainzrow closed 1 year ago
Cool!
For consistency with the project, I think we should use same approach used -for instance- in the mainAccount
field of bankAccount
model: we use bool
true/false in dart object, then the model takes care of converting bool
to int
1/0 on functions that read/write on db.
Can you adjust your work like this? Thank you!
Sure, i'll update the PR. However, i think there might be a problem with the insert/update of the bankAccount model because of the following row: Map<String, Object?> toJson({bool update = false}) => { ... BankAccountFields.mainAccount: mainAccount, ... }; as it seems to put a boolean type into an int.
Should i fix this in my budget model? Thanks
Sure, i'll update the PR. However, i think there might be a problem with the insert/update of the bankAccount model because of the following row: Map<String, Object?> toJson({bool update = false}) => { ... BankAccountFields.mainAccount: mainAccount, ... }; as it seems to put a boolean type into an int.
Should i fix this in my budget model? Thanks
You're right, it is needed to set BankAccountFields.mainAccount: mainAccount ? 1 : 0
, i forgot it in the last commit. It is also needed in currency.dart for mainCurrency and in transaction.dart for recurring, if you can do that so is all in just one PR.
I'm merging this as discussed on Discord: we'll maybe fix reviewed issues later