Free allowance rates for 2022

Update the map for determine the free allowance (aka: free sms fragments) for services.
This commit is contained in:
Rebecca Law
2022-03-14 09:56:09 +00:00
parent 907e270b2e
commit 8402e7c97b
2 changed files with 16 additions and 3 deletions

View File

@@ -58,34 +58,42 @@ def set_default_free_allowance_for_service(service, year_start=None):
'central': { 'central': {
2020: 250_000, 2020: 250_000,
2021: 150_000, 2021: 150_000,
2022: 40_000,
}, },
'local': { 'local': {
2020: 25_000, 2020: 25_000,
2021: 25_000, 2021: 25_000,
2022: 20_000,
}, },
'nhs_central': { 'nhs_central': {
2020: 250_000, 2020: 250_000,
2021: 150_000, 2021: 150_000,
2022: 40_000,
}, },
'nhs_local': { 'nhs_local': {
2020: 25_000, 2020: 25_000,
2021: 25_000, 2021: 25_000,
2022: 20_000,
}, },
'nhs_gp': { 'nhs_gp': {
2020: 25_000, 2020: 25_000,
2021: 10_000, 2021: 10_000,
2022: 10_000,
}, },
'emergency_service': { 'emergency_service': {
2020: 25_000, 2020: 25_000,
2021: 25_000, 2021: 25_000,
2022: 20_000,
}, },
'school_or_college': { 'school_or_college': {
2020: 25_000, 2020: 25_000,
2021: 10_000, 2021: 10_000,
2022: 10_000,
}, },
'other': { 'other': {
2020: 25_000, 2020: 25_000,
2021: 10_000, 2021: 10_000,
2022: 10_000,
}, },
} }
if not year_start: if not year_start:
@@ -93,8 +101,8 @@ def set_default_free_allowance_for_service(service, year_start=None):
# handle cases where the year is less than 2020 or greater than 2021 # handle cases where the year is less than 2020 or greater than 2021
if year_start < 2020: if year_start < 2020:
year_start = 2020 year_start = 2020
if year_start > 2021: if year_start > 2022:
year_start = 2021 year_start = 2022
if service.organisation_type: if service.organisation_type:
free_allowance = default_free_sms_fragment_limits[service.organisation_type][year_start] free_allowance = default_free_sms_fragment_limits[service.organisation_type][year_start]
else: else:

View File

@@ -66,7 +66,12 @@ def test_dao_update_annual_billing_for_future_years(notify_db_session, sample_se
('other', 2020, 25000), ('other', 2020, 25000),
(None, 2020, 25000), (None, 2020, 25000),
('central', 2019, 250000), ('central', 2019, 250000),
('school_or_college', 2022, 10000) ('school_or_college', 2022, 10000),
('central', 2022, 40000),
('local', 2022, 20000),
('nhs_local', 2022, 20000),
('emergency_service', 2022, 20000),
('central', 2023, 40000),
]) ])
def test_set_default_free_allowance_for_service(notify_db_session, org_type, year, expected_default): def test_set_default_free_allowance_for_service(notify_db_session, org_type, year, expected_default):