add type specs and fix id issues
Some checks failed
Build and Publish / build-release (push) Failing after 37s
Some checks failed
Build and Publish / build-release (push) Failing after 37s
This commit is contained in:
@@ -7,47 +7,53 @@ defmodule WorkloadService.Commands.QuoteTask do
|
||||
@moduledoc """
|
||||
Command to create a new quote 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]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
end
|
||||
|
||||
defmodule SubmitResponse do
|
||||
@moduledoc """
|
||||
Command to submit response for a quote task.
|
||||
"""
|
||||
@type t :: %__MODULE__{
|
||||
id: WorkloadService.Aggregates.TaskId.t(),
|
||||
submission: map(),
|
||||
attachments: [String.t()]
|
||||
}
|
||||
|
||||
@derive Jason.Encoder
|
||||
defstruct [:id, :submission, :attachments]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
end
|
||||
|
||||
defmodule ApproveSubmission do
|
||||
@moduledoc """
|
||||
Command to approve submission for a quote task.
|
||||
"""
|
||||
@type t :: %__MODULE__{
|
||||
id: WorkloadService.Aggregates.TaskId.t()
|
||||
}
|
||||
|
||||
@derive Jason.Encoder
|
||||
defstruct [:id]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
end
|
||||
|
||||
defmodule CompleteTask do
|
||||
@moduledoc """
|
||||
Command to complete a quote task.
|
||||
"""
|
||||
@type t :: %__MODULE__{
|
||||
id: WorkloadService.Aggregates.TaskId.t(),
|
||||
completed_by: String.t()
|
||||
}
|
||||
|
||||
@derive Jason.Encoder
|
||||
defstruct [:id, :completed_by]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,47 +7,53 @@ defmodule WorkloadService.Commands.SolicitationTask 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]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
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]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
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]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
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]
|
||||
|
||||
def new(attrs) do
|
||||
struct(__MODULE__, attrs)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user