danielblagy/budget-app

implement GetByID and GetAll for Entry entity

danielblagy opened this issue · 1 comments

  1. Get entry by entry ID
GET /entries/by_ud/:id

Authorization:

  • user must be logged in and authorized
  • if entry doesn't belong to the user, return NotFound error
  1. Get all user's entries of type (income or expense)
GET /entries/:type

DB schema: https://www.notion.so/DB-Schema-3d1843334fc44a8982dd2f38283a69ff

Model mapping to postgres table:

  • ID int64
  • UserID string
  • CategoryID int64
  • Amount float64 (for now)
  • Date time.Time
  • Description string
  • Type EntryType (income, expense)

1)Made migrations (create entries up and down)
2)Added model for Entry entity
3)Added GetByID and GetAll functions
4)Generated mocks for functions