Skip to content

Commit

Permalink
chore: fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Demwunz committed Dec 29, 2023
2 parents 36f2ca2 + 0389a3a commit 656d6a4
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 4 deletions.
28 changes: 24 additions & 4 deletions app/controllers/return-requirements.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,28 @@ async function saveDescription (request, h) {
})
}

async function selectPoints (request, h) {
const { sessionId } = request.params

const session = await SessionModel.query().findById(sessionId)

return h.view('return-requirements/points.njk', {
activeNavBar: 'search',
...session
})
}

async function saveReturnsCycle (request, h) {
const { sessionId } = request.params

const session = await SessionModel.query().findById(sessionId)

return h.view('return-requirements/returns-cycle.njk', {
activeNavBar: 'search',
...session
})
}

async function returnsFrequency (request, h) {
const { sessionId } = request.params

Expand Down Expand Up @@ -205,19 +227,17 @@ module.exports = {
returnsCheckYourAnswers,
returnsSettings,
returnsHowDoYouWant,
<<<<<<< HEAD
saveDescription,
||||||| 3a7a60b
=======
returnsFrequency,
>>>>>>> origin/main
saveNoReturnsCheckYourAnswers,
saveNoReturnsRequired,
saveNote,
selectPurpose,
saveReasonNewRequirements,
saveReturnsCheckYourAnswers,
saveReturnsCycle,
saveReturnsHowDoYouWant,
saveReturnStartDate,
selectPoints,
selectReturnStartDate
}
24 changes: 24 additions & 0 deletions app/routes/return-requirement.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,30 @@ const routes = [
},
description: 'Returns add a desciption page'
}
}, {
method: 'GET',
path: '/return-requirements/{sessionId}/points',
handler: ReturnRequirementsController.selectPoints,
options: {
auth: {
access: {
scope: ['billing']
}
},
description: 'Returns select points page'
}
}, {
method: 'GET',
path: '/return-requirements/{sessionId}/returns-cycle',
handler: ReturnRequirementsController.saveReturnsCycle,
options: {
auth: {
access: {
scope: ['billing']
}
},
description: 'Returns Select the returns cycle page'
}
}, {
method: 'GET',
path: '/return-requirements/{sessionId}/frequency',
Expand Down
29 changes: 29 additions & 0 deletions app/views/return-requirements/points.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% extends 'layout.njk' %}
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{% set title = "Select the points for the return requirement" %}
{% set rootLink = "/system/return-requirements/" + id %}

{% block breadcrumbs %}
{# Back link #}
{{
govukBackLink({
text: 'Back',
href: rootLink + "/purpose"
})
}}
{% endblock %}

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

<form method="post">
<div class="govuk-body">
{{ govukButton({ text: "Continue" }) }}
</div>
</form>
{% endblock %}
29 changes: 29 additions & 0 deletions app/views/return-requirements/returns-cycle.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% extends 'layout.njk' %}
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{% set title = "Select the returns cycle for the return requirement" %}
{% set rootLink = "/system/return-requirements/" + id %}

{% block breadcrumbs %}
{# Back link #}
{{
govukBackLink({
text: 'Back',
href: rootLink + "/time-limit"
})
}}
{% endblock %}

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

<form method="post">
<div class="govuk-body">
{{ govukButton({ text: "Continue" }) }}
</div>
</form>
{% endblock %}
40 changes: 40 additions & 0 deletions test/controllers/return-requirements.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,46 @@ describe('Return requirements controller', () => {
})
})

describe('GET /return-requirements/{sessionId}/points', () => {
const options = {
method: 'GET',
url: '/return-requirements/64924759-8142-4a08-9d1e-1e902cd9d316/points',
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('Select the points for the return requirement')
})
})
})

describe('GET /return-requirements/{sessionId}/returns-cycle', () => {
const options = {
method: 'GET',
url: '/return-requirements/64924759-8142-4a08-9d1e-1e902cd9d316/returns-cycle',
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('Select the returns cycle for the return requirement')
})
})
})

describe('GET /return-requirements/{sessionId}/frequency', () => {
const options = {
method: 'GET',
Expand Down

0 comments on commit 656d6a4

Please sign in to comment.