Files
customer-service/lib/customer_service/commanded_app.ex
HaimKortovich b1b1c21e4e
Some checks failed
Build and Publish / build-release (push) Failing after 1s
init commit
2026-04-15 16:20:22 -05:00

21 lines
492 B
Elixir

defmodule CustomerService.Router do
use Commanded.Commands.Router
alias CustomerService.Commands
alias CustomerService.Aggregates
identify(Aggregates.Customer, by: :id)
dispatch([Commands.CreateCustomer], to: Aggregates.Customer)
dispatch(Commands.CreateCorporateCustomer,
to: Aggregates.CorporateCustomer,
identity: :id
)
end
defmodule CustomerService.CommandedApp do
use Commanded.Application,
otp_app: :customer_service
router(CustomerService.Router)
end