I am building an expense tracker application and I am in middle of data modelling. I have a Users table. Each user will log his expenses with expense type and income with income type. So I need to know how can we set up associations for it.
I have User, Expense, Income and UserTransaction models.
Expense and Income will have following fields
id, date, category, amount, description, user_id, currency
I am not sure whether I need UserTransaction table also.
But my business requirement is as follows
I should be able to get all expenses/income of a user with date range and also with category
I should also be able to get all transactions occurred with date range.