remove version
All checks were successful
Build and Publish / build-release (push) Successful in 1m23s
All checks were successful
Build and Publish / build-release (push) Successful in 1m23s
This commit is contained in:
@@ -33,8 +33,7 @@ defmodule WorkloadService.Aggregates.Task do
|
||||
:task_info,
|
||||
:submission,
|
||||
:attachments,
|
||||
:status,
|
||||
:version
|
||||
:status
|
||||
]
|
||||
|
||||
@impl Aggregate
|
||||
@@ -99,8 +98,7 @@ defmodule WorkloadService.Aggregates.Task do
|
||||
application_id: e.application_id,
|
||||
task_info: e.task_info,
|
||||
attachments: e.attachments,
|
||||
status: "created",
|
||||
version: agg.version + 1
|
||||
status: "created"
|
||||
}
|
||||
end
|
||||
|
||||
@@ -110,8 +108,7 @@ defmodule WorkloadService.Aggregates.Task do
|
||||
agg
|
||||
| submission: e.submission,
|
||||
attachments: e.attachments || [],
|
||||
status: "draft",
|
||||
version: agg.version + 1
|
||||
status: "draft"
|
||||
}
|
||||
end
|
||||
|
||||
@@ -119,8 +116,7 @@ defmodule WorkloadService.Aggregates.Task do
|
||||
def apply(%__MODULE__{} = agg, %WorkloadService.Events.SubmissionApproved{}) do
|
||||
%{
|
||||
agg
|
||||
| status: "approved",
|
||||
version: agg.version + 1
|
||||
| status: "approved"
|
||||
}
|
||||
end
|
||||
|
||||
@@ -128,8 +124,7 @@ defmodule WorkloadService.Aggregates.Task do
|
||||
def apply(%__MODULE__{} = agg, %WorkloadService.Events.TaskCompleted{}) do
|
||||
%{
|
||||
agg
|
||||
| status: "completed",
|
||||
version: agg.version + 1
|
||||
| status: "completed"
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ defmodule WorkloadService.Projections.Task do
|
||||
field(:submission, :map)
|
||||
field(:attachments, {:array, :string})
|
||||
field(:status, :string)
|
||||
field(:version, :integer, default: 1)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
@@ -41,8 +40,7 @@ defmodule WorkloadService.Projections.Task do
|
||||
:task_info,
|
||||
:submission,
|
||||
:attachments,
|
||||
:status,
|
||||
:version
|
||||
:status
|
||||
])
|
||||
|> validate_required([
|
||||
:id,
|
||||
|
||||
@@ -260,7 +260,6 @@ defmodule WorkloadServiceWeb.TaskController do
|
||||
submission: t.submission,
|
||||
attachments: t.attachments,
|
||||
status: t.status,
|
||||
version: t.version,
|
||||
created_at: t.inserted_at,
|
||||
updated_at: t.updated_at
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ defmodule WorkloadServiceWeb.Schemas.Task do
|
||||
submission: %Schema{type: :object, nullable: true},
|
||||
attachments: %Schema{type: :array, items: %Schema{type: :string}},
|
||||
status: %Schema{type: :string, enum: ["created", "draft", "approved", "completed"]},
|
||||
version: %Schema{type: :integer},
|
||||
created_at: %Schema{type: :string, format: :"date-time"},
|
||||
updated_at: %Schema{type: :string, format: :"date-time"}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ defmodule WorkloadService.Repo.Migrations.CreateTasks do
|
||||
add(:submission, :map)
|
||||
add(:attachments, {:array, :string}, default: [])
|
||||
add(:status, :string, null: false, default: "created")
|
||||
add(:version, :integer, default: 1)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user