-
Notifications
You must be signed in to change notification settings - Fork 12
/
command_handlers.go
48 lines (45 loc) · 2.78 KB
/
command_handlers.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
package command_handler
import (
"github.com/openline-ai/openline-customer-os/packages/server/events-processing-platform/config"
"github.com/openline-ai/openline-customer-os/packages/server/events-processing-platform/eventstore"
"github.com/openline-ai/openline-customer-os/packages/server/events-processing-platform/logger"
)
// CommandHandlers acts as a container for all command handlers.
type CommandHandlers struct {
UpsertOrganization UpsertOrganizationCommandHandler
UpdateOrganization UpdateOrganizationCommandHandler
LinkPhoneNumberCommand LinkPhoneNumberCommandHandler
LinkEmailCommand LinkEmailCommandHandler
LinkLocationCommand LinkLocationCommandHandler
LinkDomainCommand LinkDomainCommandHandler
AddSocialCommand AddSocialCommandHandler
HideOrganizationCommand HideOrganizationCommandHandler
ShowOrganizationCommand ShowOrganizationCommandHandler
RefreshLastTouchpointCommand RefreshLastTouchpointCommandHandler
UpsertCustomFieldCommand UpsertCustomFieldCommandHandler
AddParentCommand AddParentCommandHandler
RemoveParentCommand RemoveParentCommandHandler
RefreshArr RefreshArrCommandHandler
UpdateOnboardingStatus UpdateOnboardingStatusCommandHandler
UpdateOrganizationOwner UpdateOrganizationOwnerCommandHandler
}
func NewCommandHandlers(log logger.Logger, cfg *config.Config, es eventstore.AggregateStore, ebs *eventstore.EventBufferService) *CommandHandlers {
return &CommandHandlers{
UpsertOrganization: NewUpsertOrganizationCommandHandler(log, es),
UpdateOrganization: NewUpdateOrganizationCommandHandler(log, es, cfg.Utils),
LinkPhoneNumberCommand: NewLinkPhoneNumberCommandHandler(log, es),
LinkEmailCommand: NewLinkEmailCommandHandler(log, es),
LinkLocationCommand: NewLinkLocationCommandHandler(log, es),
LinkDomainCommand: NewLinkDomainCommandHandler(log, es, cfg.Utils),
AddSocialCommand: NewAddSocialCommandHandler(log, es, cfg.Utils),
HideOrganizationCommand: NewHideOrganizationCommandHandler(log, es),
ShowOrganizationCommand: NewShowOrganizationCommandHandler(log, es),
RefreshLastTouchpointCommand: NewRefreshLastTouchpointCommandHandler(log, es, cfg.Utils),
UpsertCustomFieldCommand: NewUpsertCustomFieldCommandHandler(log, es),
AddParentCommand: NewAddParentCommandHandler(log, es),
RemoveParentCommand: NewRemoveParentCommandHandler(log, es),
RefreshArr: NewRefreshArrCommandHandler(log, es, cfg.Utils),
UpdateOnboardingStatus: NewUpdateOnboardingStatusCommandHandler(log, es, cfg.Utils),
UpdateOrganizationOwner: NewUpdateOrganizationOwnerCommandHandler(log, es, cfg.Utils, ebs),
}
}