-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Budget split for transactions - Model Refactor #105
Comments
Maybe better than doing all the work it would take to retrofit this, we should add transaction Categories in addition to budgets... where budgets would be for... well... budgeting, and categories would be solely for reporting. That would make implementation easier, and we could setup default categories for each budget, but is this a good idea? |
Categories is probably a bad idea. It's a hack-y way around the complexity of the problem, that ends up complicating the UX and not really solving the problem. I think the logical implementation is a BudgetTransaction model:
The Transaction model should get backref relationships to a list of BudgetTransactions. The UI will handle validation of this, but we should also have some DB-side validation that ensures all BudgetTransaction amount sums equal the Transaction amount. We'll want to remove the budget field on the Transaction itself, and then update the codebase to work with the new models. We'll also need a migration for this that adds the new table and the relation to the Transaction table, migrates the data, and then drops the old columns. |
Updated the initial comment/description of the issue with the current plan of work. |
Updated the checklist again. I started some implementation for this in the |
So regarding the last comment on So a Transaction will have values for |
…ounts() instead of direct BudgetTransaction() creation
As of the above commit, this issue should finally be complete aside from testing the DB migrations. I'll probably just write a one-off script to handle that. Or, maybe if I really care, I'll combine the auto-migration logic with the DB refreshing test logic, and write a sample class for testing DB forward and reverse migrations. |
…m f136418fc4ab and 5446559aecf7 we ended up with an index in the migrations but not the model
Released today in 1.0.0 |
This is part 1 of 2 to add support for allocating a single transaction against multiple budgets. This must maintain the actual transaction amount (for OFX reconcile, etc.) but allow allocating that amount either to one budget, or split across multiple budgets.
Planning:
Implementation:
BudgetTransaction
, that builds an association between a transaction, an amount that's part or all of that transaction, and a budget. Fields should probably be ID, trans_id / transaction relationship, budget_id / budget relationship, and amount.The text was updated successfully, but these errors were encountered: