Skip to content

Commit

Permalink
Add check your answers page (return requirements) (#579)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4250

We are starting work on adding support for setting up return requirements within the service. A return requirement sets out how a licensee is expected to submit their returns, for example, daily, weekly or monthly, by what date, and using what unit of measure.

This is the third page in the return requirements setup journey when 'no returns required' is selected.

This is just a stub page and controls and validation will come later.
  • Loading branch information
robertparkinson authored and Beckyrose200 committed Dec 14, 2023
1 parent efac64f commit dfb3246
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
10 changes: 10 additions & 0 deletions app/controllers/licences.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ async function requirementsApproved (request, h) {
})
}

async function noReturnsCheckYourAnswers (request, h) {
const { id } = request.params

return h.view('return-requirements/no-return-check-your-answers.njk', {
activeNavBar: 'search',
licenceId: id
})
}

module.exports = {
noReturnsCheckYourAnswers,
noReturnsRequired,
requirementsApproved,
selectReturnStartDate
Expand Down
15 changes: 13 additions & 2 deletions app/routes/licence.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@ const routes = [
},
description: 'Select the start date of the return'
}
},
{
}, {
method: 'GET',
path: '/licences/{id}/no-return-check-your-answers',
handler: LicencesController.noReturnsCheckYourAnswers,
options: {
auth: {
access: {
scope: ['billing']
}
},
description: 'No return check your answers page'
}
}, {
method: 'GET',
path: '/licences/{id}/requirements-approved',
handler: LicencesController.requirementsApproved,
Expand Down
25 changes: 25 additions & 0 deletions app/views/return-requirements/no-return-check-your-answers.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends 'layout.njk' %}
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{% set rootLink = "/licences/" + licenceId %}
{% block breadcrumbs %}
{# Back link #}
{{
govukBackLink({
text: 'back',
href: rootLink + "/select-return-start-date"
})
}}
{% endblock %}

{% block content %}
{# Main heading #}
<div class="govuk-body">
<h1 class="govuk-heading-xl govuk-!-margin-bottom-3">Check your answers</h1>
</div>

<div class="govuk-body">
{{ govukButton({ text: "Approve returns requirements" }) }}
</div>
{% endblock %}
3 changes: 2 additions & 1 deletion app/views/return-requirements/select-return-start-date.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{% set rootLink = "/licences/" + licenceId %}
{% block breadcrumbs %}
{# Back link #}
{{
govukBackLink({
text: 'back',
href: "/licences/{{ licenceId }}/no-returns-required"
href: rootLink + "/no-returns-required"
})
}}
{% endblock %}
Expand Down
20 changes: 20 additions & 0 deletions test/controllers/licences.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,24 @@ describe('Licences controller', () => {
})
})
})

describe('GET /licences/{id}/no-return-check-your-answers', () => {
const options = {
method: 'GET',
url: '/licences/64924759-8142-4a08-9d1e-1e902cd9d316/no-return-check-your-answers',
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('Check your answers')
})
})
})
})

0 comments on commit dfb3246

Please sign in to comment.