remove version
All checks were successful
Build and Publish / build-release (push) Successful in 1m23s

This commit is contained in:
2026-04-17 11:52:55 -05:00
parent 1152b78f3e
commit 1e493840de
5 changed files with 6 additions and 16 deletions

View File

@@ -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

View File

@@ -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,

View File

@@ -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
}

View File

@@ -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"}
}

View File

@@ -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