All checks were successful
Build and Publish / build-release (push) Successful in 2m13s
29 lines
732 B
Elixir
29 lines
732 B
Elixir
defmodule CustomerService.Router do
|
|
use Commanded.Commands.Router
|
|
alias CustomerService.Commands
|
|
alias CustomerService.Aggregates
|
|
|
|
identify(Aggregates.Customer, by: :id)
|
|
dispatch([Commands.CreateCustomer, Commands.UpdateCustomer], to: Aggregates.Customer)
|
|
|
|
dispatch(
|
|
[Commands.CreateCorporateCustomer, Commands.UpdateCorporateCustomer],
|
|
to: Aggregates.CorporateCustomer,
|
|
identity: :id
|
|
)
|
|
|
|
identify(Aggregates.QuickLead, by: :id)
|
|
|
|
dispatch(
|
|
[Commands.CreateQuickLead, Commands.UpdateQuickLead, Commands.UpdateLeadStatus],
|
|
to: Aggregates.QuickLead
|
|
)
|
|
end
|
|
|
|
defmodule CustomerService.CommandedApp do
|
|
use Commanded.Application,
|
|
otp_app: :customer_service
|
|
|
|
router(CustomerService.Router)
|
|
end
|