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, :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 end