Persist and expose via API the progress of the tables arrangement simulations #316

Open
bustikiller wants to merge 5 commits from arrangements-status into main
2 changed files with 4 additions and 3 deletions
Showing only changes of commit dd14a96e98 - Show all commits

View File

@ -9,10 +9,10 @@ class TablesArrangementsController < ApplicationController
render json: TablesArrangement render json: TablesArrangement
.order(valid: :desc) .order(valid: :desc)
.order(discomfort: :asc) .order(discomfort: :asc)
.select(:id, :name, :discomfort) .select(:id, :name, :discomfort, :status)
.select("digest = '#{current_digest}'::uuid as valid") .select("digest = '#{current_digest}'::uuid as valid")
.limit(20) .limit(20)
.as_json(only: %i[id name discomfort valid]) .as_json(only: %i[id name discomfort valid status])
end end
def show def show

View File

@ -19,7 +19,8 @@ RSpec.describe 'tables_arrangements' do
id: { type: :string, format: :uuid }, id: { type: :string, format: :uuid },
name: { type: :string }, name: { type: :string },
discomfort: { type: :integer }, discomfort: { type: :integer },
valid: { type: :boolean } valid: { type: :boolean },
status: { type: :string, enum: %w[complete in_progress] }
} }
} }
xit xit