defmodule WorkloadService.Commands.SolicitationTask do @moduledoc """ Solicitation task commands. """ defmodule CreateTask do @moduledoc """ Command to create a new solicitation task. """ @type t :: %__MODULE__{ id: WorkloadService.Aggregates.TaskId.t(), application_id: WorkloadService.Aggregates.ApplicationId.t(), task_info: map(), attachments: [String.t()] } @derive Jason.Encoder defstruct [:id, :application_id, :task_info, :attachments] end defmodule SubmitResponse do @moduledoc """ Command to submit response for a solicitation task. """ @type t :: %__MODULE__{ id: WorkloadService.Aggregates.TaskId.t(), submission: map(), attachments: [String.t()] } @derive Jason.Encoder defstruct [:id, :submission, :attachments] end defmodule ApproveSubmission do @moduledoc """ Command to approve submission for a solicitation task. """ @type t :: %__MODULE__{ id: WorkloadService.Aggregates.TaskId.t() } @derive Jason.Encoder defstruct [:id] end defmodule RequestApproval do @moduledoc """ Command to request approval for a solicitation task. Moves task from 'draft' to 'approval_requested'. """ @type t :: %__MODULE__{ id: WorkloadService.Aggregates.TaskId.t() } @derive Jason.Encoder defstruct [:id] end defmodule CompleteTask do @moduledoc """ Command to complete a solicitation task. """ @type t :: %__MODULE__{ id: WorkloadService.Aggregates.TaskId.t(), completed_by: String.t() } @derive Jason.Encoder defstruct [:id, :completed_by] end end