28_introduce_rswag #35
2 changed files with 33 additions and 27 deletions
|
@ -52,11 +52,16 @@ 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: {
|
||||
financial_overview: {
|
||||
type: :object,
|
||||
properties: {
|
||||
|
||||
account_balance: {
|
||||
type: :number,
|
||||
description: 'booked accout balance of ordergroup'
|
||||
|
@ -66,7 +71,7 @@ describe 'User', type: :request do
|
|||
description: 'fund available to order articles'
|
||||
},
|
||||
financial_transaction_class_sums: {
|
||||
type: :object,
|
||||
type: :array,
|
||||
properties: {
|
||||
id: {
|
||||
type: :integer,
|
||||
|
@ -79,8 +84,10 @@ describe 'User', type: :request do
|
|||
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]
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
}
|
||||
},
|
||||
Navigation: {
|
||||
type: :array,
|
||||
|
|
Loading…
Reference in a new issue