[WIP] ♻️ make templates classy and replace 🍝 code #3754
+611
−606
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.
An attempt to rewrite the goal template processing to not be so messy. Im moving a lot of the functions into a class that will be used for each category and that way all the calculations can stay local and have minimal variables passed around. There will still be level above this so that things that require some checks of the full budget can still be done ex. balances at priority levels, remainder amounts, recapturing funds from limits, etc
This also should hopefully fix #2741, fix #2405, fix #2437, and make #1686 easier. While also making future hooks into goals be easier to do. For example showing changes before applying, calculating full amounts for planning, etc.
So far this also includes a big change where limits only apply once, and not every priority level.
Don't expect this to be done for a bit. If anyone wants to look over my general structure of the class and point me in the right direction with all the async/await stuff, that would be helpful.