diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 611def786..f0cc167c3 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -1210,6 +1210,12 @@ def edit_service_notes(service_id): ) +@main.route("/services//edit-billing-details", methods=['GET', 'POST']) +@user_is_platform_admin +def edit_service_billing_details(service_id): + pass + + def get_branding_as_value_and_label(email_branding): return [ (branding['id'], branding['name']) diff --git a/app/navigation.py b/app/navigation.py index 3537fb7d3..e7b866e37 100644 --- a/app/navigation.py +++ b/app/navigation.py @@ -190,6 +190,7 @@ class HeaderNavigation(Navigation): 'edit_organisation_name', 'edit_organisation_type', 'edit_provider', + 'edit_service_billing_details', 'edit_service_notes', 'edit_service_template', 'edit_template_postage', @@ -583,6 +584,7 @@ class MainNavigation(Navigation): 'edit_organisation_name', 'edit_organisation_type', 'edit_provider', + 'edit_service_billing_details', 'edit_service_notes', 'edit_sms_provider_ratio', 'edit_user_org_permissions', @@ -837,6 +839,7 @@ class CaseworkNavigation(Navigation): 'edit_organisation_name', 'edit_organisation_type', 'edit_provider', + 'edit_service_billing_details', 'edit_service_notes', 'edit_sms_provider_ratio', 'edit_service_template', @@ -1161,6 +1164,7 @@ class OrgNavigation(Navigation): 'download_notifications_csv', 'edit_data_retention', 'edit_provider', + 'edit_service_billing_details', 'edit_service_notes', 'edit_service_template', 'edit_sms_provider_ratio', diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index d03d7c6bc..9ec635c4b 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -338,7 +338,7 @@ {% call row() %} {{ text_field('Billing details')}} {{ optional_text_field(current_service.billing_details, default="No billing details yet", wrap=True) }} - {{ edit_field('Change', url_for('.service_settings', service_id=current_service.id), suffix='billing details for service') }} + {{ edit_field('Change', url_for('.edit_service_billing_details', service_id=current_service.id), suffix='billing details for service') }} {% endcall %} {% call row() %} diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index cfc88709b..a4eeeb6ea 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -5283,3 +5283,20 @@ def test_update_service_notes( 'main.service_settings', service_id=SERVICE_ONE_ID, _external=True) assert settings_url == response.location mock_update_service.assert_called_with(SERVICE_ONE_ID, notes="Very fluffy") + + +def test_service_settings_links_to_edit_service_billing_details_page_for_platform_admins( + mocker, + service_one, + platform_admin_client, + no_reply_to_email_addresses, + no_letter_contact_blocks, + single_sms_sender, + mock_get_service_settings_page_common, + mock_get_organisation, +): + response = platform_admin_client.get(url_for( + '.service_settings', service_id=SERVICE_ONE_ID + )) + page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') + assert len(page.find_all('a', attrs={'href': '/services/{}/edit-billing-details'.format(SERVICE_ONE_ID)})) == 1