-
Notifications
You must be signed in to change notification settings - Fork 12
/
command_handlers.go
26 lines (23 loc) · 1.32 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
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 {
CreateMasterPlan CreateMasterPlanCommandHandler
UpdateMasterPlan UpdateMasterPlanCommandHandler
CreateMasterPlanMilestone CreateMasterPlanMilestoneCommandHandler
UpdateMasterPlanMilestone UpdateMasterPlanMilestoneCommandHandler
ReorderMasterPlanMilestones ReorderMasterPlanMilestonesCommandHandler
}
func NewCommandHandlers(log logger.Logger, cfg *config.Config, es eventstore.AggregateStore) *CommandHandlers {
return &CommandHandlers{
CreateMasterPlan: NewCreateMasterPlanCommandHandler(log, es),
UpdateMasterPlan: NewUpdateMasterPlanCommandHandler(log, es, cfg.Utils),
CreateMasterPlanMilestone: NewCreateMasterPlanMilestoneCommandHandler(log, es, cfg.Utils),
UpdateMasterPlanMilestone: NewUpdateMasterPlanMilestoneCommandHandler(log, es, cfg.Utils),
ReorderMasterPlanMilestones: NewReorderMasterPlanMilestonesCommandHandler(log, es, cfg.Utils),
}
}