24 lines
528 B
Elixir
24 lines
528 B
Elixir
defmodule PolicyService.Router do
|
|
use Commanded.Commands.Router
|
|
alias PolicyService.Commands.Car
|
|
alias PolicyService.Aggregates
|
|
|
|
dispatch(
|
|
[
|
|
Car.SubmitCarPolicyApplication,
|
|
Car.RecordCarProviderQuote,
|
|
Car.AcceptCarQuoteAndSolicit,
|
|
Car.RecordCarPolicyIssued
|
|
],
|
|
to: PolicyService.Aggregates.CarPolicyApplication,
|
|
identity: :application_id
|
|
)
|
|
end
|
|
|
|
defmodule PolicyService.CommandedApp do
|
|
use Commanded.Application,
|
|
otp_app: :policy_service
|
|
|
|
router(PolicyService.Router)
|
|
end
|