Add Transaction Merchant management #686
Reference in New Issue
Block a user
Delete Branch "681-merchant-management"
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?
Closes #681
In addition to the issue requirements, I have also hooked up the merchants to transaction filtering.
Video:

/claim #681
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay.
@zachgoll ready for review 😄
Awesome work on this. Thanks for adding this to the filters as well! One small comment about the delete behavior, but otherwise, looks like this is good to go!
@@ -0,0 +29,4 @@this.avatarTarget.style.borderColor = `color-mix(in srgb, ${color} 10%, white)`;this.avatarTarget.style.color = color;}}Nice idea for this 👍
@@ -3,6 +3,7 @@ class Transaction < ApplicationRecordbelongs_to :accountbelongs_to :category, optional: truebelongs_to :merchant, optional: trueWe should probably update these lines to:
Currently, there is a database constraint for categories that nullifies the
categoryfield on all transactions when it is deleted introduced by this migration.I'm still not 100% sure whether we should be doing this at the model level, DB level, or both. In the future, we may have other APIs modifying data (companion apps, etc.) which would lean towards handling it at the DB level. But for now, I think we can just do it at the model level here.
@@ -3,6 +3,7 @@ class Transaction < ApplicationRecordbelongs_to :accountbelongs_to :category, optional: truebelongs_to :merchant, optional: trueDoesn't the
has_many :transactions, dependent: :nullifyon theTransaction::Category/Transaction::Merchantmodels already take care of this?94afe4bd3a/app/models/transaction/merchant.rb (L2)@@ -3,6 +3,7 @@ class Transaction < ApplicationRecordbelongs_to :accountbelongs_to :category, optional: truebelongs_to :merchant, optional: trueYep, you're 100% correct. I was thinking about that backwards!