diff --git a/app/controllers/licences.controller.js b/app/controllers/licences.controller.js index 5649406707..698070e2ff 100644 --- a/app/controllers/licences.controller.js +++ b/app/controllers/licences.controller.js @@ -23,7 +23,17 @@ async function selectReturnStartDate (request, h) { }) } +async function requirementsApproved (request, h) { + const { id } = request.params + + return h.view('return-requirements/requirements-approved.njk', { + activeNavBar: 'search', + licenceId: id + }) +} + module.exports = { noReturnsRequired, + requirementsApproved, selectReturnStartDate } diff --git a/app/routes/licence.routes.js b/app/routes/licence.routes.js index 3f1fabd64f..a56a24b5f0 100644 --- a/app/routes/licence.routes.js +++ b/app/routes/licence.routes.js @@ -27,6 +27,19 @@ const routes = [ }, description: 'Select the start date of the return' } + }, + { + method: 'GET', + path: '/licences/{id}/requirements-approved', + handler: LicencesController.requirementsApproved, + options: { + auth: { + access: { + scope: ['billing'] + } + }, + description: 'Returns requirements approved' + } } ] diff --git a/app/views/return-requirements/requirements-approved.njk b/app/views/return-requirements/requirements-approved.njk new file mode 100644 index 0000000000..8709b0351f --- /dev/null +++ b/app/views/return-requirements/requirements-approved.njk @@ -0,0 +1,25 @@ +{% extends 'layout.njk' %} +{% from "govuk/components/back-link/macro.njk" import govukBackLink %} +{% from "govuk/components/panel/macro.njk" import govukPanel %} + +{% set rootLink = "/licences/" + licenceId %} +{% block breadcrumbs %} + {# Back link #} + {{ + govukBackLink({ + text: 'back', + href: rootLink + "/no-return-check-your-answers" + }) + }} +{% endblock %} + +{% block content %} + {{ govukPanel({ + titleText: "Returns requirements approved", + classes: "govuk-!-margin-bottom-4" + }) }} + +

What happens next

+

These return requirements are now active and returns will be opened for this licence in the next returns cycle.

+

Return to licence set up

+{% endblock %} diff --git a/test/controllers/licences.controller.test.js b/test/controllers/licences.controller.test.js index a18e9d9f68..a0cbebec8c 100644 --- a/test/controllers/licences.controller.test.js +++ b/test/controllers/licences.controller.test.js @@ -71,4 +71,24 @@ describe('Licences controller', () => { }) }) }) + + describe('GET /licences/{id}/requirements-approved', () => { + const options = { + method: 'GET', + url: '/licences/64924759-8142-4a08-9d1e-1e902cd9d316/requirements-approved', + auth: { + strategy: 'session', + credentials: { scope: ['billing'] } + } + } + + describe('when the request succeeds', () => { + it('returns the page successfully', async () => { + const response = await server.inject(options) + + expect(response.statusCode).to.equal(200) + expect(response.payload).to.contain('Returns requirements approved') + }) + }) + }) })