Files
workload-service/lib/workload_service/events/task.ex
2026-04-16 14:20:58 -05:00

47 lines
1.2 KiB
Elixir

defmodule WorkloadService.Events do
@moduledoc """
All domain events for the workload service.
"""
defmodule TaskCreated do
@moduledoc """
Emitted when a new task is created (quote or solicitation).
ID format: "org_id:type:task_id" (e.g., "test:quote:uuid") - TaskId struct
"""
@derive Jason.Encoder
defstruct [:id, :application_id, :provider_id, :provider_name, :task_info, :attachments]
end
defmodule SubmissionUpdated do
@moduledoc """
Emitted when submission is updated (user provides response data).
"""
@derive Jason.Encoder
defstruct [:id, :submission, :attachments]
end
defmodule SubmissionApproved do
@moduledoc """
Emitted when submission is approved and ready to send.
"""
@derive Jason.Encoder
defstruct [:id]
end
defmodule TaskCompleted do
@moduledoc """
Emitted when task is completed and sent to policy-service.
Triggers RabbitMQ publish.
"""
@derive Jason.Encoder
defstruct [:id, :completed_by]
end
defmodule QuoteAccepted do
@moduledoc """
Emitted when a quote is accepted - triggers solicitation generation.
"""
@derive Jason.Encoder
defstruct [:id, :provider_id, :quote_id, :plan_id]
end
end