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
|
get 'financial summary about the currently logged-in user' do
|
||||||
tags 'User', 'FinancialTransaction'
|
tags 'User', 'FinancialTransaction'
|
||||||
produces 'application/json'
|
produces 'application/json'
|
||||||
let!(:user) { create :user, :ordergroup }
|
let(:user) { create :user, :ordergroup }
|
||||||
|
FinancialTransactionClass.create(name: 'TestTransaction')
|
||||||
|
|
||||||
response 200, 'success' do
|
response 200, 'success' do
|
||||||
schema type: :object,
|
schema type: :object,
|
||||||
properties: {
|
properties: {
|
||||||
|
financial_overview: {
|
||||||
|
type: :object,
|
||||||
|
properties: {
|
||||||
|
|
||||||
account_balance: {
|
account_balance: {
|
||||||
type: :number,
|
type: :number,
|
||||||
description: 'booked accout balance of ordergroup'
|
description: 'booked accout balance of ordergroup'
|
||||||
|
@ -66,7 +71,7 @@ describe 'User', type: :request do
|
||||||
description: 'fund available to order articles'
|
description: 'fund available to order articles'
|
||||||
},
|
},
|
||||||
financial_transaction_class_sums: {
|
financial_transaction_class_sums: {
|
||||||
type: :object,
|
type: :array,
|
||||||
properties: {
|
properties: {
|
||||||
id: {
|
id: {
|
||||||
type: :integer,
|
type: :integer,
|
||||||
|
@ -79,8 +84,10 @@ describe 'User', type: :request do
|
||||||
amount: {
|
amount: {
|
||||||
type: :number,
|
type: :number,
|
||||||
description: 'sum of the amounts belonging to the financial transaction class'
|
description: 'sum of the amounts belonging to the financial transaction class'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
required: %w[id name amount]
|
required: %w[id name amount]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
required: %w[account_balance available_funds financial_transaction_class_sums]
|
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'
|
description: 'id of order this order article belongs to'
|
||||||
},
|
},
|
||||||
price: {
|
price: {
|
||||||
type: :float,
|
type: :number,
|
||||||
|
format: :float,
|
||||||
description: 'foodcoop price'
|
description: 'foodcoop price'
|
||||||
},
|
},
|
||||||
quantity: {
|
quantity: {
|
||||||
|
@ -146,12 +147,10 @@ RSpec.configure do |config|
|
||||||
},
|
},
|
||||||
user_id: {
|
user_id: {
|
||||||
type: :integer,
|
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)'
|
description: 'id of user who entered the transaction (may be <tt>null</tt> for deleted users or 0 for a system user)'
|
||||||
},
|
},
|
||||||
user_name: {
|
user_name: {
|
||||||
type: :string,
|
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)'
|
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: {
|
financial_transaction_type_name: {
|
||||||
|
@ -227,9 +226,9 @@ RSpec.configure do |config|
|
||||||
total_count: {
|
total_count: {
|
||||||
type: :integer,
|
type: :integer,
|
||||||
description: 'total number of items in the collection'
|
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: {
|
Navigation: {
|
||||||
type: :array,
|
type: :array,
|
||||||
|
|
Loading…
Reference in a new issue