33 lines
884 B
Elixir
33 lines
884 B
Elixir
defmodule WorkloadService.Router do
|
|
use Commanded.Commands.Router
|
|
|
|
dispatch(
|
|
[
|
|
WorkloadService.Commands.QuoteTask.CreateTask,
|
|
WorkloadService.Commands.QuoteTask.SubmitResponse,
|
|
WorkloadService.Commands.QuoteTask.ApproveSubmission,
|
|
WorkloadService.Commands.QuoteTask.CompleteTask
|
|
],
|
|
to: WorkloadService.Aggregates.QuoteTask,
|
|
identity: :id
|
|
)
|
|
|
|
dispatch(
|
|
[
|
|
WorkloadService.Commands.SolicitationTask.CreateTask,
|
|
WorkloadService.Commands.SolicitationTask.SubmitResponse,
|
|
WorkloadService.Commands.SolicitationTask.ApproveSubmission,
|
|
WorkloadService.Commands.SolicitationTask.CompleteTask
|
|
],
|
|
to: WorkloadService.Aggregates.SolicitationTask,
|
|
identity: :id
|
|
)
|
|
end
|
|
|
|
defmodule WorkloadService.CommandedApp do
|
|
use Commanded.Application,
|
|
otp_app: :workload_service
|
|
|
|
router(WorkloadService.Router)
|
|
end
|