Add backend support for transaction categories #524
Reference in New Issue
Block a user
Delete Branch "transaction-categories"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds basic support for transaction categories in the backend, PR for the UI coming up next. As we've agreed on previously:
internal_categorythat in the future might be used by the rule engine to discern which category represents whatinternal_categoryfield is automatically cleared when a user modifies a category's name as it's original purpose cannot be guaranteed anymoreFirst time I'm working with Ruby or Rails so please don't hesitate to let me know if there's anything odd 😄
@@ -13,6 +13,7 @@ class RegistrationsController < ApplicationController@user.family = familyif @user.saveTransaction::Category.create_default_categories(@user.family)I have considered moving this into an
after_createcallback in the Family model but thought it felt strange having the Family model create other model's instances as a side effect, so I made it explicit like this.@@ -13,6 +13,7 @@ class RegistrationsController < ApplicationController@user.family = familyif @user.saveTransaction::Category.create_default_categories(@user.family)Yeah I think especially since we're a little unclear about the requirements of these default categories, where you have it here makes sense for now.
I just checked with our designer and found out we won't be using icons for categories. So we can remove this.
Here's what it will look like:
Nice work, changes here make sense to me!
Let me know what UI related changes you'll be making in the next PR so I can provide the relevant designs.
Might be useful to default this to something like
#6172F3?(I didn't use gray because that will be used for "Uncategorized")