Skip to content

Commit

Permalink
Update controller to use the new Submit service
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruikshanks committed Apr 23, 2024
1 parent 35ab66e commit 11aeedc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/controllers/bill-runs.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const ReviewLicenceService = require('../services/bill-runs/two-part-tariff/revi
const SendBillRunService = require('../services/bill-runs/send-bill-run.service.js')
const StartBillRunProcessService = require('../services/bill-runs/start-bill-run-process.service.js')
const SubmitCancelBillRunService = require('../services/bill-runs/submit-cancel-bill-run.service.js')
const SubmitReviewLicenceService = require('../services/bill-runs/two-part-tariff/submit-review-licence.service.js')
const SubmitSendBillRunService = require('../services/bill-runs/submit-send-bill-run.service.js')
const ViewBillRunService = require('../services/bill-runs/view-bill-run.service.js')

Expand Down Expand Up @@ -123,7 +124,7 @@ async function submitCancel (request, h) {
async function submitReviewLicence (request, h) {
const { id: billRunId, licenceId } = request.params

const pageData = await ReviewLicenceService.go(billRunId, licenceId, request.payload)
const pageData = await SubmitReviewLicenceService.go(billRunId, licenceId, request.payload)

return h.view('bill-runs/review-licence.njk', {
pageTitle: `Licence ${pageData.licence.licenceRef}`,
Expand Down
5 changes: 3 additions & 2 deletions test/controllers/bill-runs.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ const { expect } = Code
const Boom = require('@hapi/boom')
const CancelBillRunService = require('../../app/services/bill-runs/cancel-bill-run.service.js')
const IndexBillRunsService = require('../../app/services/bill-runs/index-bill-runs.service.js')
const ReviewLicenceService = require('../../app/services/bill-runs/two-part-tariff/review-licence.service.js')
const ReviewBillRunService = require('../../app/services/bill-runs/two-part-tariff/review-bill-run.service.js')
const ReviewLicenceService = require('../../app/services/bill-runs/two-part-tariff/review-licence.service.js')
const SendBillRunService = require('../../app/services/bill-runs/send-bill-run.service.js')
const StartBillRunProcessService = require('../../app/services/bill-runs/start-bill-run-process.service.js')
const SubmitCancelBillRunService = require('../../app/services/bill-runs/submit-cancel-bill-run.service.js')
const SubmitReviewLicenceService = require('../../app/services/bill-runs/two-part-tariff/submit-review-licence.service.js')
const SubmitSendBillRunService = require('../../app/services/bill-runs/submit-send-bill-run.service.js')
const ViewBillRunService = require('../../app/services/bill-runs/view-bill-run.service.js')
const MatchDetailsService = require('../../app/services/bill-runs/two-part-tariff/match-details.service.js')
Expand Down Expand Up @@ -371,7 +372,7 @@ describe('Bill Runs controller', () => {

describe('when a request is valid', () => {
beforeEach(() => {
Sinon.stub(ReviewLicenceService, 'go').resolves(_licenceReviewData())
Sinon.stub(SubmitReviewLicenceService, 'go').resolves(_licenceReviewData())
})

it('returns a 200 response', async () => {
Expand Down

0 comments on commit 11aeedc

Please sign in to comment.