RIP-Comm / sossoldi

"Sossoldi" is a wealth management / personal finance / Net Worth tracking app, made with Flutter.
MIT License
262 stars 73 forks source link

Add active to budget table #75

Closed sainzrow closed 1 year ago

sainzrow commented 1 year ago
mikev-cw commented 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!

sainzrow commented 1 year ago

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

lucaantonelli commented 1 year ago

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.

mikev-cw commented 1 year ago

I'm merging this as discussed on Discord: we'll maybe fix reviewed issues later