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,
|
:task_info,
|
||||||
:submission,
|
:submission,
|
||||||
:attachments,
|
:attachments,
|
||||||
:status,
|
:status
|
||||||
:version
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@impl Aggregate
|
@impl Aggregate
|
||||||
@@ -99,8 +98,7 @@ defmodule WorkloadService.Aggregates.Task do
|
|||||||
application_id: e.application_id,
|
application_id: e.application_id,
|
||||||
task_info: e.task_info,
|
task_info: e.task_info,
|
||||||
attachments: e.attachments,
|
attachments: e.attachments,
|
||||||
status: "created",
|
status: "created"
|
||||||
version: agg.version + 1
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -110,8 +108,7 @@ defmodule WorkloadService.Aggregates.Task do
|
|||||||
agg
|
agg
|
||||||
| submission: e.submission,
|
| submission: e.submission,
|
||||||
attachments: e.attachments || [],
|
attachments: e.attachments || [],
|
||||||
status: "draft",
|
status: "draft"
|
||||||
version: agg.version + 1
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -119,8 +116,7 @@ defmodule WorkloadService.Aggregates.Task do
|
|||||||
def apply(%__MODULE__{} = agg, %WorkloadService.Events.SubmissionApproved{}) do
|
def apply(%__MODULE__{} = agg, %WorkloadService.Events.SubmissionApproved{}) do
|
||||||
%{
|
%{
|
||||||
agg
|
agg
|
||||||
| status: "approved",
|
| status: "approved"
|
||||||
version: agg.version + 1
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -128,8 +124,7 @@ defmodule WorkloadService.Aggregates.Task do
|
|||||||
def apply(%__MODULE__{} = agg, %WorkloadService.Events.TaskCompleted{}) do
|
def apply(%__MODULE__{} = agg, %WorkloadService.Events.TaskCompleted{}) do
|
||||||
%{
|
%{
|
||||||
agg
|
agg
|
||||||
| status: "completed",
|
| status: "completed"
|
||||||
version: agg.version + 1
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ defmodule WorkloadService.Projections.Task do
|
|||||||
field(:submission, :map)
|
field(:submission, :map)
|
||||||
field(:attachments, {:array, :string})
|
field(:attachments, {:array, :string})
|
||||||
field(:status, :string)
|
field(:status, :string)
|
||||||
field(:version, :integer, default: 1)
|
|
||||||
|
|
||||||
timestamps(type: :utc_datetime)
|
timestamps(type: :utc_datetime)
|
||||||
end
|
end
|
||||||
@@ -41,8 +40,7 @@ defmodule WorkloadService.Projections.Task do
|
|||||||
:task_info,
|
:task_info,
|
||||||
:submission,
|
:submission,
|
||||||
:attachments,
|
:attachments,
|
||||||
:status,
|
:status
|
||||||
:version
|
|
||||||
])
|
])
|
||||||
|> validate_required([
|
|> validate_required([
|
||||||
:id,
|
:id,
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ defmodule WorkloadServiceWeb.TaskController do
|
|||||||
submission: t.submission,
|
submission: t.submission,
|
||||||
attachments: t.attachments,
|
attachments: t.attachments,
|
||||||
status: t.status,
|
status: t.status,
|
||||||
version: t.version,
|
|
||||||
created_at: t.inserted_at,
|
created_at: t.inserted_at,
|
||||||
updated_at: t.updated_at
|
updated_at: t.updated_at
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ defmodule WorkloadServiceWeb.Schemas.Task do
|
|||||||
submission: %Schema{type: :object, nullable: true},
|
submission: %Schema{type: :object, nullable: true},
|
||||||
attachments: %Schema{type: :array, items: %Schema{type: :string}},
|
attachments: %Schema{type: :array, items: %Schema{type: :string}},
|
||||||
status: %Schema{type: :string, enum: ["created", "draft", "approved", "completed"]},
|
status: %Schema{type: :string, enum: ["created", "draft", "approved", "completed"]},
|
||||||
version: %Schema{type: :integer},
|
|
||||||
created_at: %Schema{type: :string, format: :"date-time"},
|
created_at: %Schema{type: :string, format: :"date-time"},
|
||||||
updated_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(:submission, :map)
|
||||||
add(:attachments, {:array, :string}, default: [])
|
add(:attachments, {:array, :string}, default: [])
|
||||||
add(:status, :string, null: false, default: "created")
|
add(:status, :string, null: false, default: "created")
|
||||||
add(:version, :integer, default: 1)
|
|
||||||
|
|
||||||
timestamps(type: :utc_datetime)
|
timestamps(type: :utc_datetime)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user