Add admin interface to enable the self service functionality

This commit is contained in:
Patrick Gansterer 2021-02-18 12:38:07 +01:00
parent e6061e6760
commit 00f1dddd3d
5 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,7 @@
= config_input_field form, :minimum_balance, as: :decimal, class: 'input-small'
= config_input form, :charge_members_manually, as: :boolean
= config_input form, :use_iban, as: :boolean
= config_input form, :use_self_service, as: :boolean
%h4= t '.schedule_title'
= form.simple_fields_for :order_schedule do |fields|

View File

@ -602,6 +602,7 @@ de:
use_boxfill: Wenn aktiviert, können Benutzer nahe am Ende der Bestellung diese nur mehr so verändern, dass sich die Gesamtsumme erhöht. Dies hilft beim auffüllen der verbleibenden Kisten. Es muss trotzdem noch das Kistenauffülldatum bei der Bestellung gesetzt werden.
use_iban: Zusätzlich Feld für die internationale Kontonummer bei Benutzern und Lieferanten anzeigen
use_nick: Benutzernamen anstatt reale Namen zeigen und verwenden, jeder Benutzer muss dazu einen Benutzernamen (Spitznamen) haben.
use_self_service: Wenn aktiviert, können Benutzer_innen selbständig dafür freigegebene Abrechungsfunktionen nutzen.
webstats_tracking_code: Tracking Code für Webseitenanalyse (wie Piwik oder Google Analytics), leer lassen wenn keine Analyse erfolgt
keys:
applepear_url: Hilfe URL für das Äpfel Punktesystem zum Engagement
@ -659,6 +660,7 @@ de:
use_boxfill: Kistenauffüllphase
use_iban: IBAN verwenden
use_nick: Benutzernamen verwenden
use_self_service: Selbstbedienung verwenden
webstats_tracking_code: Code für Websiteanalysetool
tabs:
applications: Apps

View File

@ -603,6 +603,7 @@ en:
use_boxfill: When enabled, near end of an order, members are only able to change their order when increases the total amount ordered. This helps to fill any remaining boxes. You still need to set a box-fill date for the orders.
use_iban: When enabled, supplier and user provide an additonal field for storing the international bank account number.
use_nick: Show and use nicknames instead of real names. When enabling this, please check that each user has a nickname.
use_self_service: When enabled, members are able to use selected balancing functions on their own.
webstats_tracking_code: Tracking code for web analytics (like Piwik or Google analytics). Leave empty for no tracking.
keys:
applepear_url: Apple system help URL
@ -660,6 +661,7 @@ en:
use_boxfill: Box-fill phase
use_iban: Use IBAN
use_nick: Use nicknames
use_self_service: Use self service
webstats_tracking_code: Tracking code
tabs:
applications: Apps

View File

@ -90,7 +90,7 @@ paths:
security:
- foodsoft_auth: ['finance:user']
post:
summary: create new financial transaction
summary: create new financial transaction (requires enabled self service)
tags:
- 1. User
- 6. FinancialTransaction
@ -114,7 +114,7 @@ paths:
schema:
$ref: '#/definitions/Error401'
403:
description: user has no ordergroup, is below minimum balance, or missing scope
description: user has no ordergroup, is below minimum balance, self service is disabled, or missing scope
schema:
$ref: '#/definitions/Error403'
404:

View File

@ -50,7 +50,6 @@ describe 'API v1', type: :apivore, order: :defined do
let(:create_params) { {'_data' => {financial_transaction: {amount: 1, financial_transaction_type_id: ft_1.financial_transaction_type.id, note: 'note'}}} }
context 'without using self service' do
it { is_expected.to validate(:post, '/user/financial_transactions', 403, api_auth(create_params)) }
end