feat: Add budget balance and filter for budget in get_transactions #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows you to check the balance for your budget, as well as retrieve the transactions for each budget.
I did try to create transactions directly as a budget property, but that runs into different issues:
202410
, with an integer in the transactions table in the form20241005
. This makes the "safe" relationship harder to achieve. - When using instead a property, the sqlalchemy session is used instead of the sqlmodel session. It's probably not safe either since we have to convert the result first to the correct models, and I don't know if they would work 100%.I instead included the budget filter in the
get_transactions
instead.For example:
For me prints:
And frontend shows:
Closes #90