This commit is contained in:
@@ -1,17 +1,28 @@
|
||||
defmodule PolicyService.Router do
|
||||
use Commanded.Commands.Router
|
||||
alias PolicyService.Commands.Car
|
||||
alias PolicyService.Aggregates
|
||||
|
||||
# Route Car commands to Car Aggregate
|
||||
dispatch(
|
||||
[
|
||||
Car.SubmitCarPolicyApplication,
|
||||
Car.RecordCarProviderQuote,
|
||||
Car.AcceptCarQuoteAndSolicit,
|
||||
Car.RecordCarPolicyIssued
|
||||
PolicyService.Commands.CarPolicy.SubmitPolicyApplication,
|
||||
PolicyService.Commands.CarPolicy.RecordProviderQuote,
|
||||
PolicyService.Commands.CarPolicy.AcceptQuoteAndSolicit,
|
||||
PolicyService.Commands.CarPolicy.RecordPolicyIssued
|
||||
],
|
||||
to: PolicyService.Aggregates.CarPolicyApplication,
|
||||
identity: :application_id
|
||||
identity: :id
|
||||
)
|
||||
|
||||
# Route Fire commands to Fire Aggregate
|
||||
dispatch(
|
||||
[
|
||||
PolicyService.Commands.FirePolicy.SubmitPolicyApplication,
|
||||
PolicyService.Commands.FirePolicy.RecordProviderQuote,
|
||||
PolicyService.Commands.FirePolicy.AcceptQuoteAndSolicit,
|
||||
PolicyService.Commands.FirePolicy.RecordPolicyIssued
|
||||
],
|
||||
to: PolicyService.Aggregates.FirePolicyApplication,
|
||||
identity: :id
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user