fix swagger violations

This commit is contained in:
Philipp Rothmann 2022-12-01 17:57:02 +01:00
parent 92e8a060da
commit 3c00461f1d
2 changed files with 33 additions and 27 deletions

View File

@ -52,35 +52,42 @@ describe 'User', type: :request do
get 'financial summary about the currently logged-in user' do
tags 'User', 'FinancialTransaction'
produces 'application/json'
let!(:user) { create :user, :ordergroup }
let(:user) { create :user, :ordergroup }
FinancialTransactionClass.create(name: 'TestTransaction')
response 200, 'success' do
schema type: :object,
properties: {
account_balance: {
type: :number,
description: 'booked accout balance of ordergroup'
},
available_funds: {
type: :number,
description: 'fund available to order articles'
},
financial_transaction_class_sums: {
financial_overview: {
type: :object,
properties: {
id: {
type: :integer,
description: 'id of the financial transaction class'
},
name: {
type: :string,
description: 'name of the financial transaction class'
},
amount: {
account_balance: {
type: :number,
description: 'sum of the amounts belonging to the financial transaction class'
description: 'booked accout balance of ordergroup'
},
required: %w[id name amount]
available_funds: {
type: :number,
description: 'fund available to order articles'
},
financial_transaction_class_sums: {
type: :array,
properties: {
id: {
type: :integer,
description: 'id of the financial transaction class'
},
name: {
type: :string,
description: 'name of the financial transaction class'
},
amount: {
type: :number,
description: 'sum of the amounts belonging to the financial transaction class'
}
},
required: %w[id name amount]
}
},
required: %w[account_balance available_funds financial_transaction_class_sums]
}

View File

@ -93,7 +93,8 @@ RSpec.configure do |config|
description: 'id of order this order article belongs to'
},
price: {
type: :float,
type: :number,
format: :float,
description: 'foodcoop price'
},
quantity: {
@ -146,12 +147,10 @@ RSpec.configure do |config|
},
user_id: {
type: :integer,
required: false,
description: 'id of user who entered the transaction (may be <tt>null</tt> for deleted users or 0 for a system user)'
},
user_name: {
type: :string,
required: false,
description: 'name of user who entered the transaction (may be <tt>null</tt> or empty string for deleted users or system users)'
},
financial_transaction_type_name: {
@ -227,9 +226,9 @@ RSpec.configure do |config|
total_count: {
type: :integer,
description: 'total number of items in the collection'
},
required: %w[page per_page total_pages total_count]
}
}
},
required: %w[page per_page total_pages total_count]
},
Navigation: {
type: :array,