2025-01-13 20:38:47 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2025-01-13 21:37:02 +01:00
|
|
|
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
2024-12-08 13:02:08 +00:00
|
|
|
|
2024-12-28 18:37:47 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-12-08 14:00:53 +01:00
|
|
|
require 'swagger_helper'
|
|
|
|
|
2024-12-28 18:07:22 +01:00
|
|
|
RSpec.describe 'tables_arrangements' do
|
2024-12-08 14:00:53 +01:00
|
|
|
path '/{slug}/tables_arrangements' do
|
|
|
|
get('list tables arrangements') do
|
|
|
|
tags 'Tables Arrangements'
|
|
|
|
produces 'application/json'
|
|
|
|
parameter Swagger::Schema::SLUG
|
|
|
|
response(200, 'successful') do
|
|
|
|
schema type: :array,
|
|
|
|
items: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[id name discomfort],
|
|
|
|
properties: {
|
|
|
|
id: { type: :string, format: :uuid },
|
|
|
|
name: { type: :string },
|
|
|
|
discomfort: { type: :integer }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xit
|
|
|
|
end
|
|
|
|
regular_api_responses
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
path '/{slug}/tables_arrangements/{id}' do
|
|
|
|
get('show tables arrangement') do
|
|
|
|
tags 'Tables Arrangements'
|
|
|
|
produces 'application/json'
|
|
|
|
parameter Swagger::Schema::SLUG
|
|
|
|
parameter Swagger::Schema::ID
|
|
|
|
response(200, 'successful') do
|
2024-12-16 18:52:34 +01:00
|
|
|
schema type: :object,
|
|
|
|
required: %i[id tables],
|
|
|
|
properties: {
|
|
|
|
id: { type: :string, format: :uuid },
|
|
|
|
tables: {
|
|
|
|
|
|
|
|
type: :array,
|
|
|
|
items: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[number guests discomfort],
|
|
|
|
properties: {
|
|
|
|
number: { type: :integer },
|
|
|
|
guests: {
|
|
|
|
type: :array,
|
|
|
|
items: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[id name color],
|
|
|
|
properties: {
|
|
|
|
id: { type: :string, format: :uuid },
|
|
|
|
name: { type: :string },
|
|
|
|
color: { type: :string }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
discomfort: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[discomfort breakdown],
|
|
|
|
properties: {
|
|
|
|
discomfort: { type: :number },
|
|
|
|
breakdown: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[table_size_penalty cohesion_penalty],
|
|
|
|
properties: {
|
|
|
|
table_size_penalty: { type: :number },
|
|
|
|
cohesion_penalty: { type: :number }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-12-08 14:00:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xit
|
|
|
|
end
|
|
|
|
regular_api_responses
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|