28_introduce_rswag #35

Merged
philipp merged 46 commits from 28_introduce_rswag into develop 2023-01-05 13:45:47 +01:00
2 changed files with 33 additions and 27 deletions
Showing only changes of commit 3c00461f1d - Show all commits

View file

@ -52,35 +52,42 @@ 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: {
account_balance: { financial_overview: {
type: :number,
description: 'booked accout balance of ordergroup'
},
available_funds: {
type: :number,
description: 'fund available to order articles'
},
financial_transaction_class_sums: {
type: :object, type: :object,
properties: { properties: {
id: {
type: :integer, account_balance: {
description: 'id of the financial transaction class'
},
name: {
type: :string,
description: 'name of the financial transaction class'
},
amount: {
type: :number, 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] 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' 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,