rafaelrubbioli / expenses

Graphql API for calculating expenses
MIT License
5 stars 7 forks source link

Expenses service + repository #25

Open rafaelrubbioli opened 4 years ago

rafaelrubbioli commented 4 years ago

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:

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}
}
arturbani commented 4 years ago

Can I work on this? =)

rafaelrubbioli commented 4 years ago

Can I work on this? =)

sure!