Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking 2PT SROC review page #504

Merged
merged 9 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/controllers/bill-runs.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ async function create (request, h) {
}
}

async function review (request, h) {
return h.view('bill-runs/view.njk', {
pageTitle: 'Review Two Part Tariff SROC',
activeNavBar: 'bill-runs'
})
}

/**
* Takes an error from a validator and returns a suitable Boom error
*/
Expand All @@ -42,5 +49,6 @@ function _formattedInitiateBillRunError (error) {
}

module.exports = {
create
create,
review
}
13 changes: 13 additions & 0 deletions app/routes/bill-runs.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ const routes = [
},
description: 'Used to create a bill run'
}
},
{
method: 'GET',
path: '/bill-runs/{id}/review',
handler: BillRunsController.review,
options: {
auth: {
access: {
scope: ['billing']
}
},
description: 'Review two-part tariff match and allocation results'
}
}
]

Expand Down
8 changes: 8 additions & 0 deletions app/views/bill-runs/view.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% block content %}
{# Main heading #}
<div class="govuk-body">
<h1 class="govuk-heading-xl govuk-!-margin-bottom-3">
<iframe src="https://giphy.com/embed/vmv47p4zksWDC" width="480" height="261" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p><a href="https://giphy.com/gifs/alive-vmv47p4zksWDC"></a></p>
</h1>
</div>
{% endblock %}
23 changes: 23 additions & 0 deletions test/controllers/bill-runs.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,27 @@ describe('Bill Runs controller', () => {
})
})
})

describe('GET /bill-runs/{id}/review', () => {
let options

beforeEach(async () => {
options = {
method: 'GET',
url: '/bill-runs/97db1a27-8308-4aba-b463-8a6af2558b28/review',
auth: {
strategy: 'session',
credentials: { scope: ['billing'] }
}
}
})

describe('when a request is valid', () => {
it('returns a 200 response', async () => {
const response = await server.inject(options)

expect(response.statusCode).to.equal(200)
})
})
})
})
Loading