add solicitation task and validations
All checks were successful
Build and Publish / build-release (push) Successful in 1m28s
All checks were successful
Build and Publish / build-release (push) Successful in 1m28s
This commit is contained in:
@@ -14,11 +14,11 @@ defmodule WorkloadService.Handlers.TaskCompletedHandler do
|
||||
SolicitationTask
|
||||
}
|
||||
|
||||
def handle(%TaskCompleted{} = event, _metadata) do
|
||||
def handle(%TaskCompleted{} = event, _metadata) do
|
||||
aggregate_module =
|
||||
case event.id.type do
|
||||
"quote" -> {:ok, QuoteTask}
|
||||
# "solicitation" -> SolicitationTask
|
||||
"solicitation" -> {:ok, SolicitationTask}
|
||||
_ -> {:error, "aggregate module not found for event type #{event.id}"}
|
||||
end
|
||||
|
||||
@@ -36,9 +36,21 @@ defmodule WorkloadService.Handlers.TaskCompletedHandler do
|
||||
Logger.warning("TaskCompletedHandler: aggregate not found for #{event.id}")
|
||||
|
||||
state ->
|
||||
exchange =
|
||||
case event.id.type do
|
||||
"quote" -> "workload_service.events.quote_task_completed"
|
||||
"solicitation" -> "workload_service.events.solicitation_task_completed"
|
||||
end
|
||||
|
||||
routing_key =
|
||||
case event.id.type do
|
||||
"quote" -> "quote_task.completed"
|
||||
"solicitation" -> "solicitation_task.completed"
|
||||
end
|
||||
|
||||
MessageBus.publish(
|
||||
"workload_service.events.quote_task_completed",
|
||||
"quote_task.completed",
|
||||
exchange,
|
||||
routing_key,
|
||||
state
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user