Change config structure so allowances are dated

We’re going to have different allowances next financial year. This means
that when someone adds a service, we’ll need to check which year it is,
so we can give them the right allowance.

This commit changes the config structure so that the current allowances
are explicitly assigned to the 2020/21 financial year.

It freezes the tests to the 2020/21 financial year, so they won’t start
failing automatically when next financial year comes around.
This commit is contained in:
Chris Hill-Scott
2021-03-08 14:25:26 +00:00
parent f5772328a1
commit bac54462db
3 changed files with 53 additions and 18 deletions
+12 -2
View File
@@ -6,11 +6,21 @@ from app import billing_api_client, service_api_client
from app.formatters import email_safe
from app.main import main
from app.main.forms import CreateNhsServiceForm, CreateServiceForm
from app.utils import user_is_gov_user, user_is_logged_in
from app.utils import (
get_current_financial_year,
user_is_gov_user,
user_is_logged_in,
)
def _create_service(service_name, organisation_type, email_from, form):
free_sms_fragment_limit = current_app.config['DEFAULT_FREE_SMS_FRAGMENT_LIMITS'].get(organisation_type)
free_sms_fragment_limit = current_app.config[
'DEFAULT_FREE_SMS_FRAGMENT_LIMITS'
][
organisation_type
][
get_current_financial_year()
]
try:
service_id = service_api_client.create_service(