2023-05-16 01:12:07 +00:00
|
|
|
package initialize
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
"go.mongodb.org/mongo-driver/mongo"
|
2023-05-16 04:01:55 +00:00
|
|
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/repository"
|
2023-05-16 01:12:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type RepositoriesDeps struct {
|
|
|
|
MongoDB *mongo.Database
|
|
|
|
Logger *logrus.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
type Repositories struct {
|
|
|
|
HealthRepository *repository.HealthRepository
|
|
|
|
GoogleRepository *repository.GoogleRepository
|
|
|
|
AmocrmRepository *repository.AmocrmRepository
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewRepositories(deps *RepositoriesDeps) *Repositories {
|
|
|
|
return &Repositories{
|
|
|
|
HealthRepository: repository.NewHealthRepository(deps.MongoDB),
|
|
|
|
AmocrmRepository: repository.NewAmocrmRepository(
|
|
|
|
deps.MongoDB.Collection("amocrm"),
|
|
|
|
deps.Logger,
|
|
|
|
),
|
|
|
|
GoogleRepository: repository.NewGoogleRepository(
|
|
|
|
deps.MongoDB.Collection("google"),
|
|
|
|
deps.Logger,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
}
|