letehaha / budget-tracker-fe

A web app to keep track of your finances. Track and get stats about your income, expenses and investments. WIP
https://gamanets.money
MIT License
0 stars 0 forks source link

Ability to group accounts #310

Closed letehaha closed 1 week ago

letehaha commented 2 months ago

Ability to group accounts. Best description – accounts folders. For example, user has accounts like Bank_A_usd and Bank_A_uah. Much more convenient will be to allow group them by Bank_A. "Folders" might be multilevel, so users can group by Banks, Brokers, Crypto, or whatever.

Improvements it adds

  1. Easier to manage many accounts from the same bank, or same type of accounts.
  2. Easier to filter transactions or spendings by accounts groups.
  3. Ability to watch the Total balance of the account group. For example, instead of checking USD+UAH+EUR of the same bank, the user will be able to see the total balance in the bank. Especially valuable for things like Wise, where users can have dozens of accounts.
  4. Saves space on the UI, so easier to navigate, easier to fit new features, etc.
  5. For manual syncing, we can add an ability to show the last dates for the transactions, so users can see when they did last updates to the folder (bank)

Impl details

The best option is to not modify existing things, and simply create two separate groups:

// AccountGroupings table

id (primary key)
account_id (foreign key to Accounts table)
group_id (foreign key to AccountGroups table)
// AccountGroups table

id (primary key)
user_id (foreign key to Users table)
name (e.g., "Bank_A", "Brokers", "Crypto")
parent_group_id (self-referencing foreign key for nested groups) (null for top-level group)
letehaha commented 1 week ago

Resolved in linked PRs