expenses should have id, name, amount and can only update name/amount
Service and repository structure should look like this:
type Service interface{
functions
}
type service struct {
xrepisitory repisitory.Xrepository
yrepository repisitory.yrepository
}
func NewService(xrepository ....) Service {
return service{xrepository: xrepository}
}
type Repository interface{
functions
}
type repository struct {
db db.Mysql
}
func NewRepository(db db.Mysql) Service {
return repository{db: db}
}
Just a CRUD for now.
expenses should have id, name, amount and can only update name/amount
Service and repository structure should look like this: