-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Assign categories to expenses #28
Assign categories to expenses #28
Conversation
@ChristopherJohnston is attempting to deploy a commit to the Sebastien Castiel Team on Vercel. A member of the Team first needs to authorize it. |
Re-submitted this implementation, merged with the expenseDate and uneven-split changes. The intent here is to follow the split wise categories so it's easier to import from a CSV. Happy to discuss the implementation. |
7f40408
to
8b0fe85
Compare
@ChristopherJohnston looks great! I had some trouble to make the migration work, so I changed it a bit, to insert categories into the database as part of the migration (instead of using a seed). It makes more sense to me, what do you think? |
It looks fine as part of the migration. I'm now wondering if it's easier and better just to have a hard-coded list of categories to save the additional overhead from database queries - particularly if the categories are going to be fixed. |
for reference I took the seed script concept from https://planetscale.com/blog/how-to-seed-a-database-with-prisma-and-next-js |
That is a fair point, maybe it’ll be easier to deal with hardcoded categories. |
Since the implementation is pretty much done, I'd keep it in the DB as it keeps things extensible. That's how I was about to implement it anyways 😆 |
Yep it's not a bad implementation as it is - just need to be careful of the impact on api calls on Vercel as volume increases. I would think it's fine for now |
Thanks @Max-TheCat for the input! I’ll merge the PR as is. Worst case scenario we migrate to a hardcoded list, which wouldn’t be too much work 😉 |
add a categories table
add seed script to populate with some categories (mimics the splitwise category list)
add category relation to expense table,
add ability to select category in the create/edit forms