sossoldi icon indicating copy to clipboard operation
sossoldi copied to clipboard

Refactoring recurring transactions

Open mikev-cw opened this issue 10 months ago • 2 comments

This aims to address #144. I focused on Backend operations only.

Removed recurring_transaction_amount model, and added recurring_transaction. Now we've a table that list recurring transactions. When the app is opened, not more than once a day thanks to shared preferences, system will check if a transaction (or more) is needed, and adds them to the transaction table, based on their recurrency type.

Also changed the behavior of "clear db" button on settings: now it re-generates all tables. This is useful when we edit models: there will no more need to delete database from OS. To check this PR, just chekout, run, press "reset DB" and fill with demo data.

I'm leaving this in draft for now: i need to go deeper on some behaviors, update tests, and remove some dev debug code. Meanwhile feel free to share your opinions if you want. Also if anyone wants to help with frontend, which I am not very familiar with, it would help.

mikev-cw avatar Apr 26 '24 14:04 mikev-cw

I can help with the frontend changes. I'll work on the recurring transactions display section.

K-w-e avatar Apr 28 '24 09:04 K-w-e

@K-w-e Thank you, it would be great! There's also how the add_page.dart reads and writes recurring data. Not checked yet how that part needs to be implemented. Reach me any time if you need help, i plan to open this PR for review within this week.

mikev-cw avatar Apr 29 '24 21:04 mikev-cw

I opened this for review. Reporting below the updated first comment:

Removed recurring_transaction_amount model, and added recurring_transaction. Now we've a table that list recurring transactions. When the app is opened, not more than once a day thanks to shared preferences, system will check if a transaction (or more) is needed, and adds them to the transaction table, based on their recurrency type.

Also changed the behavior of "clear db" button on settings: now it re-generates all tables. This is useful when we edit models: there will no more need to delete database from OS. To check this PR, just chekout, run, press "reset DB" and fill with demo data.

[...]

I'm opening this PR for review. We've also covered the front-end stuff with the help of @K-w-e. Now when an user edits or creates a transaction, all pages will prevent or require the user to change recurrence data, based on the logic we defined.

Also: bumped the version of flutter_local_notifications, and -as per our last meeting- fixed the version of Flutter SDK to 3.24.3

mikev-cw avatar Oct 29 '24 22:10 mikev-cw