customer/internal/initialize/services.go

33 lines
797 B
Go
Raw Normal View History

2023-05-16 01:12:07 +00:00
package initialize
import (
2023-05-17 20:27:09 +00:00
"go.uber.org/zap"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/account"
2023-05-19 04:50:40 +00:00
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/currency"
2023-05-16 01:12:07 +00:00
)
type ServicesDeps struct {
2023-05-17 20:27:09 +00:00
Logger *zap.Logger
2023-05-16 01:12:07 +00:00
Repositories *Repositories
Clients *Clients
}
type Services struct {
2023-05-19 04:50:40 +00:00
AccountService *account.Service
CurrencyService *currency.Service
2023-05-16 01:12:07 +00:00
}
func NewServices(deps *ServicesDeps) *Services {
2023-05-17 20:27:09 +00:00
return &Services{
AccountService: account.New(&account.Deps{
Logger: deps.Logger,
Repository: deps.Repositories.AccountRepository,
AuthClient: deps.Clients.AuthClient,
2023-05-17 20:27:09 +00:00
}),
2023-05-19 04:50:40 +00:00
CurrencyService: currency.New(&currency.Deps{
Logger: deps.Logger,
Repository: deps.Repositories.CurrencyRepository,
}),
2023-05-17 20:27:09 +00:00
}
2023-05-16 01:12:07 +00:00
}