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-11 08:03:02 +00:00
|
|
|
|
2024-12-28 18:37:47 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-12-11 09:00:45 +01:00
|
|
|
require 'swagger_helper'
|
|
|
|
|
2024-12-28 18:07:22 +01:00
|
|
|
RSpec.describe 'summary' do
|
2024-12-11 09:00:45 +01:00
|
|
|
path '/{slug}/summary' do
|
|
|
|
get('list summaries') do
|
|
|
|
tags 'Summary'
|
|
|
|
produces 'application/json'
|
|
|
|
consumes 'application/json'
|
|
|
|
parameter Swagger::Schema::SLUG
|
|
|
|
response(200, 'successful') do
|
|
|
|
schema type: :object,
|
|
|
|
required: %i[expenses guests],
|
|
|
|
properties: {
|
|
|
|
expenses: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[projected confirmed status],
|
|
|
|
properties: {
|
|
|
|
projected: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[total guests],
|
|
|
|
properties: {
|
|
|
|
total: { type: :number },
|
|
|
|
guests: { type: :number }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
confirmed: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[total guests],
|
|
|
|
properties: {
|
|
|
|
total: { type: :number },
|
|
|
|
guests: { type: :number }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
status: {
|
|
|
|
type: :object,
|
|
|
|
required: [:paid],
|
|
|
|
properties: {
|
|
|
|
paid: { type: :number }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
guests: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[total confirmed declined tentative invited],
|
|
|
|
properties: {
|
|
|
|
total: { type: :number },
|
|
|
|
confirmed: { type: :number },
|
|
|
|
declined: { type: :number },
|
|
|
|
tentative: { type: :number },
|
|
|
|
invited: { type: :number }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|