/
usecases.go
68 lines (63 loc) · 2.16 KB
/
usecases.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package usecases
import (
"github.com/savannahghi/engagementcore/pkg/engagement/infrastructure"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/fcm"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/feed"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/feedback"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/library"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/mail"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/messaging"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/onboarding"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/otp"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/sms"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/surveys"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/twilio"
"github.com/savannahghi/engagementcore/pkg/engagement/usecases/uploads"
)
// Interactor is an implementation of the usecases interface
type Interactor struct {
*feed.UseCaseImpl
*feed.NotificationImpl
*fcm.ImplFCM
*library.ImplLibrary
*mail.ImplMail
*messaging.ImplNotification
*onboarding.ImplOnboarding
*otp.ImplOTP
*sms.ImplSMS
*surveys.ImplSurveys
*feedback.ImplFeedback
*uploads.ImpUploads
*twilio.ImplTwilio
}
// NewUsecasesInteractor initializes a new usecases interactor
func NewUsecasesInteractor(infrastructure infrastructure.Interactor) Interactor {
notification := feed.NewNotification(infrastructure)
feed := feed.NewFeed(infrastructure)
fcm := fcm.NewFCM(infrastructure)
library := library.NewLibrary(infrastructure)
mail := mail.NewMail(infrastructure)
messaging := messaging.NewNotification(infrastructure)
onboarding := onboarding.NewOnboarding(infrastructure)
otp := otp.NewOTP(infrastructure)
sms := sms.NewSMS(infrastructure)
surveys := surveys.NewSurveys(infrastructure)
feedback := feedback.NewFeedback(infrastructure)
uploads := uploads.NewUploads(infrastructure)
twilio := twilio.NewImplTwilio(infrastructure)
return Interactor{
feed,
notification,
fcm,
library,
mail,
messaging,
onboarding,
otp,
sms,
surveys,
feedback,
uploads,
twilio,
}
}