init commit
This commit is contained in:
47
lib/workload_service/events/task.ex
Normal file
47
lib/workload_service/events/task.ex
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
Reference in New Issue
Block a user