homebox/backend/internal/services/all.go
Hayden 343290a55a
refactor: repositories (#28)
* cleanup unnecessary mocks

* refactor document storage location

* remove unused function

* move ownership to document types to repo package

* move types and mappers to repo package

* refactor sets to own package
2022-09-27 15:52:13 -08:00

26 lines
515 B
Go

package services
import "github.com/hay-kot/homebox/backend/internal/repo"
type AllServices struct {
User *UserService
Location *LocationService
Labels *LabelService
Items *ItemService
}
func NewServices(repos *repo.AllRepos) *AllServices {
if repos == nil {
panic("repos cannot be nil")
}
return &AllServices{
User: &UserService{repos},
Location: &LocationService{repos},
Labels: &LabelService{repos},
Items: &ItemService{
repo: repos,
at: attachmentTokens{},
},
}
}