diff --git a/app/controllers/licences.controller.js b/app/controllers/licences.controller.js index 639deb98de..49f795e425 100644 --- a/app/controllers/licences.controller.js +++ b/app/controllers/licences.controller.js @@ -5,7 +5,7 @@ * @module LicencesController */ -const InitiateSessionService = require('../services/return-requirements/setup/initiate-session.service.js') +const InitiateSessionService = require('../services/return-versions/setup/initiate-session.service.js') const LicenceSupplementaryProcessBillingFlagService = require('../services/licences/supplementary/process-billing-flag.service.js') const MarkedForSupplementaryBillingService = require('../services/licences/supplementary/marked-for-supplementary-billing.service.js') const MarkForSupplementaryBillingService = require('../services/licences/supplementary/mark-for-supplementary-billing.service.js') @@ -50,7 +50,7 @@ async function noReturnsRequired (request, h) { const session = await InitiateSessionService.go(id, 'no-returns-required') - return h.redirect(`/system/return-requirements/setup/${session.id}/start-date`) + return h.redirect(`/system/return-versions/setup/${session.id}/start-date`) } async function returnsRequired (request, h) { @@ -58,7 +58,7 @@ async function returnsRequired (request, h) { const session = await InitiateSessionService.go(id, 'returns-required') - return h.redirect(`/system/return-requirements/setup/${session.id}/start-date`) + return h.redirect(`/system/return-versions/setup/${session.id}/start-date`) } async function submitMarkForSupplementaryBilling (request, h) { diff --git a/app/controllers/return-requirements.controller.js b/app/controllers/return-requirements.controller.js deleted file mode 100644 index af5694ef3c..0000000000 --- a/app/controllers/return-requirements.controller.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -/** - * Controller for /return-requirement endpoints - * @module ReturnRequirementsController - */ - -const ViewService = require('../services/return-requirements/view.service.js') - -async function view (request, h) { - const { id } = request.params - const pageData = await ViewService.go(id) - - return h.view('return-requirements/view.njk', { - ...pageData - }) -} - -module.exports = { - view -} diff --git a/app/controllers/return-requirements-setup.controller.js b/app/controllers/return-versions-setup.controller.js similarity index 53% rename from app/controllers/return-requirements-setup.controller.js rename to app/controllers/return-versions-setup.controller.js index c44e9a94b3..78fd67c209 100644 --- a/app/controllers/return-requirements-setup.controller.js +++ b/app/controllers/return-versions-setup.controller.js @@ -1,56 +1,56 @@ 'use strict' /** - * Controller for /return-requirement/setup endpoints - * @module ReturnRequirementsSetupController + * Controller for /return-versions/setup endpoints + * @module ReturnVersionsSetupController */ -const AbstractionPeriodService = require('../services/return-requirements/setup/abstraction-period.service.js') -const AddService = require('../services/return-requirements/setup/add.service.js') -const AdditionalSubmissionOptionsService = require('../services/return-requirements/setup/additional-submission-options.service.js') -const AgreementsExceptionsService = require('../services/return-requirements/setup/agreements-exceptions.service.js') -const CancelService = require('../services/return-requirements/setup/cancel.service.js') -const CheckService = require('../services/return-requirements/setup/check/check.service.js') -const DeleteNoteService = require('../services/return-requirements/setup/delete-note.service.js') -const ExistingService = require('../services/return-requirements/setup/existing.service.js') +const AbstractionPeriodService = require('../services/return-versions/setup/abstraction-period.service.js') +const AddService = require('../services/return-versions/setup/add.service.js') +const AdditionalSubmissionOptionsService = require('../services/return-versions/setup/additional-submission-options.service.js') +const AgreementsExceptionsService = require('../services/return-versions/setup/agreements-exceptions.service.js') +const CancelService = require('../services/return-versions/setup/cancel.service.js') +const CheckService = require('../services/return-versions/setup/check/check.service.js') +const DeleteNoteService = require('../services/return-versions/setup/delete-note.service.js') +const ExistingService = require('../services/return-versions/setup/existing.service.js') const FeatureFlagsConfig = require('../../config/feature-flags.config.js') -const FrequencyCollectedService = require('../services/return-requirements/setup/frequency-collected.service.js') -const FrequencyReportedService = require('../services/return-requirements/setup/frequency-reported.service.js') -const MethodService = require('../services/return-requirements/setup/method/method.service.js') -const NoReturnsRequiredService = require('../services/return-requirements/setup/no-returns-required.service.js') -const NoteService = require('../services/return-requirements/setup/note.service.js') -const PointsService = require('../services/return-requirements/setup/points.service.js') -const RemoveService = require('../services/return-requirements/setup/remove.service.js') -const ReturnsCycleService = require('../services/return-requirements/setup/returns-cycle.service.js') -const SelectPurposeService = require('../services/return-requirements/setup/purpose.service.js') -const SelectReasonService = require('../services/return-requirements/setup/reason.service.js') -const SiteDescriptionService = require('../services/return-requirements/setup/site-description.service.js') -const StartDateService = require('../services/return-requirements/setup/start-date.service.js') -const SubmitAbstractionPeriod = require('../services/return-requirements/setup/submit-abstraction-period.service.js') -const SubmitAdditionalSubmissionOptionsService = require('../services/return-requirements/setup/submit-additional-submission-options.service.js') -const SubmitAgreementsExceptions = require('../services/return-requirements/setup/submit-agreements-exceptions.service.js') -const SubmitCancel = require('../services/return-requirements/setup/submit-cancel.service.js') -const SubmitCheckService = require('../services/return-requirements/setup/check/submit-check.service.js') -const SubmitExistingService = require('../services/return-requirements/setup/submit-existing.service.js') -const SubmitFrequencyCollectedService = require('../services/return-requirements/setup/submit-frequency-collected.service.js') -const SubmitFrequencyReportedService = require('../services/return-requirements/setup/submit-frequency-reported.service.js') -const SubmitMethodService = require('../services/return-requirements/setup/method/submit-method.service.js') -const SubmitNoReturnsRequiredService = require('../services/return-requirements/setup/submit-no-returns-required.service.js') -const SubmitNoteService = require('../services/return-requirements/setup/submit-note.service.js') -const SubmitPointsService = require('../services/return-requirements/setup/submit-points.service.js') -const SubmitPurposeService = require('../services/return-requirements/setup/submit-purpose.service.js') -const SubmitReasonService = require('../services/return-requirements/setup/submit-reason.service.js') -const SubmitRemoveService = require('../services/return-requirements/setup/submit-remove.service.js') -const SubmitReturnsCycleService = require('../services/return-requirements/setup/submit-returns-cycle.service.js') -const SubmitSiteDescriptionService = require('../services/return-requirements/setup/submit-site-description.service.js') -const SubmitStartDateService = require('../services/return-requirements/setup/submit-start-date.service.js') +const FrequencyCollectedService = require('../services/return-versions/setup/frequency-collected.service.js') +const FrequencyReportedService = require('../services/return-versions/setup/frequency-reported.service.js') +const MethodService = require('../services/return-versions/setup/method/method.service.js') +const NoReturnsRequiredService = require('../services/return-versions/setup/no-returns-required.service.js') +const NoteService = require('../services/return-versions/setup/note.service.js') +const PointsService = require('../services/return-versions/setup/points.service.js') +const RemoveService = require('../services/return-versions/setup/remove.service.js') +const ReturnsCycleService = require('../services/return-versions/setup/returns-cycle.service.js') +const SelectPurposeService = require('../services/return-versions/setup/purpose.service.js') +const SelectReasonService = require('../services/return-versions/setup/reason.service.js') +const SiteDescriptionService = require('../services/return-versions/setup/site-description.service.js') +const StartDateService = require('../services/return-versions/setup/start-date.service.js') +const SubmitAbstractionPeriod = require('../services/return-versions/setup/submit-abstraction-period.service.js') +const SubmitAdditionalSubmissionOptionsService = require('../services/return-versions/setup/submit-additional-submission-options.service.js') +const SubmitAgreementsExceptions = require('../services/return-versions/setup/submit-agreements-exceptions.service.js') +const SubmitCancel = require('../services/return-versions/setup/submit-cancel.service.js') +const SubmitCheckService = require('../services/return-versions/setup/check/submit-check.service.js') +const SubmitExistingService = require('../services/return-versions/setup/submit-existing.service.js') +const SubmitFrequencyCollectedService = require('../services/return-versions/setup/submit-frequency-collected.service.js') +const SubmitFrequencyReportedService = require('../services/return-versions/setup/submit-frequency-reported.service.js') +const SubmitMethodService = require('../services/return-versions/setup/method/submit-method.service.js') +const SubmitNoReturnsRequiredService = require('../services/return-versions/setup/submit-no-returns-required.service.js') +const SubmitNoteService = require('../services/return-versions/setup/submit-note.service.js') +const SubmitPointsService = require('../services/return-versions/setup/submit-points.service.js') +const SubmitPurposeService = require('../services/return-versions/setup/submit-purpose.service.js') +const SubmitReasonService = require('../services/return-versions/setup/submit-reason.service.js') +const SubmitRemoveService = require('../services/return-versions/setup/submit-remove.service.js') +const SubmitReturnsCycleService = require('../services/return-versions/setup/submit-returns-cycle.service.js') +const SubmitSiteDescriptionService = require('../services/return-versions/setup/submit-site-description.service.js') +const SubmitStartDateService = require('../services/return-versions/setup/submit-start-date.service.js') async function abstractionPeriod (request, h) { const { requirementIndex, sessionId } = request.params const pageData = await AbstractionPeriodService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/abstraction-period.njk', { + return h.view('return-versions/setup/abstraction-period.njk', { ...pageData }) } @@ -60,7 +60,7 @@ async function add (request, h) { const requirementIndex = await AddService.go(sessionId) - return h.redirect(`/system/return-requirements/setup/${sessionId}/purpose/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/purpose/${requirementIndex}`) } async function additionalSubmissionOptions (request, h) { @@ -68,7 +68,7 @@ async function additionalSubmissionOptions (request, h) { const pageData = await AdditionalSubmissionOptionsService.go(sessionId) - return h.view('return-requirements/setup/additional-submission-options.njk', { + return h.view('return-versions/setup/additional-submission-options.njk', { ...pageData }) } @@ -78,7 +78,7 @@ async function agreementsExceptions (request, h) { const pageData = await AgreementsExceptionsService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/agreements-exceptions.njk', { + return h.view('return-versions/setup/agreements-exceptions.njk', { ...pageData }) } @@ -86,7 +86,7 @@ async function agreementsExceptions (request, h) { async function approved (request, h) { const { licenceId } = request.params - return h.view('return-requirements/setup/approved.njk', { + return h.view('return-versions/setup/approved.njk', { activeNavBar: 'search', pageTitle: 'Requirements for returns approved', licenceId @@ -97,7 +97,7 @@ async function cancel (request, h) { const { sessionId } = request.params const pageData = await CancelService.go(sessionId) - return h.view('return-requirements/setup/cancel.njk', { + return h.view('return-versions/setup/cancel.njk', { ...pageData }) } @@ -106,7 +106,7 @@ async function check (request, h) { const { sessionId } = request.params const pageData = await CheckService.go(sessionId, request.yar) - return h.view('return-requirements/setup/check.njk', { + return h.view('return-versions/setup/check.njk', { ...pageData }) } @@ -116,7 +116,7 @@ async function deleteNote (request, h) { await DeleteNoteService.go(sessionId, request.yar) - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function existing (request, h) { @@ -124,7 +124,7 @@ async function existing (request, h) { const pageData = await ExistingService.go(sessionId) - return h.view('return-requirements/setup/existing.njk', { + return h.view('return-versions/setup/existing.njk', { ...pageData }) } @@ -134,7 +134,7 @@ async function frequencyCollected (request, h) { const pageData = await FrequencyCollectedService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/frequency-collected.njk', { + return h.view('return-versions/setup/frequency-collected.njk', { ...pageData }) } @@ -144,7 +144,7 @@ async function frequencyReported (request, h) { const pageData = await FrequencyReportedService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/frequency-reported.njk', { + return h.view('return-versions/setup/frequency-reported.njk', { ...pageData }) } @@ -154,7 +154,7 @@ async function method (request, h) { const pageData = await MethodService.go(sessionId) - return h.view('return-requirements/setup/method.njk', { + return h.view('return-versions/setup/method.njk', { ...pageData }) } @@ -164,7 +164,7 @@ async function noReturnsRequired (request, h) { const pageData = await NoReturnsRequiredService.go(sessionId) - return h.view('return-requirements/setup/no-returns-required.njk', { + return h.view('return-versions/setup/no-returns-required.njk', { ...pageData }) } @@ -174,7 +174,7 @@ async function note (request, h) { const pageData = await NoteService.go(sessionId) - return h.view('return-requirements/setup/note.njk', { + return h.view('return-versions/setup/note.njk', { ...pageData }) } @@ -184,7 +184,7 @@ async function points (request, h) { const pageData = await PointsService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/points.njk', { + return h.view('return-versions/setup/points.njk', { ...pageData }) } @@ -194,7 +194,7 @@ async function purpose (request, h) { const pageData = await SelectPurposeService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/purpose.njk', { + return h.view('return-versions/setup/purpose.njk', { ...pageData }) } @@ -204,7 +204,7 @@ async function reason (request, h) { const pageData = await SelectReasonService.go(sessionId) - return h.view('return-requirements/setup/reason.njk', { + return h.view('return-versions/setup/reason.njk', { ...pageData }) } @@ -214,7 +214,7 @@ async function remove (request, h) { const pageData = await RemoveService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/remove.njk', { + return h.view('return-versions/setup/remove.njk', { ...pageData }) } @@ -224,7 +224,7 @@ async function returnsCycle (request, h) { const pageData = await ReturnsCycleService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/returns-cycle.njk', { + return h.view('return-versions/setup/returns-cycle.njk', { ...pageData }) } @@ -234,7 +234,7 @@ async function siteDescription (request, h) { const pageData = await SiteDescriptionService.go(sessionId, requirementIndex) - return h.view('return-requirements/setup/site-description.njk', { + return h.view('return-versions/setup/site-description.njk', { ...pageData }) } @@ -244,7 +244,7 @@ async function startDate (request, h) { const pageData = await StartDateService.go(sessionId) - return h.view('return-requirements/setup/start-date.njk', { + return h.view('return-versions/setup/start-date.njk', { ...pageData }) } @@ -255,14 +255,14 @@ async function submitAbstractionPeriod (request, h) { const pageData = await SubmitAbstractionPeriod.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/abstraction-period.njk', pageData) + return h.view('return-versions/setup/abstraction-period.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/returns-cycle/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/returns-cycle/${requirementIndex}`) } async function submitAgreementsExceptions (request, h) { @@ -271,10 +271,10 @@ async function submitAgreementsExceptions (request, h) { const pageData = await SubmitAgreementsExceptions.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/agreements-exceptions.njk', pageData) + return h.view('return-versions/setup/agreements-exceptions.njk', pageData) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function submitAdditionalSubmissionOptions (request, h) { @@ -283,10 +283,10 @@ async function submitAdditionalSubmissionOptions (request, h) { const pageData = await SubmitAdditionalSubmissionOptionsService.go(sessionId, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/additional-submission-options.njk', pageData) + return h.view('return-versions/setup/additional-submission-options.njk', pageData) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function submitCancel (request, h) { @@ -308,7 +308,7 @@ async function submitCheck (request, h) { const licenceId = await SubmitCheckService.go(sessionId, userId) - return h.redirect(`/system/return-requirements/setup/${licenceId}/approved`) + return h.redirect(`/system/return-versions/setup/${licenceId}/approved`) } async function submitExisting (request, h) { @@ -317,10 +317,10 @@ async function submitExisting (request, h) { const pageData = await SubmitExistingService.go(sessionId, payload) if (pageData.error) { - return h.view('return-requirements/setup/existing.njk', pageData) + return h.view('return-versions/setup/existing.njk', pageData) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function submitFrequencyCollected (request, h) { @@ -329,14 +329,14 @@ async function submitFrequencyCollected (request, h) { const pageData = await SubmitFrequencyCollectedService.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/frequency-collected.njk', pageData) + return h.view('return-versions/setup/frequency-collected.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/frequency-reported/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/frequency-reported/${requirementIndex}`) } async function submitFrequencyReported (request, h) { @@ -345,14 +345,14 @@ async function submitFrequencyReported (request, h) { const pageData = await SubmitFrequencyReportedService.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/frequency-reported.njk', pageData) + return h.view('return-versions/setup/frequency-reported.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/agreements-exceptions/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/agreements-exceptions/${requirementIndex}`) } async function submitMethod (request, h) { @@ -361,10 +361,10 @@ async function submitMethod (request, h) { const pageData = await SubmitMethodService.go(sessionId, request.payload) if (pageData.error) { - return h.view('return-requirements/setup/method.njk', pageData) + return h.view('return-versions/setup/method.njk', pageData) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/${pageData.redirect}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/${pageData.redirect}`) } async function submitNoReturnsRequired (request, h) { @@ -373,10 +373,10 @@ async function submitNoReturnsRequired (request, h) { const pageData = await SubmitNoReturnsRequiredService.go(sessionId, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/no-returns-required.njk', pageData) + return h.view('return-versions/setup/no-returns-required.njk', pageData) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function submitNote (request, h) { @@ -386,10 +386,10 @@ async function submitNote (request, h) { const pageData = await SubmitNoteService.go(sessionId, request.payload, user, request.yar) if (pageData.error) { - return h.view('return-requirements/setup/note.njk', pageData) + return h.view('return-versions/setup/note.njk', pageData) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function submitPoints (request, h) { @@ -398,14 +398,14 @@ async function submitPoints (request, h) { const pageData = await SubmitPointsService.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/points.njk', pageData) + return h.view('return-versions/setup/points.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/abstraction-period/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/abstraction-period/${requirementIndex}`) } async function submitPurpose (request, h) { @@ -414,14 +414,14 @@ async function submitPurpose (request, h) { const pageData = await SubmitPurposeService.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/purpose.njk', pageData) + return h.view('return-versions/setup/purpose.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/points/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/points/${requirementIndex}`) } async function submitReason (request, h) { @@ -430,14 +430,14 @@ async function submitReason (request, h) { const pageData = await SubmitReasonService.go(sessionId, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/reason.njk', pageData) + return h.view('return-versions/setup/reason.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/method`) + return h.redirect(`/system/return-versions/setup/${sessionId}/method`) } async function submitRemove (request, h) { @@ -445,7 +445,7 @@ async function submitRemove (request, h) { await SubmitRemoveService.go(sessionId, requirementIndex, request.yar) - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } async function submitReturnsCycle (request, h) { @@ -454,14 +454,14 @@ async function submitReturnsCycle (request, h) { const pageData = await SubmitReturnsCycleService.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/returns-cycle.njk', pageData) + return h.view('return-versions/setup/returns-cycle.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/site-description/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/site-description/${requirementIndex}`) } async function submitSiteDescription (request, h) { @@ -470,14 +470,14 @@ async function submitSiteDescription (request, h) { const pageData = await SubmitSiteDescriptionService.go(sessionId, requirementIndex, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/site-description.njk', pageData) + return h.view('return-versions/setup/site-description.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/frequency-collected/${requirementIndex}`) + return h.redirect(`/system/return-versions/setup/${sessionId}/frequency-collected/${requirementIndex}`) } async function submitStartDate (request, h) { @@ -486,18 +486,18 @@ async function submitStartDate (request, h) { const pageData = await SubmitStartDateService.go(sessionId, payload, yar) if (pageData.error) { - return h.view('return-requirements/setup/start-date.njk', pageData) + return h.view('return-versions/setup/start-date.njk', pageData) } if (pageData.checkPageVisited) { - return h.redirect(`/system/return-requirements/setup/${sessionId}/check`) + return h.redirect(`/system/return-versions/setup/${sessionId}/check`) } if (pageData.journey === 'returns-required') { - return h.redirect(`/system/return-requirements/setup/${sessionId}/reason`) + return h.redirect(`/system/return-versions/setup/${sessionId}/reason`) } - return h.redirect(`/system/return-requirements/setup/${sessionId}/no-returns-required`) + return h.redirect(`/system/return-versions/setup/${sessionId}/no-returns-required`) } module.exports = { diff --git a/app/controllers/return-versions.controller.js b/app/controllers/return-versions.controller.js new file mode 100644 index 0000000000..7fa6126529 --- /dev/null +++ b/app/controllers/return-versions.controller.js @@ -0,0 +1,21 @@ +'use strict' + +/** + * Controller for /return-versions endpoints + * @module ReturnVersionsController + */ + +const ViewService = require('../services/return-versions/view.service.js') + +async function view (request, h) { + const { id } = request.params + const pageData = await ViewService.go(id) + + return h.view('return-versions/view.njk', { + ...pageData + }) +} + +module.exports = { + view +} diff --git a/app/plugins/router.plugin.js b/app/plugins/router.plugin.js index 05fef395b3..14cf4e1576 100644 --- a/app/plugins/router.plugin.js +++ b/app/plugins/router.plugin.js @@ -25,8 +25,8 @@ const ImportRoutes = require('../routes/import.routes.js') const JobRoutes = require('../routes/jobs.routes.js') const LicenceRoutes = require('../routes/licence.routes.js') const MonitoringStationRoutes = require('../routes/monitoring-station.routes.js') -const ReturnRequirementsRoutes = require('../routes/return-requirements.routes.js') -const ReturnRequirementsSetupRoutes = require('../routes/return-requirements-setup.routes.js') +const ReturnVersionsSetupRoutes = require('../routes/return-versions-setup.routes.js') +const ReturnVersionsRoutes = require('../routes/return-versions.routes.js') const RootRoutes = require('../routes/root.routes.js') const AirbrakeConfig = require('../../config/airbrake.config.js') @@ -44,8 +44,8 @@ const routes = [ ...LicenceRoutes, ...JobRoutes, ...MonitoringStationRoutes, - ...ReturnRequirementsRoutes, - ...ReturnRequirementsSetupRoutes, + ...ReturnVersionsRoutes, + ...ReturnVersionsSetupRoutes, ...DataRoutes, ...ImportRoutes ] diff --git a/app/presenters/licences/view-licence-history.presenter.js b/app/presenters/licences/view-licence-history.presenter.js index 0962eb811b..356b9bc44e 100644 --- a/app/presenters/licences/view-licence-history.presenter.js +++ b/app/presenters/licences/view-licence-history.presenter.js @@ -97,7 +97,7 @@ function _returnVersionEntries (licence) { dateCreated: formatLongDate(createdAt), displayNote: notes.length > 0, notes, - link: `/system/return-requirements/${returnVersion.id}`, + link: `/system/return-versions/${returnVersion.id}`, reason: mappedReason ?? reason, type: { index: 2, name: 'Return version' } } diff --git a/app/presenters/licences/view-licence-set-up.presenter.js b/app/presenters/licences/view-licence-set-up.presenter.js index b09655777e..9ca794eebf 100644 --- a/app/presenters/licences/view-licence-set-up.presenter.js +++ b/app/presenters/licences/view-licence-set-up.presenter.js @@ -220,7 +220,7 @@ function _returnVersions (returnVersions = [{}]) { return { action: [{ text: 'View', - link: `/system/return-requirements/${returnVersion.id}` + link: `/system/return-versions/${returnVersion.id}` }], endDate: returnVersion.endDate ? formatLongDate(returnVersion.endDate) : '', reason: _reason(returnVersion), diff --git a/app/presenters/return-requirements/setup/abstraction-period.presenter.js b/app/presenters/return-versions/setup/abstraction-period.presenter.js similarity index 73% rename from app/presenters/return-requirements/setup/abstraction-period.presenter.js rename to app/presenters/return-versions/setup/abstraction-period.presenter.js index 8f38d4996b..2168046e70 100644 --- a/app/presenters/return-requirements/setup/abstraction-period.presenter.js +++ b/app/presenters/return-versions/setup/abstraction-period.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/abstraction-period` page + * Formats data for the `/return-versions/setup/{sessionId}/abstraction-period` page * @module AbstractionPeriodPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/abstraction-period` page + * Formats data for the `/return-versions/setup/{sessionId}/abstraction-period` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -30,10 +30,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/points/${requirementIndex}` + return `/system/return-versions/setup/${id}/points/${requirementIndex}` } module.exports = { diff --git a/app/presenters/return-requirements/setup/additional-submission-options.presenter.js b/app/presenters/return-versions/setup/additional-submission-options.presenter.js similarity index 66% rename from app/presenters/return-requirements/setup/additional-submission-options.presenter.js rename to app/presenters/return-versions/setup/additional-submission-options.presenter.js index a4e00ddbc9..9622c48440 100644 --- a/app/presenters/return-requirements/setup/additional-submission-options.presenter.js +++ b/app/presenters/return-versions/setup/additional-submission-options.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/additional-submission-options` page + * Formats data for the `/return-versions/setup/{sessionId}/additional-submission-options` page * @module AdditionalSubmissionOptionsPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/additional-submission-options` page + * Formats data for the `/return-versions/setup/{sessionId}/additional-submission-options` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -16,7 +16,7 @@ function go (session) { const { id: sessionId, licence: { id: licenceId, licenceRef }, additionalSubmissionOptions } = session const data = { additionalSubmissionOptions: additionalSubmissionOptions ?? [], - backLink: `/system/return-requirements/setup/${sessionId}/check`, + backLink: `/system/return-versions/setup/${sessionId}/check`, licenceId, licenceRef, sessionId diff --git a/app/presenters/return-requirements/setup/agreements-exceptions.presenter.js b/app/presenters/return-versions/setup/agreements-exceptions.presenter.js similarity index 72% rename from app/presenters/return-requirements/setup/agreements-exceptions.presenter.js rename to app/presenters/return-versions/setup/agreements-exceptions.presenter.js index 26465401f1..db31218d27 100644 --- a/app/presenters/return-requirements/setup/agreements-exceptions.presenter.js +++ b/app/presenters/return-versions/setup/agreements-exceptions.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/agreements-exceptions` page + * Formats data for the `/return-versions/setup/{sessionId}/agreements-exceptions` page * @module AgreementsExceptionsPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/agreements-exceptions` page + * Formats data for the `/return-versions/setup/{sessionId}/agreements-exceptions` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -30,10 +30,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/frequency-reported/${requirementIndex}` + return `/system/return-versions/setup/${id}/frequency-reported/${requirementIndex}` } module.exports = { diff --git a/app/presenters/return-requirements/setup/cancel.presenter.js b/app/presenters/return-versions/setup/cancel.presenter.js similarity index 87% rename from app/presenters/return-requirements/setup/cancel.presenter.js rename to app/presenters/return-versions/setup/cancel.presenter.js index 8018fd7841..06f7ec6f1f 100644 --- a/app/presenters/return-requirements/setup/cancel.presenter.js +++ b/app/presenters/return-versions/setup/cancel.presenter.js @@ -1,7 +1,7 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/cancel` page + * Formats data for the `/return-versions/setup/{sessionId}/cancel` page * @module CancelRequirementsPresenter */ @@ -9,7 +9,7 @@ const { formatLongDate } = require('../../base.presenter.js') const { returnRequirementFrequencies, returnRequirementReasons } = require('../../../lib/static-lookups.lib.js') /** - * Formats data for the `/return-requirements/setup/{sessionId}/cancel` page + * Formats data for the `/return-versions/setup/{sessionId}/cancel` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -19,7 +19,7 @@ function go (session) { const { id: sessionId, journey, licence, reason, requirements } = session return { - backLink: `/system/return-requirements/setup/${sessionId}/check`, + backLink: `/system/return-versions/setup/${sessionId}/check`, licenceId: licence.id, licenceRef: licence.licenceRef, reason: returnRequirementReasons[reason], diff --git a/app/presenters/return-requirements/setup/check/check.presenter.js b/app/presenters/return-versions/setup/check/check.presenter.js similarity index 85% rename from app/presenters/return-requirements/setup/check/check.presenter.js rename to app/presenters/return-versions/setup/check/check.presenter.js index 1046e54d7d..bb866d2041 100644 --- a/app/presenters/return-requirements/setup/check/check.presenter.js +++ b/app/presenters/return-versions/setup/check/check.presenter.js @@ -1,7 +1,7 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/check` page + * Formats data for the `/return-versions/setup/{sessionId}/check` page * @module CheckPresenter */ @@ -9,7 +9,7 @@ const { formatLongDate } = require('../../../base.presenter.js') const { returnRequirementReasons } = require('../../../../lib/static-lookups.lib.js') /** - * Formats data for the `/return-requirements/setup/{sessionId}/check` page + * Formats data for the `/return-versions/setup/{sessionId}/check` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -53,10 +53,10 @@ function _note (note) { function _reasonLink (sessionId, returnsRequired) { if (returnsRequired) { - return `/system/return-requirements/setup/${sessionId}/reason` + return `/system/return-versions/setup/${sessionId}/reason` } - return `/system/return-requirements/setup/${sessionId}/no-returns-required` + return `/system/return-versions/setup/${sessionId}/no-returns-required` } function _startDate (session) { diff --git a/app/presenters/return-requirements/setup/check/returns-requirements.presenter.js b/app/presenters/return-versions/setup/check/returns-requirements.presenter.js similarity index 94% rename from app/presenters/return-requirements/setup/check/returns-requirements.presenter.js rename to app/presenters/return-versions/setup/check/returns-requirements.presenter.js index 1ed673aaff..2dc49239df 100644 --- a/app/presenters/return-requirements/setup/check/returns-requirements.presenter.js +++ b/app/presenters/return-versions/setup/check/returns-requirements.presenter.js @@ -1,7 +1,7 @@ 'use strict' /** - * Formats return requirements data for the `/return-requirements/setup/{sessionId}/check` page + * Formats return requirements data for the `/return-versions/setup/{sessionId}/check` page * @module ReturnRequirementsPresenter */ @@ -17,7 +17,7 @@ const AGREEMENTS_EXCEPTIONS = { } /** - * Formats return requirements data for the `/return-requirements/setup/{sessionId}/check` page + * Formats return requirements data for the `/return-versions/setup/{sessionId}/check` page * * @param {object[]} requirements - The existing return requirements in the current session * @param {module:PointModel[]} points - All points linked to the licence version purposes linked to the current licence diff --git a/app/presenters/return-requirements/setup/existing.presenter.js b/app/presenters/return-versions/setup/existing.presenter.js similarity index 91% rename from app/presenters/return-requirements/setup/existing.presenter.js rename to app/presenters/return-versions/setup/existing.presenter.js index 4c0193cebe..befc45ebc4 100644 --- a/app/presenters/return-requirements/setup/existing.presenter.js +++ b/app/presenters/return-versions/setup/existing.presenter.js @@ -1,7 +1,7 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/existing` page + * Formats data for the `/return-versions/setup/{sessionId}/existing` page * @module ExistingPresenter */ @@ -9,7 +9,7 @@ const { formatLongDate } = require('../../base.presenter.js') const { returnRequirementReasons } = require('../../../lib/static-lookups.lib.js') /** - * Formats data for the `/return-requirements/setup/{sessionId}/existing` page + * Formats data for the `/return-versions/setup/{sessionId}/existing` page * * @param {module:SessionModel} session - The returns requirements session instance * diff --git a/app/presenters/return-requirements/setup/frequency-collected.presenter.js b/app/presenters/return-versions/setup/frequency-collected.presenter.js similarity index 72% rename from app/presenters/return-requirements/setup/frequency-collected.presenter.js rename to app/presenters/return-versions/setup/frequency-collected.presenter.js index b5258aa559..64986724f5 100644 --- a/app/presenters/return-requirements/setup/frequency-collected.presenter.js +++ b/app/presenters/return-versions/setup/frequency-collected.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/frequency-collected` page + * Formats data for the `/return-versions/setup/{sessionId}/frequency-collected` page * @module FrequencyCollectedPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/frequency-collected` page + * Formats data for the `/return-versions/setup/{sessionId}/frequency-collected` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -30,10 +30,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/site-description/${requirementIndex}` + return `/system/return-versions/setup/${id}/site-description/${requirementIndex}` } module.exports = { diff --git a/app/presenters/return-requirements/setup/frequency-reported.presenter.js b/app/presenters/return-versions/setup/frequency-reported.presenter.js similarity index 72% rename from app/presenters/return-requirements/setup/frequency-reported.presenter.js rename to app/presenters/return-versions/setup/frequency-reported.presenter.js index ab2425e383..130b31f7ad 100644 --- a/app/presenters/return-requirements/setup/frequency-reported.presenter.js +++ b/app/presenters/return-versions/setup/frequency-reported.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/frequency-reported` page + * Formats data for the `/return-versions/setup/{sessionId}/frequency-reported` page * @module FrequencyReportedPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/frequency-reported` page + * Formats data for the `/return-versions/setup/{sessionId}/frequency-reported` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -30,10 +30,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/frequency-collected/${requirementIndex}` + return `/system/return-versions/setup/${id}/frequency-collected/${requirementIndex}` } module.exports = { diff --git a/app/presenters/return-requirements/setup/method.presenter.js b/app/presenters/return-versions/setup/method.presenter.js similarity index 67% rename from app/presenters/return-requirements/setup/method.presenter.js rename to app/presenters/return-versions/setup/method.presenter.js index 58892aebed..8dc26c4d70 100644 --- a/app/presenters/return-requirements/setup/method.presenter.js +++ b/app/presenters/return-versions/setup/method.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/method` page + * Formats data for the `/return-versions/setup/{sessionId}/method` page * @module MethodPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/method` page + * Formats data for the `/return-versions/setup/{sessionId}/method` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -16,7 +16,7 @@ function go (session) { const { id: sessionId, licence, method } = session return { - backLink: `/system/return-requirements/setup/${sessionId}/reason`, + backLink: `/system/return-versions/setup/${sessionId}/reason`, displayCopyExisting: licence.returnVersions.length > 0, licenceRef: licence.licenceRef, method: method ?? null, diff --git a/app/presenters/return-requirements/setup/no-returns-required.presenter.js b/app/presenters/return-versions/setup/no-returns-required.presenter.js similarity index 65% rename from app/presenters/return-requirements/setup/no-returns-required.presenter.js rename to app/presenters/return-versions/setup/no-returns-required.presenter.js index badc81b894..e44002eeae 100644 --- a/app/presenters/return-requirements/setup/no-returns-required.presenter.js +++ b/app/presenters/return-versions/setup/no-returns-required.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/no-returns-required` page + * Formats data for the `/return-versions/setup/{sessionId}/no-returns-required` page * @module NoReturnsRequiredPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/no-returns-required` page + * Formats data for the `/return-versions/setup/{sessionId}/no-returns-required` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -27,10 +27,10 @@ function _backLink (session) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/start-date` + return `/system/return-versions/setup/${id}/start-date` } module.exports = { diff --git a/app/presenters/return-requirements/setup/note.presenter.js b/app/presenters/return-versions/setup/note.presenter.js similarity index 65% rename from app/presenters/return-requirements/setup/note.presenter.js rename to app/presenters/return-versions/setup/note.presenter.js index 4119a4bf09..6cc3544ef2 100644 --- a/app/presenters/return-requirements/setup/note.presenter.js +++ b/app/presenters/return-versions/setup/note.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/note` page + * Formats data for the `/return-versions/setup/{sessionId}/note` page * @module NotePresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/note` page + * Formats data for the `/return-versions/setup/{sessionId}/note` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -16,7 +16,7 @@ function go (session) { const { id: sessionId, licence, note } = session return { - backLink: `/system/return-requirements/setup/${sessionId}/check`, + backLink: `/system/return-versions/setup/${sessionId}/check`, licenceRef: licence.licenceRef, note: note ? note.content : null, sessionId diff --git a/app/presenters/return-requirements/setup/points.presenter.js b/app/presenters/return-versions/setup/points.presenter.js similarity index 84% rename from app/presenters/return-requirements/setup/points.presenter.js rename to app/presenters/return-versions/setup/points.presenter.js index d24394c9e8..c3ef68d3a3 100644 --- a/app/presenters/return-requirements/setup/points.presenter.js +++ b/app/presenters/return-versions/setup/points.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/points` page + * Formats data for the `/return-versions/setup/{sessionId}/points` page * @module PointsPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/points` page + * Formats data for the `/return-versions/setup/{sessionId}/points` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -33,10 +33,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/purpose/${requirementIndex}` + return `/system/return-versions/setup/${id}/purpose/${requirementIndex}` } function _licencePoints (points) { diff --git a/app/presenters/return-requirements/setup/purpose.presenter.js b/app/presenters/return-versions/setup/purpose.presenter.js similarity index 88% rename from app/presenters/return-requirements/setup/purpose.presenter.js rename to app/presenters/return-versions/setup/purpose.presenter.js index dd73fdceb7..0bdb208c22 100644 --- a/app/presenters/return-requirements/setup/purpose.presenter.js +++ b/app/presenters/return-versions/setup/purpose.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/purpose` page + * Formats data for the `/return-versions/setup/{sessionId}/purpose` page * @module PurposePresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/purpose` page + * Formats data for the `/return-versions/setup/{sessionId}/purpose` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -40,10 +40,10 @@ function _backLink (session) { // scenario 'Back' also needs to take them back to `/check`. Hence, the logic is different in this presenter when // compared with the other setup pages. if (checkPageVisited || requirements.length > 1) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/method` + return `/system/return-versions/setup/${id}/method` } function _purposes (licencePurposes, requirementPurposes) { diff --git a/app/presenters/return-requirements/setup/reason.presenter.js b/app/presenters/return-versions/setup/reason.presenter.js similarity index 66% rename from app/presenters/return-requirements/setup/reason.presenter.js rename to app/presenters/return-versions/setup/reason.presenter.js index 6a89d051b8..a6faa5a49e 100644 --- a/app/presenters/return-requirements/setup/reason.presenter.js +++ b/app/presenters/return-versions/setup/reason.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/reason` page + * Formats data for the `/return-versions/setup/{sessionId}/reason` page * @module ReasonPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/reason` page + * Formats data for the `/return-versions/setup/{sessionId}/reason` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -27,10 +27,10 @@ function _backLink (session) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/start-date` + return `/system/return-versions/setup/${id}/start-date` } module.exports = { diff --git a/app/presenters/return-requirements/setup/remove.presenter.js b/app/presenters/return-versions/setup/remove.presenter.js similarity index 87% rename from app/presenters/return-requirements/setup/remove.presenter.js rename to app/presenters/return-versions/setup/remove.presenter.js index 3b0bf08bc8..17d72660b7 100644 --- a/app/presenters/return-requirements/setup/remove.presenter.js +++ b/app/presenters/return-versions/setup/remove.presenter.js @@ -1,7 +1,7 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/remove/{requirementIndex}` page + * Formats data for the `/return-versions/setup/{sessionId}/remove/{requirementIndex}` page * @module RemovePresenter */ @@ -9,7 +9,7 @@ const { formatLongDate } = require('../../base.presenter.js') const { returnRequirementFrequencies } = require('../../../lib/static-lookups.lib.js') /** - * Formats data for the `/return-requirements/setup/{sessionId}/remove/{requirementIndex}` page + * Formats data for the `/return-versions/setup/{sessionId}/remove/{requirementIndex}` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -33,7 +33,7 @@ function go (session, requirementIndex) { function _backLink (session) { const { id } = session - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } function _formattedReturnRequirement (requirement) { diff --git a/app/presenters/return-requirements/setup/returns-cycle.presenter.js b/app/presenters/return-versions/setup/returns-cycle.presenter.js similarity index 72% rename from app/presenters/return-requirements/setup/returns-cycle.presenter.js rename to app/presenters/return-versions/setup/returns-cycle.presenter.js index 66e6562169..df66d459ca 100644 --- a/app/presenters/return-requirements/setup/returns-cycle.presenter.js +++ b/app/presenters/return-versions/setup/returns-cycle.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/returns-cycle` page + * Formats data for the `/return-versions/setup/{sessionId}/returns-cycle` page * @module ReturnsCyclePresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/returns-cycle` page + * Formats data for the `/return-versions/setup/{sessionId}/returns-cycle` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -30,10 +30,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/abstraction-period/${requirementIndex}` + return `/system/return-versions/setup/${id}/abstraction-period/${requirementIndex}` } module.exports = { diff --git a/app/presenters/return-requirements/setup/site-description.presenter.js b/app/presenters/return-versions/setup/site-description.presenter.js similarity index 72% rename from app/presenters/return-requirements/setup/site-description.presenter.js rename to app/presenters/return-versions/setup/site-description.presenter.js index 23fc4af165..cb373eef61 100644 --- a/app/presenters/return-requirements/setup/site-description.presenter.js +++ b/app/presenters/return-versions/setup/site-description.presenter.js @@ -1,12 +1,12 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/site-description` page + * Formats data for the `/return-versions/setup/{sessionId}/site-description` page * @module SiteDescriptionPresenter */ /** - * Formats data for the `/return-requirements/setup/{sessionId}/site-description` page + * Formats data for the `/return-versions/setup/{sessionId}/site-description` page * * @param {module:SessionModel} session - The returns requirements session instance * @param {string} requirementIndex - The index of the requirement being added or changed @@ -30,10 +30,10 @@ function _backLink (session, requirementIndex) { const { checkPageVisited, id } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } - return `/system/return-requirements/setup/${id}/returns-cycle/${requirementIndex}` + return `/system/return-versions/setup/${id}/returns-cycle/${requirementIndex}` } module.exports = { diff --git a/app/presenters/return-requirements/setup/start-date.presenter.js b/app/presenters/return-versions/setup/start-date.presenter.js similarity index 87% rename from app/presenters/return-requirements/setup/start-date.presenter.js rename to app/presenters/return-versions/setup/start-date.presenter.js index be3611b74d..8bdefa13ed 100644 --- a/app/presenters/return-requirements/setup/start-date.presenter.js +++ b/app/presenters/return-versions/setup/start-date.presenter.js @@ -1,7 +1,7 @@ 'use strict' /** - * Formats data for the `/return-requirements/setup/{sessionId}/start-date` page + * Formats data for the `/return-versions/setup/{sessionId}/start-date` page * @module StartDatePresenter */ @@ -9,7 +9,7 @@ const FeatureFlagsConfig = require('../../../../config/feature-flags.config.js') const { formatLongDate } = require('../../base.presenter.js') /** - * Formats data for the `/return-requirements/setup/{sessionId}/start-date` page + * Formats data for the `/return-versions/setup/{sessionId}/start-date` page * * @param {module:SessionModel} session - The returns requirements session instance * @@ -42,7 +42,7 @@ function _backLink (session) { const { checkPageVisited, id, licence } = session if (checkPageVisited) { - return `/system/return-requirements/setup/${id}/check` + return `/system/return-versions/setup/${id}/check` } if (FeatureFlagsConfig.enableSystemLicenceView) { diff --git a/app/presenters/return-requirements/view.presenter.js b/app/presenters/return-versions/view.presenter.js similarity index 100% rename from app/presenters/return-requirements/view.presenter.js rename to app/presenters/return-versions/view.presenter.js diff --git a/app/routes/return-requirements-setup.routes.js b/app/routes/return-requirements-setup.routes.js deleted file mode 100644 index d27bf507c3..0000000000 --- a/app/routes/return-requirements-setup.routes.js +++ /dev/null @@ -1,476 +0,0 @@ -'use strict' - -const ReturnRequirementsSetupController = require('../controllers/return-requirements-setup.controller.js') - -const routes = [ - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/abstraction-period/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.abstractionPeriod, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/abstraction-period/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitAbstractionPeriod, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/add', - options: { - handler: ReturnRequirementsSetupController.add, - auth: { - access: { - scope: ['billing'] - } - } - } - - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/additional-submission-options', - options: { - handler: ReturnRequirementsSetupController.additionalSubmissionOptions, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/additional-submission-options', - options: { - handler: ReturnRequirementsSetupController.submitAdditionalSubmissionOptions, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/agreements-exceptions/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.agreementsExceptions, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/agreements-exceptions/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitAgreementsExceptions, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{licenceId}/approved', - options: { - handler: ReturnRequirementsSetupController.approved, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/cancel', - options: { - handler: ReturnRequirementsSetupController.cancel, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/cancel', - options: { - handler: ReturnRequirementsSetupController.submitCancel, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/check', - options: { - handler: ReturnRequirementsSetupController.check, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/check', - options: { - handler: ReturnRequirementsSetupController.submitCheck, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/delete-note', - options: { - handler: ReturnRequirementsSetupController.deleteNote, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/existing', - options: { - handler: ReturnRequirementsSetupController.existing, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/existing', - options: { - handler: ReturnRequirementsSetupController.submitExisting, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/frequency-collected/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.frequencyCollected, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/frequency-collected/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitFrequencyCollected, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/frequency-reported/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.frequencyReported, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/frequency-reported/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitFrequencyReported, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/method', - options: { - handler: ReturnRequirementsSetupController.method, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/method', - options: { - handler: ReturnRequirementsSetupController.submitMethod, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/no-returns-required', - options: { - handler: ReturnRequirementsSetupController.noReturnsRequired, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/no-returns-required', - options: { - handler: ReturnRequirementsSetupController.submitNoReturnsRequired, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/note', - options: { - handler: ReturnRequirementsSetupController.note, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/note', - options: { - handler: ReturnRequirementsSetupController.submitNote, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/points/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.points, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/points/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitPoints, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/purpose/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.purpose, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/purpose/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitPurpose, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/reason', - options: { - handler: ReturnRequirementsSetupController.reason, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/reason', - options: { - handler: ReturnRequirementsSetupController.submitReason, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/remove/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.remove, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/remove/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitRemove, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/returns-cycle/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.returnsCycle, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/returns-cycle/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitReturnsCycle, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/site-description/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.siteDescription, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/site-description/{requirementIndex}', - options: { - handler: ReturnRequirementsSetupController.submitSiteDescription, - auth: { - access: { - scope: ['billing'] - } - } - } - }, - { - method: 'GET', - path: '/return-requirements/setup/{sessionId}/start-date', - options: { - handler: ReturnRequirementsSetupController.startDate, - auth: { - access: { - scope: ['billing'] - } - } - } - }, { - method: 'POST', - path: '/return-requirements/setup/{sessionId}/start-date', - options: { - handler: ReturnRequirementsSetupController.submitStartDate, - auth: { - access: { - scope: ['billing'] - } - } - } - } -] - -module.exports = routes diff --git a/app/routes/return-versions-setup.routes.js b/app/routes/return-versions-setup.routes.js new file mode 100644 index 0000000000..74b7896e4e --- /dev/null +++ b/app/routes/return-versions-setup.routes.js @@ -0,0 +1,476 @@ +'use strict' + +const ReturnVersionsSetupController = require('../controllers/return-versions-setup.controller.js') + +const routes = [ + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/abstraction-period/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.abstractionPeriod, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/abstraction-period/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitAbstractionPeriod, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/add', + options: { + handler: ReturnVersionsSetupController.add, + auth: { + access: { + scope: ['billing'] + } + } + } + + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/additional-submission-options', + options: { + handler: ReturnVersionsSetupController.additionalSubmissionOptions, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/additional-submission-options', + options: { + handler: ReturnVersionsSetupController.submitAdditionalSubmissionOptions, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/agreements-exceptions/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.agreementsExceptions, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/agreements-exceptions/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitAgreementsExceptions, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{licenceId}/approved', + options: { + handler: ReturnVersionsSetupController.approved, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/cancel', + options: { + handler: ReturnVersionsSetupController.cancel, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/cancel', + options: { + handler: ReturnVersionsSetupController.submitCancel, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/check', + options: { + handler: ReturnVersionsSetupController.check, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/check', + options: { + handler: ReturnVersionsSetupController.submitCheck, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/delete-note', + options: { + handler: ReturnVersionsSetupController.deleteNote, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/existing', + options: { + handler: ReturnVersionsSetupController.existing, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/existing', + options: { + handler: ReturnVersionsSetupController.submitExisting, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/frequency-collected/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.frequencyCollected, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/frequency-collected/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitFrequencyCollected, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/frequency-reported/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.frequencyReported, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/frequency-reported/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitFrequencyReported, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/method', + options: { + handler: ReturnVersionsSetupController.method, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/method', + options: { + handler: ReturnVersionsSetupController.submitMethod, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/no-returns-required', + options: { + handler: ReturnVersionsSetupController.noReturnsRequired, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/no-returns-required', + options: { + handler: ReturnVersionsSetupController.submitNoReturnsRequired, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/note', + options: { + handler: ReturnVersionsSetupController.note, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/note', + options: { + handler: ReturnVersionsSetupController.submitNote, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/points/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.points, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/points/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitPoints, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/purpose/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.purpose, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/purpose/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitPurpose, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/reason', + options: { + handler: ReturnVersionsSetupController.reason, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/reason', + options: { + handler: ReturnVersionsSetupController.submitReason, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/remove/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.remove, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/remove/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitRemove, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/returns-cycle/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.returnsCycle, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/returns-cycle/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitReturnsCycle, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/site-description/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.siteDescription, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'POST', + path: '/return-versions/setup/{sessionId}/site-description/{requirementIndex}', + options: { + handler: ReturnVersionsSetupController.submitSiteDescription, + auth: { + access: { + scope: ['billing'] + } + } + } + }, + { + method: 'GET', + path: '/return-versions/setup/{sessionId}/start-date', + options: { + handler: ReturnVersionsSetupController.startDate, + auth: { + access: { + scope: ['billing'] + } + } + } + }, { + method: 'POST', + path: '/return-versions/setup/{sessionId}/start-date', + options: { + handler: ReturnVersionsSetupController.submitStartDate, + auth: { + access: { + scope: ['billing'] + } + } + } + } +] + +module.exports = routes diff --git a/app/routes/return-requirements.routes.js b/app/routes/return-versions.routes.js similarity index 50% rename from app/routes/return-requirements.routes.js rename to app/routes/return-versions.routes.js index d94b4ec967..7d4fc21bd6 100644 --- a/app/routes/return-requirements.routes.js +++ b/app/routes/return-versions.routes.js @@ -1,13 +1,13 @@ 'use strict' -const ReturnRequirementsController = require('../controllers/return-requirements.controller.js') +const ReturnVersionsController = require('../controllers/return-versions.controller.js') const routes = [ { method: 'GET', - path: '/return-requirements/{id}', + path: '/return-versions/{id}', options: { - handler: ReturnRequirementsController.view, + handler: ReturnVersionsController.view, auth: { access: { scope: ['billing'] diff --git a/app/services/return-requirements/fetch-return-version.service.js b/app/services/return-versions/fetch-return-version.service.js similarity index 100% rename from app/services/return-requirements/fetch-return-version.service.js rename to app/services/return-versions/fetch-return-version.service.js diff --git a/app/services/return-requirements/setup/abstraction-period.service.js b/app/services/return-versions/setup/abstraction-period.service.js similarity index 77% rename from app/services/return-requirements/setup/abstraction-period.service.js rename to app/services/return-versions/setup/abstraction-period.service.js index 721a516a0f..3bd34de5b2 100644 --- a/app/services/return-requirements/setup/abstraction-period.service.js +++ b/app/services/return-versions/setup/abstraction-period.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/abstraction-period` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/abstraction-period` page * @module AbstractionPeriodService */ -const AbstractionPeriodPresenter = require('../../../presenters/return-requirements/setup/abstraction-period.presenter.js') +const AbstractionPeriodPresenter = require('../../../presenters/return-versions/setup/abstraction-period.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/abstraction-period` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/abstraction-period` page * * Supports generating the data needed for the abstraction period page in the return requirements setup journey. It * fetches the current session record and combines it with the date fields and other information needed for the form. diff --git a/app/services/return-requirements/setup/add.service.js b/app/services/return-versions/setup/add.service.js similarity index 100% rename from app/services/return-requirements/setup/add.service.js rename to app/services/return-versions/setup/add.service.js diff --git a/app/services/return-requirements/setup/additional-submission-options.service.js b/app/services/return-versions/setup/additional-submission-options.service.js similarity index 81% rename from app/services/return-requirements/setup/additional-submission-options.service.js rename to app/services/return-versions/setup/additional-submission-options.service.js index 6e70d00c38..9497cca926 100644 --- a/app/services/return-requirements/setup/additional-submission-options.service.js +++ b/app/services/return-versions/setup/additional-submission-options.service.js @@ -2,16 +2,16 @@ /** * Orchestrates fetching and presenting the data for - * `/return-requirements/setup/{sessionId}/additional-submission-options` page + * `/return-versions/setup/{sessionId}/additional-submission-options` page * @module AdditionalSubmissionOptionsService */ -const AdditionalSubmissionOptionsPresenter = require('../../../presenters/return-requirements/setup/additional-submission-options.presenter.js') +const AdditionalSubmissionOptionsPresenter = require('../../../presenters/return-versions/setup/additional-submission-options.presenter.js') const SessionModel = require('../../../models/session.model.js') /** * Orchestrates fetching and presenting the data for - * `/return-requirements/setup/{sessionId}/additional-submission-options` page + * `/return-versions/setup/{sessionId}/additional-submission-options` page * * Supports generating the data needed for the points page in the return requirements setup journey. It fetches the * current session record and combines it with the checkboxes and other information needed for the form. diff --git a/app/services/return-requirements/setup/agreements-exceptions.service.js b/app/services/return-versions/setup/agreements-exceptions.service.js similarity index 77% rename from app/services/return-requirements/setup/agreements-exceptions.service.js rename to app/services/return-versions/setup/agreements-exceptions.service.js index 4b1270232b..e0f35beb90 100644 --- a/app/services/return-requirements/setup/agreements-exceptions.service.js +++ b/app/services/return-versions/setup/agreements-exceptions.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/agreements-exceptions` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/agreements-exceptions` page * @module AgreementExceptionService */ -const AgreementsExceptionsPresenter = require('../../../presenters/return-requirements/setup/agreements-exceptions.presenter.js') +const AgreementsExceptionsPresenter = require('../../../presenters/return-versions/setup/agreements-exceptions.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/agreements-exceptions` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/agreements-exceptions` page * * Supports generating the data needed for the agreements and exceptions page in the return requirements setup journey. * It fetches the current session record and combines it with the date fields and other information needed for the form. diff --git a/app/services/return-requirements/setup/cancel.service.js b/app/services/return-versions/setup/cancel.service.js similarity index 72% rename from app/services/return-requirements/setup/cancel.service.js rename to app/services/return-versions/setup/cancel.service.js index 561d8e6505..0554f63662 100644 --- a/app/services/return-requirements/setup/cancel.service.js +++ b/app/services/return-versions/setup/cancel.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/cancel` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/cancel` page * @module CancelService */ -const CancelPresenter = require('../../../presenters/return-requirements/setup/cancel.presenter.js') +const CancelPresenter = require('../../../presenters/return-versions/setup/cancel.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/cancel` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/cancel` page * * Supports generating the data needed for the cancel requirements page in the return requirements setup journey. It * fetches the current session record and combines it with the date fields and other information needed for the form. diff --git a/app/services/return-requirements/setup/check/check.service.js b/app/services/return-versions/setup/check/check.service.js similarity index 76% rename from app/services/return-requirements/setup/check/check.service.js rename to app/services/return-versions/setup/check/check.service.js index 25e244a7d8..5948f9dc55 100644 --- a/app/services/return-requirements/setup/check/check.service.js +++ b/app/services/return-versions/setup/check/check.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/check` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/check` page * @module CheckService */ -const CheckPresenter = require('../../../../presenters/return-requirements/setup/check/check.presenter.js') +const CheckPresenter = require('../../../../presenters/return-versions/setup/check/check.presenter.js') const FetchPointsService = require('../fetch-points.service.js') -const ReturnRequirementsPresenter = require('../../../../presenters/return-requirements/setup/check/returns-requirements.presenter.js') +const ReturnRequirementsPresenter = require('../../../../presenters/return-versions/setup/check/returns-requirements.presenter.js') const SessionModel = require('../../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/check` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/check` page * * @param {string} sessionId - The UUID for return requirement setup session record * @param {object} yar - The Hapi `request.yar` session manager passed on by the controller diff --git a/app/services/return-requirements/setup/check/generate-return-version-requirements.service.js b/app/services/return-versions/setup/check/generate-return-version-requirements.service.js similarity index 100% rename from app/services/return-requirements/setup/check/generate-return-version-requirements.service.js rename to app/services/return-versions/setup/check/generate-return-version-requirements.service.js diff --git a/app/services/return-requirements/setup/check/generate-return-version.service.js b/app/services/return-versions/setup/check/generate-return-version.service.js similarity index 100% rename from app/services/return-requirements/setup/check/generate-return-version.service.js rename to app/services/return-versions/setup/check/generate-return-version.service.js diff --git a/app/services/return-requirements/setup/check/persist-return-version.service.js b/app/services/return-versions/setup/check/persist-return-version.service.js similarity index 100% rename from app/services/return-requirements/setup/check/persist-return-version.service.js rename to app/services/return-versions/setup/check/persist-return-version.service.js diff --git a/app/services/return-requirements/setup/check/process-existing-return-versions.service.js b/app/services/return-versions/setup/check/process-existing-return-versions.service.js similarity index 100% rename from app/services/return-requirements/setup/check/process-existing-return-versions.service.js rename to app/services/return-versions/setup/check/process-existing-return-versions.service.js diff --git a/app/services/return-requirements/setup/check/submit-check.service.js b/app/services/return-versions/setup/check/submit-check.service.js similarity index 100% rename from app/services/return-requirements/setup/check/submit-check.service.js rename to app/services/return-versions/setup/check/submit-check.service.js diff --git a/app/services/return-requirements/setup/delete-note.service.js b/app/services/return-versions/setup/delete-note.service.js similarity index 100% rename from app/services/return-requirements/setup/delete-note.service.js rename to app/services/return-versions/setup/delete-note.service.js diff --git a/app/services/return-requirements/setup/existing.service.js b/app/services/return-versions/setup/existing.service.js similarity index 70% rename from app/services/return-requirements/setup/existing.service.js rename to app/services/return-versions/setup/existing.service.js index 894d4849cf..58eb464d2a 100644 --- a/app/services/return-requirements/setup/existing.service.js +++ b/app/services/return-versions/setup/existing.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/existing` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/existing` page * @module ExistingService */ -const ExistingPresenter = require('../../../presenters/return-requirements/setup/existing.presenter.js') +const ExistingPresenter = require('../../../presenters/return-versions/setup/existing.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/existing` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/existing` page * * Supports generating the data needed for the existing page in the return requirements setup journey. It fetches the * current session record and from it determines what radio buttons to display to the user. diff --git a/app/services/return-requirements/setup/fetch-existing-requirements.js b/app/services/return-versions/setup/fetch-existing-requirements.js similarity index 100% rename from app/services/return-requirements/setup/fetch-existing-requirements.js rename to app/services/return-versions/setup/fetch-existing-requirements.js diff --git a/app/services/return-requirements/setup/fetch-points.service.js b/app/services/return-versions/setup/fetch-points.service.js similarity index 100% rename from app/services/return-requirements/setup/fetch-points.service.js rename to app/services/return-versions/setup/fetch-points.service.js diff --git a/app/services/return-requirements/setup/fetch-purposes.service.js b/app/services/return-versions/setup/fetch-purposes.service.js similarity index 82% rename from app/services/return-requirements/setup/fetch-purposes.service.js rename to app/services/return-versions/setup/fetch-purposes.service.js index 943cb997ad..9af946eb44 100644 --- a/app/services/return-requirements/setup/fetch-purposes.service.js +++ b/app/services/return-versions/setup/fetch-purposes.service.js @@ -1,14 +1,14 @@ 'use strict' /** - * Fetches a licence's purposes needed for `/return-requirements/setup/{sessionId}/purpose` page + * Fetches a licence's purposes needed for `/return-versions/setup/{sessionId}/purpose` page * @module FetchPurposesService */ const PurposeModel = require('../../../models/purpose.model.js') /** - * Fetches a licence's purposes needed for `/return-requirements/setup/{sessionId}/purpose` page + * Fetches a licence's purposes needed for `/return-versions/setup/{sessionId}/purpose` page * * @param {string} licenceId - The UUID for the licence to fetch * diff --git a/app/services/return-requirements/setup/frequency-collected.service.js b/app/services/return-versions/setup/frequency-collected.service.js similarity index 77% rename from app/services/return-requirements/setup/frequency-collected.service.js rename to app/services/return-versions/setup/frequency-collected.service.js index 72e231f5ab..85a4b8249c 100644 --- a/app/services/return-requirements/setup/frequency-collected.service.js +++ b/app/services/return-versions/setup/frequency-collected.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/frequency-collected` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/frequency-collected` page * @module FrequencyCollectedService */ -const FrequencyCollectedPresenter = require('../../../presenters/return-requirements/setup/frequency-collected.presenter.js') +const FrequencyCollectedPresenter = require('../../../presenters/return-versions/setup/frequency-collected.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/frequency-collected` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/frequency-collected` page * * Supports generating the data needed for the frequency collected page in the return requirements setup journey. It * fetches the current session record and combines it with the radio buttons and other information needed for the form. diff --git a/app/services/return-requirements/setup/frequency-reported.service.js b/app/services/return-versions/setup/frequency-reported.service.js similarity index 77% rename from app/services/return-requirements/setup/frequency-reported.service.js rename to app/services/return-versions/setup/frequency-reported.service.js index e5fce3b322..af848b99e6 100644 --- a/app/services/return-requirements/setup/frequency-reported.service.js +++ b/app/services/return-versions/setup/frequency-reported.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/frequency-reported` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/frequency-reported` page * @module FrequencyReportedService */ -const FrequencyReportedPresenter = require('../../../presenters/return-requirements/setup/frequency-reported.presenter.js') +const FrequencyReportedPresenter = require('../../../presenters/return-versions/setup/frequency-reported.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/frequency-reported` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/frequency-reported` page * * Supports generating the data needed for the frequency reported page in the return requirements setup journey. It * fetches the current session record and combines it with the radio buttons and other information needed for the form. diff --git a/app/services/return-requirements/setup/generate-from-existing-requirements.service.js b/app/services/return-versions/setup/generate-from-existing-requirements.service.js similarity index 100% rename from app/services/return-requirements/setup/generate-from-existing-requirements.service.js rename to app/services/return-versions/setup/generate-from-existing-requirements.service.js diff --git a/app/services/return-requirements/setup/initiate-session.service.js b/app/services/return-versions/setup/initiate-session.service.js similarity index 100% rename from app/services/return-requirements/setup/initiate-session.service.js rename to app/services/return-versions/setup/initiate-session.service.js diff --git a/app/services/return-requirements/setup/method/fetch-abstraction-data.service.js b/app/services/return-versions/setup/method/fetch-abstraction-data.service.js similarity index 100% rename from app/services/return-requirements/setup/method/fetch-abstraction-data.service.js rename to app/services/return-versions/setup/method/fetch-abstraction-data.service.js diff --git a/app/services/return-requirements/setup/method/generate-from-abstraction-data.service.js b/app/services/return-versions/setup/method/generate-from-abstraction-data.service.js similarity index 100% rename from app/services/return-requirements/setup/method/generate-from-abstraction-data.service.js rename to app/services/return-versions/setup/method/generate-from-abstraction-data.service.js diff --git a/app/services/return-requirements/setup/method/method.service.js b/app/services/return-versions/setup/method/method.service.js similarity index 72% rename from app/services/return-requirements/setup/method/method.service.js rename to app/services/return-versions/setup/method/method.service.js index 78e60a03fa..6a2bbb9924 100644 --- a/app/services/return-requirements/setup/method/method.service.js +++ b/app/services/return-versions/setup/method/method.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/method` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/method` page * @module MethodService */ -const MethodPresenter = require('../../../../presenters/return-requirements/setup/method.presenter.js') +const MethodPresenter = require('../../../../presenters/return-versions/setup/method.presenter.js') const SessionModel = require('../../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/method` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/method` page * * Supports generating the data needed for the select reason page in the return requirements setup journey. It * fetches the current session record and combines it with the radio buttons and other information needed for the form. diff --git a/app/services/return-requirements/setup/method/submit-method.service.js b/app/services/return-versions/setup/method/submit-method.service.js similarity index 86% rename from app/services/return-requirements/setup/method/submit-method.service.js rename to app/services/return-versions/setup/method/submit-method.service.js index 386ed64968..9d036d9ff2 100644 --- a/app/services/return-requirements/setup/method/submit-method.service.js +++ b/app/services/return-versions/setup/method/submit-method.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/method` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/method` page * @module SubmitSetupService */ const GenerateFromAbstractionDataService = require('./generate-from-abstraction-data.service.js') const SessionModel = require('../../../../models/session.model.js') -const MethodPresenter = require('../../../../presenters/return-requirements/setup/method.presenter.js') -const MethodValidator = require('../../../../validators/return-requirements/setup/method.validator.js') +const MethodPresenter = require('../../../../presenters/return-versions/setup/method.presenter.js') +const MethodValidator = require('../../../../validators/return-versions/setup/method.validator.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/method` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/method` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/no-returns-required.service.js b/app/services/return-versions/setup/no-returns-required.service.js similarity index 75% rename from app/services/return-requirements/setup/no-returns-required.service.js rename to app/services/return-versions/setup/no-returns-required.service.js index 3beca8073f..4f8c403b75 100644 --- a/app/services/return-requirements/setup/no-returns-required.service.js +++ b/app/services/return-versions/setup/no-returns-required.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/no-returns-required` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/no-returns-required` page * @module NoReturnsRequiredService */ -const NoReturnsRequiredPresenter = require('../../../presenters/return-requirements/setup/no-returns-required.presenter.js') +const NoReturnsRequiredPresenter = require('../../../presenters/return-versions/setup/no-returns-required.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/no-returns-required` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/no-returns-required` page * * Supports generating the data needed for the no returns required page in the return requirements setup journey. It * fetches the current session record and combines it with the radio buttons and other information needed for the form. diff --git a/app/services/return-requirements/setup/note.service.js b/app/services/return-versions/setup/note.service.js similarity index 71% rename from app/services/return-requirements/setup/note.service.js rename to app/services/return-versions/setup/note.service.js index b88efa3127..26cc51462a 100644 --- a/app/services/return-requirements/setup/note.service.js +++ b/app/services/return-versions/setup/note.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/note` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/note` page * @module NoteService */ -const NotePresenter = require('../../../presenters/return-requirements/setup/note.presenter.js') +const NotePresenter = require('../../../presenters/return-versions/setup/note.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/note` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/note` page * * Supports generating the data needed for the note page in the return requirements setup journey. It fetches the * current session record and combines it with textarea information needed for the form. diff --git a/app/services/return-requirements/setup/points.service.js b/app/services/return-versions/setup/points.service.js similarity index 77% rename from app/services/return-requirements/setup/points.service.js rename to app/services/return-versions/setup/points.service.js index 7320f9c062..6f8bd41715 100644 --- a/app/services/return-requirements/setup/points.service.js +++ b/app/services/return-versions/setup/points.service.js @@ -1,16 +1,16 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/points` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/points` page * @module PointsService */ const FetchPointsService = require('./fetch-points.service.js') -const PointsPresenter = require('../../../presenters/return-requirements/setup/points.presenter.js') +const PointsPresenter = require('../../../presenters/return-versions/setup/points.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/points` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/points` page * * Supports generating the data needed for the points page in the return requirements setup journey. It fetches the * current session record and combines it with the checkboxes and other information needed for the form. diff --git a/app/services/return-requirements/setup/purpose.service.js b/app/services/return-versions/setup/purpose.service.js similarity index 81% rename from app/services/return-requirements/setup/purpose.service.js rename to app/services/return-versions/setup/purpose.service.js index bc296963c2..68fe1485ce 100644 --- a/app/services/return-requirements/setup/purpose.service.js +++ b/app/services/return-versions/setup/purpose.service.js @@ -1,16 +1,16 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/purpose` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/purpose` page * @module PurposeService */ const FetchPurposesService = require('./fetch-purposes.service.js') -const SelectPurposePresenter = require('../../../presenters/return-requirements/setup/purpose.presenter.js') +const SelectPurposePresenter = require('../../../presenters/return-versions/setup/purpose.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/purpose` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/purpose` page * * Supports generating the data needed for the purpose page in the return requirements setup journey. It fetches the * current session record and combines it with the checkboxes and other information needed for the form. diff --git a/app/services/return-requirements/setup/reason.service.js b/app/services/return-versions/setup/reason.service.js similarity index 77% rename from app/services/return-requirements/setup/reason.service.js rename to app/services/return-versions/setup/reason.service.js index d51fa8f513..c6b610d183 100644 --- a/app/services/return-requirements/setup/reason.service.js +++ b/app/services/return-versions/setup/reason.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/reason` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/reason` page * @module SelectReasonService */ -const SelectReasonPresenter = require('../../../presenters/return-requirements/setup/reason.presenter.js') +const SelectReasonPresenter = require('../../../presenters/return-versions/setup/reason.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/reason` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/reason` page * * Supports generating the data needed for the select reason page in the return requirements setup journey. It * fetches the current session record and combines it with the radio buttons and other information needed for the form. diff --git a/app/services/return-requirements/setup/remove.service.js b/app/services/return-versions/setup/remove.service.js similarity index 80% rename from app/services/return-requirements/setup/remove.service.js rename to app/services/return-versions/setup/remove.service.js index 70766dfaf2..474db5f19a 100644 --- a/app/services/return-requirements/setup/remove.service.js +++ b/app/services/return-versions/setup/remove.service.js @@ -2,16 +2,16 @@ /** * Orchestrates fetching and presenting the data for - * `/return-requirements/setup/{sessionId}/remove/{requirementIndex}` page + * `/return-versions/setup/{sessionId}/remove/{requirementIndex}` page * @module RemoveService */ -const RemovePresenter = require('../../../presenters/return-requirements/setup/remove.presenter.js') +const RemovePresenter = require('../../../presenters/return-versions/setup/remove.presenter.js') const SessionModel = require('../../../models/session.model.js') /** * Orchestrates fetching and presenting the data for - * `/return-requirements/setup/{sessionId}/remove/{requirementIndex}` page + * `/return-versions/setup/{sessionId}/remove/{requirementIndex}` page * * Supports generating the data needed for the remove requirements page in the return requirements setup journey. It * fetches the current session record and combines it with the date fields and other information needed for the form. diff --git a/app/services/return-requirements/setup/returns-cycle.service.js b/app/services/return-versions/setup/returns-cycle.service.js similarity index 78% rename from app/services/return-requirements/setup/returns-cycle.service.js rename to app/services/return-versions/setup/returns-cycle.service.js index bc0b2b12e3..55aa148b17 100644 --- a/app/services/return-requirements/setup/returns-cycle.service.js +++ b/app/services/return-versions/setup/returns-cycle.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/returns-cycle` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/returns-cycle` page * @module ReturnsCycleService */ -const ReturnsCyclePresenter = require('../../../presenters/return-requirements/setup/returns-cycle.presenter.js') +const ReturnsCyclePresenter = require('../../../presenters/return-versions/setup/returns-cycle.presenter.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/returns-cycle` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/returns-cycle` page * * Supports generating the data needed for the returns cycle page in the return requirements setup journey. It fetches * the current session record and combines it with the radio buttons and other information needed for the form. diff --git a/app/services/return-requirements/setup/site-description.service.js b/app/services/return-versions/setup/site-description.service.js similarity index 78% rename from app/services/return-requirements/setup/site-description.service.js rename to app/services/return-versions/setup/site-description.service.js index f25fd52eab..86d5cc0c47 100644 --- a/app/services/return-requirements/setup/site-description.service.js +++ b/app/services/return-versions/setup/site-description.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/site-description` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/site-description` page * @module SiteDescriptionService */ const SessionModel = require('../../../models/session.model.js') -const SiteDescriptionPresenter = require('../../../presenters/return-requirements/setup/site-description.presenter.js') +const SiteDescriptionPresenter = require('../../../presenters/return-versions/setup/site-description.presenter.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/site-description` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/site-description` page * * Supports generating the data needed for the site description page in the return requirements setup journey. It * fetches the current session record and combines it with the date fields and other information needed for the form. diff --git a/app/services/return-requirements/setup/start-date.service.js b/app/services/return-versions/setup/start-date.service.js similarity index 71% rename from app/services/return-requirements/setup/start-date.service.js rename to app/services/return-versions/setup/start-date.service.js index 2716bc8f20..ab247cfaa7 100644 --- a/app/services/return-requirements/setup/start-date.service.js +++ b/app/services/return-versions/setup/start-date.service.js @@ -1,15 +1,15 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/start-date` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/start-date` page * @module StartDateService */ const SessionModel = require('../../../models/session.model.js') -const StartDatePresenter = require('../../../presenters/return-requirements/setup/start-date.presenter.js') +const StartDatePresenter = require('../../../presenters/return-versions/setup/start-date.presenter.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/setup/{sessionId}/start-date` page + * Orchestrates fetching and presenting the data for `/return-versions/setup/{sessionId}/start-date` page * * Supports generating the data needed for the start date page in the return requirements setup journey. It fetches the * current session record and combines it with the radio buttons, date fields and other information needed for the form. diff --git a/app/services/return-requirements/setup/submit-abstraction-period.service.js b/app/services/return-versions/setup/submit-abstraction-period.service.js similarity index 90% rename from app/services/return-requirements/setup/submit-abstraction-period.service.js rename to app/services/return-versions/setup/submit-abstraction-period.service.js index 145d22f293..33f25275ee 100644 --- a/app/services/return-requirements/setup/submit-abstraction-period.service.js +++ b/app/services/return-versions/setup/submit-abstraction-period.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/abstraction-period` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/abstraction-period` page * @module SubmitAbstractionPeriodService */ -const AbstractionPeriodPresenter = require('../../../presenters/return-requirements/setup/abstraction-period.presenter.js') -const AbstractionPeriodValidator = require('../../../validators/return-requirements/setup/abstraction-period.validator.js') +const AbstractionPeriodPresenter = require('../../../presenters/return-versions/setup/abstraction-period.presenter.js') +const AbstractionPeriodValidator = require('../../../validators/return-versions/setup/abstraction-period.validator.js') const GeneralLib = require('../../../lib/general.lib.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/abstraction-period` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/abstraction-period` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-additional-submission-options.service.js b/app/services/return-versions/setup/submit-additional-submission-options.service.js similarity index 88% rename from app/services/return-requirements/setup/submit-additional-submission-options.service.js rename to app/services/return-versions/setup/submit-additional-submission-options.service.js index da171a28f4..a228e0e64d 100644 --- a/app/services/return-requirements/setup/submit-additional-submission-options.service.js +++ b/app/services/return-versions/setup/submit-additional-submission-options.service.js @@ -1,16 +1,16 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/additional-submission-options` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/additional-submission-options` page * @module AdditionalSubmissionOptionsService */ -const AdditionalSubmissionOptionsPresenter = require('../../../presenters/return-requirements/setup/additional-submission-options.presenter.js') -const AdditionalSubmissionOptionsValidator = require('../../../validators/return-requirements/setup/additional-submission-options.validator.js') +const AdditionalSubmissionOptionsPresenter = require('../../../presenters/return-versions/setup/additional-submission-options.presenter.js') +const AdditionalSubmissionOptionsValidator = require('../../../validators/return-versions/setup/additional-submission-options.validator.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/additional-submission-options` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/additional-submission-options` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-agreements-exceptions.service.js b/app/services/return-versions/setup/submit-agreements-exceptions.service.js similarity index 89% rename from app/services/return-requirements/setup/submit-agreements-exceptions.service.js rename to app/services/return-versions/setup/submit-agreements-exceptions.service.js index 83ad19f411..e0063ec078 100644 --- a/app/services/return-requirements/setup/submit-agreements-exceptions.service.js +++ b/app/services/return-versions/setup/submit-agreements-exceptions.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/agreements-exceptions` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/agreements-exceptions` page * @module SubmitAgreementsExceptions */ -const AgreementsExceptionsPresenter = require('../../../presenters/return-requirements/setup/agreements-exceptions.presenter.js') -const AgreementsExceptionsValidator = require('../../../validators/return-requirements/setup/agreements-exceptions.validator.js') +const AgreementsExceptionsPresenter = require('../../../presenters/return-versions/setup/agreements-exceptions.presenter.js') +const AgreementsExceptionsValidator = require('../../../validators/return-versions/setup/agreements-exceptions.validator.js') const GeneralLib = require('../../../lib/general.lib.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/agreements-exceptions` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/agreements-exceptions` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-cancel.service.js b/app/services/return-versions/setup/submit-cancel.service.js similarity index 100% rename from app/services/return-requirements/setup/submit-cancel.service.js rename to app/services/return-versions/setup/submit-cancel.service.js diff --git a/app/services/return-requirements/setup/submit-existing.service.js b/app/services/return-versions/setup/submit-existing.service.js similarity index 82% rename from app/services/return-requirements/setup/submit-existing.service.js rename to app/services/return-versions/setup/submit-existing.service.js index 9b5c031776..dc7771441a 100644 --- a/app/services/return-requirements/setup/submit-existing.service.js +++ b/app/services/return-versions/setup/submit-existing.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/existing` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/existing` page * @module SubmitExistingService */ -const ExistingPresenter = require('../../../presenters/return-requirements/setup/existing.presenter.js') -const ExistingValidator = require('../../../validators/return-requirements/setup/existing.validator.js') +const ExistingPresenter = require('../../../presenters/return-versions/setup/existing.presenter.js') +const ExistingValidator = require('../../../validators/return-versions/setup/existing.validator.js') const GenerateFromExistingRequirementsService = require('./generate-from-existing-requirements.service.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/existing` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/existing` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-frequency-collected.service.js b/app/services/return-versions/setup/submit-frequency-collected.service.js similarity index 87% rename from app/services/return-requirements/setup/submit-frequency-collected.service.js rename to app/services/return-versions/setup/submit-frequency-collected.service.js index a3c0a26961..038fa0266f 100644 --- a/app/services/return-requirements/setup/submit-frequency-collected.service.js +++ b/app/services/return-versions/setup/submit-frequency-collected.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/frequency-collected` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/frequency-collected` page * @module SubmitFrequencyCollectedService */ -const FrequencyCollectedPresenter = require('../../../presenters/return-requirements/setup/frequency-collected.presenter.js') -const FrequencyCollectedValidator = require('../../../validators/return-requirements/setup/frequency-collected.validator.js') +const FrequencyCollectedPresenter = require('../../../presenters/return-versions/setup/frequency-collected.presenter.js') +const FrequencyCollectedValidator = require('../../../validators/return-versions/setup/frequency-collected.validator.js') const GeneralLib = require('../../../lib/general.lib.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/frequency-collected` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/frequency-collected` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-frequency-reported.service.js b/app/services/return-versions/setup/submit-frequency-reported.service.js similarity index 87% rename from app/services/return-requirements/setup/submit-frequency-reported.service.js rename to app/services/return-versions/setup/submit-frequency-reported.service.js index 76db48684a..e5c521dc6d 100644 --- a/app/services/return-requirements/setup/submit-frequency-reported.service.js +++ b/app/services/return-versions/setup/submit-frequency-reported.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/frequency-reported` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/frequency-reported` page * @module SubmitFrequencyReportedService */ -const FrequencyReportedPresenter = require('../../../presenters/return-requirements/setup/frequency-reported.presenter.js') -const FrequencyReportedValidator = require('../../../validators/return-requirements/setup/frequency-reported.validator.js') +const FrequencyReportedPresenter = require('../../../presenters/return-versions/setup/frequency-reported.presenter.js') +const FrequencyReportedValidator = require('../../../validators/return-versions/setup/frequency-reported.validator.js') const GeneralLib = require('../../../lib/general.lib.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/frequency-reported` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/frequency-reported` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-no-returns-required.service.js b/app/services/return-versions/setup/submit-no-returns-required.service.js similarity index 85% rename from app/services/return-requirements/setup/submit-no-returns-required.service.js rename to app/services/return-versions/setup/submit-no-returns-required.service.js index 034d040484..ab64607141 100644 --- a/app/services/return-requirements/setup/submit-no-returns-required.service.js +++ b/app/services/return-versions/setup/submit-no-returns-required.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/no-returns-required` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/no-returns-required` page * @module StartDateService */ -const NoReturnsRequiredPresenter = require('../../../presenters/return-requirements/setup/no-returns-required.presenter.js') -const NoReturnsRequiredValidator = require('../../../validators/return-requirements/setup/no-returns-required.validator.js') +const NoReturnsRequiredPresenter = require('../../../presenters/return-versions/setup/no-returns-required.presenter.js') +const NoReturnsRequiredValidator = require('../../../validators/return-versions/setup/no-returns-required.validator.js') const SessionModel = require('../../../models/session.model.js') const GeneralLib = require('../../../lib/general.lib.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/no-returns-required` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/no-returns-required` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-note.service.js b/app/services/return-versions/setup/submit-note.service.js similarity index 86% rename from app/services/return-requirements/setup/submit-note.service.js rename to app/services/return-versions/setup/submit-note.service.js index a49be1348a..6cd1108e87 100644 --- a/app/services/return-requirements/setup/submit-note.service.js +++ b/app/services/return-versions/setup/submit-note.service.js @@ -1,16 +1,16 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/note` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/note` page * @module SubmitNoteService */ -const NotePresenter = require('../../../presenters/return-requirements/setup/note.presenter.js') -const NoteValidator = require('../../../validators/return-requirements/setup/note.validator.js') +const NotePresenter = require('../../../presenters/return-versions/setup/note.presenter.js') +const NoteValidator = require('../../../validators/return-versions/setup/note.validator.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/note` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/note` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-points.service.js b/app/services/return-versions/setup/submit-points.service.js similarity index 87% rename from app/services/return-requirements/setup/submit-points.service.js rename to app/services/return-versions/setup/submit-points.service.js index 0113a3b430..1847d225fa 100644 --- a/app/services/return-requirements/setup/submit-points.service.js +++ b/app/services/return-versions/setup/submit-points.service.js @@ -1,18 +1,18 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/points` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/points` page * @module SubmitPointsService */ const FetchPointsService = require('./fetch-points.service.js') const GeneralLib = require('../../../lib/general.lib.js') -const PointsPresenter = require('../../../presenters/return-requirements/setup/points.presenter.js') -const PointsValidator = require('../../../validators/return-requirements/setup/points.validator.js') +const PointsPresenter = require('../../../presenters/return-versions/setup/points.presenter.js') +const PointsValidator = require('../../../validators/return-versions/setup/points.validator.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/points` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/points` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-purpose.service.js b/app/services/return-versions/setup/submit-purpose.service.js similarity index 90% rename from app/services/return-requirements/setup/submit-purpose.service.js rename to app/services/return-versions/setup/submit-purpose.service.js index 7a3bbe05aa..50c1844aaa 100644 --- a/app/services/return-requirements/setup/submit-purpose.service.js +++ b/app/services/return-versions/setup/submit-purpose.service.js @@ -1,18 +1,18 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/purpose` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/purpose` page * @module SubmitPurposeService */ const FetchPurposesService = require('./fetch-purposes.service.js') const GeneralLib = require('../../../lib/general.lib.js') -const PurposePresenter = require('../../../presenters/return-requirements/setup/purpose.presenter.js') -const PurposeValidation = require('../../../validators/return-requirements/setup/purpose.validator.js') +const PurposePresenter = require('../../../presenters/return-versions/setup/purpose.presenter.js') +const PurposeValidation = require('../../../validators/return-versions/setup/purpose.validator.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/purpose` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/purpose` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-reason.service.js b/app/services/return-versions/setup/submit-reason.service.js similarity index 83% rename from app/services/return-requirements/setup/submit-reason.service.js rename to app/services/return-versions/setup/submit-reason.service.js index 91880c44f5..e9e59add47 100644 --- a/app/services/return-requirements/setup/submit-reason.service.js +++ b/app/services/return-versions/setup/submit-reason.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/reason` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/reason` page * @module SubmitReasonService */ const GeneralLib = require('../../../lib/general.lib.js') -const ReasonPresenter = require('../../../presenters/return-requirements/setup/reason.presenter.js') -const ReasonValidator = require('../../../validators/return-requirements/setup/reason.validator.js') +const ReasonPresenter = require('../../../presenters/return-versions/setup/reason.presenter.js') +const ReasonValidator = require('../../../validators/return-versions/setup/reason.validator.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/reason` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/reason` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-remove.service.js b/app/services/return-versions/setup/submit-remove.service.js similarity index 100% rename from app/services/return-requirements/setup/submit-remove.service.js rename to app/services/return-versions/setup/submit-remove.service.js diff --git a/app/services/return-requirements/setup/submit-returns-cycle.service.js b/app/services/return-versions/setup/submit-returns-cycle.service.js similarity index 88% rename from app/services/return-requirements/setup/submit-returns-cycle.service.js rename to app/services/return-versions/setup/submit-returns-cycle.service.js index 6ca8e7a861..dcebb4afdc 100644 --- a/app/services/return-requirements/setup/submit-returns-cycle.service.js +++ b/app/services/return-versions/setup/submit-returns-cycle.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/returns-cycle` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/returns-cycle` page * @module SubmitReturnsCycleService */ const GeneralLib = require('../../../lib/general.lib.js') -const ReturnsCyclePresenter = require('../../../presenters/return-requirements/setup/returns-cycle.presenter.js') -const ReturnsCycleValidator = require('../../../validators/return-requirements/setup/returns-cycle.validator.js') +const ReturnsCyclePresenter = require('../../../presenters/return-versions/setup/returns-cycle.presenter.js') +const ReturnsCycleValidator = require('../../../validators/return-versions/setup/returns-cycle.validator.js') const SessionModel = require('../../../models/session.model.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/returns-cycle` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/returns-cycle` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-site-description.service.js b/app/services/return-versions/setup/submit-site-description.service.js similarity index 89% rename from app/services/return-requirements/setup/submit-site-description.service.js rename to app/services/return-versions/setup/submit-site-description.service.js index e00c504e1e..ee1d381b9b 100644 --- a/app/services/return-requirements/setup/submit-site-description.service.js +++ b/app/services/return-versions/setup/submit-site-description.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/site-description` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/site-description` page * @module SubmitSiteDescriptionService */ const GeneralLib = require('../../../lib/general.lib.js') const SessionModel = require('../../../models/session.model.js') -const SiteDescriptionPresenter = require('../../../presenters/return-requirements/setup/site-description.presenter.js') -const SiteDescriptionValidator = require('../../../validators/return-requirements/setup/site-description.validator.js') +const SiteDescriptionPresenter = require('../../../presenters/return-versions/setup/site-description.presenter.js') +const SiteDescriptionValidator = require('../../../validators/return-versions/setup/site-description.validator.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/site-description` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/site-description` page * * It first retrieves the session instance for the returns requirements journey in progress. * diff --git a/app/services/return-requirements/setup/submit-start-date.service.js b/app/services/return-versions/setup/submit-start-date.service.js similarity index 88% rename from app/services/return-requirements/setup/submit-start-date.service.js rename to app/services/return-versions/setup/submit-start-date.service.js index a7005269d8..dfeeed28fa 100644 --- a/app/services/return-requirements/setup/submit-start-date.service.js +++ b/app/services/return-versions/setup/submit-start-date.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/start-date` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/start-date` page * @module StartDateService */ const GeneralLib = require('../../../lib/general.lib.js') const SessionModel = require('../../../models/session.model.js') -const StartDatePresenter = require('../../../presenters/return-requirements/setup/start-date.presenter.js') -const StartDateValidator = require('../../../validators/return-requirements/setup/start-date.validator.js') +const StartDatePresenter = require('../../../presenters/return-versions/setup/start-date.presenter.js') +const StartDateValidator = require('../../../validators/return-versions/setup/start-date.validator.js') /** - * Orchestrates validating the data for `/return-requirements/setup/{sessionId}/start-date` page + * Orchestrates validating the data for `/return-versions/setup/{sessionId}/start-date` page * * It first retrieves the session instance for the returns requirements journey in progress. The session has details * about the licence that are needed to validate that the chosen date is valid. diff --git a/app/services/return-requirements/view.service.js b/app/services/return-versions/view.service.js similarity index 56% rename from app/services/return-requirements/view.service.js rename to app/services/return-versions/view.service.js index 381c05c471..e5ff2b89f2 100644 --- a/app/services/return-requirements/view.service.js +++ b/app/services/return-versions/view.service.js @@ -1,17 +1,17 @@ 'use strict' /** - * Orchestrates fetching and presenting the data for `/return-requirements/{sessionId}/view` page + * Orchestrates fetching and presenting the data for `/return-versions/{sessionId}/view` page * @module ViewService */ const FetchReturnVersionService = require('./fetch-return-version.service.js') -const ViewPresenter = require('../../presenters/return-requirements/view.presenter.js') +const ViewPresenter = require('../../presenters/return-versions/view.presenter.js') /** - * Orchestrates fetching and presenting the data for `/return-requirements/{sessionId}/view` page + * Orchestrates fetching and presenting the data for `/return-versions/{sessionId}/view` page * - * @param {string} returnVersionId - The UUID for return requirement version + * @param {string} returnVersionId - The UUID for the return version * * @returns {Promise} page data needed by the view template */ diff --git a/app/validators/return-requirements/setup/abstraction-period.validator.js b/app/validators/return-versions/setup/abstraction-period.validator.js similarity index 100% rename from app/validators/return-requirements/setup/abstraction-period.validator.js rename to app/validators/return-versions/setup/abstraction-period.validator.js diff --git a/app/validators/return-requirements/setup/additional-submission-options.validator.js b/app/validators/return-versions/setup/additional-submission-options.validator.js similarity index 100% rename from app/validators/return-requirements/setup/additional-submission-options.validator.js rename to app/validators/return-versions/setup/additional-submission-options.validator.js diff --git a/app/validators/return-requirements/setup/agreements-exceptions.validator.js b/app/validators/return-versions/setup/agreements-exceptions.validator.js similarity index 100% rename from app/validators/return-requirements/setup/agreements-exceptions.validator.js rename to app/validators/return-versions/setup/agreements-exceptions.validator.js diff --git a/app/validators/return-requirements/setup/existing.validator.js b/app/validators/return-versions/setup/existing.validator.js similarity index 100% rename from app/validators/return-requirements/setup/existing.validator.js rename to app/validators/return-versions/setup/existing.validator.js diff --git a/app/validators/return-requirements/setup/frequency-collected.validator.js b/app/validators/return-versions/setup/frequency-collected.validator.js similarity index 100% rename from app/validators/return-requirements/setup/frequency-collected.validator.js rename to app/validators/return-versions/setup/frequency-collected.validator.js diff --git a/app/validators/return-requirements/setup/frequency-reported.validator.js b/app/validators/return-versions/setup/frequency-reported.validator.js similarity index 100% rename from app/validators/return-requirements/setup/frequency-reported.validator.js rename to app/validators/return-versions/setup/frequency-reported.validator.js diff --git a/app/validators/return-requirements/setup/method.validator.js b/app/validators/return-versions/setup/method.validator.js similarity index 100% rename from app/validators/return-requirements/setup/method.validator.js rename to app/validators/return-versions/setup/method.validator.js diff --git a/app/validators/return-requirements/setup/no-returns-required.validator.js b/app/validators/return-versions/setup/no-returns-required.validator.js similarity index 100% rename from app/validators/return-requirements/setup/no-returns-required.validator.js rename to app/validators/return-versions/setup/no-returns-required.validator.js diff --git a/app/validators/return-requirements/setup/note.validator.js b/app/validators/return-versions/setup/note.validator.js similarity index 100% rename from app/validators/return-requirements/setup/note.validator.js rename to app/validators/return-versions/setup/note.validator.js diff --git a/app/validators/return-requirements/setup/points.validator.js b/app/validators/return-versions/setup/points.validator.js similarity index 100% rename from app/validators/return-requirements/setup/points.validator.js rename to app/validators/return-versions/setup/points.validator.js diff --git a/app/validators/return-requirements/setup/purpose.validator.js b/app/validators/return-versions/setup/purpose.validator.js similarity index 100% rename from app/validators/return-requirements/setup/purpose.validator.js rename to app/validators/return-versions/setup/purpose.validator.js diff --git a/app/validators/return-requirements/setup/reason.validator.js b/app/validators/return-versions/setup/reason.validator.js similarity index 100% rename from app/validators/return-requirements/setup/reason.validator.js rename to app/validators/return-versions/setup/reason.validator.js diff --git a/app/validators/return-requirements/setup/returns-cycle.validator.js b/app/validators/return-versions/setup/returns-cycle.validator.js similarity index 100% rename from app/validators/return-requirements/setup/returns-cycle.validator.js rename to app/validators/return-versions/setup/returns-cycle.validator.js diff --git a/app/validators/return-requirements/setup/site-description.validator.js b/app/validators/return-versions/setup/site-description.validator.js similarity index 100% rename from app/validators/return-requirements/setup/site-description.validator.js rename to app/validators/return-versions/setup/site-description.validator.js diff --git a/app/validators/return-requirements/setup/start-date.validator.js b/app/validators/return-versions/setup/start-date.validator.js similarity index 100% rename from app/validators/return-requirements/setup/start-date.validator.js rename to app/validators/return-versions/setup/start-date.validator.js diff --git a/app/views/return-requirements/setup/abstraction-period.njk b/app/views/return-versions/setup/abstraction-period.njk similarity index 100% rename from app/views/return-requirements/setup/abstraction-period.njk rename to app/views/return-versions/setup/abstraction-period.njk diff --git a/app/views/return-requirements/setup/additional-submission-options.njk b/app/views/return-versions/setup/additional-submission-options.njk similarity index 100% rename from app/views/return-requirements/setup/additional-submission-options.njk rename to app/views/return-versions/setup/additional-submission-options.njk diff --git a/app/views/return-requirements/setup/agreements-exceptions.njk b/app/views/return-versions/setup/agreements-exceptions.njk similarity index 100% rename from app/views/return-requirements/setup/agreements-exceptions.njk rename to app/views/return-versions/setup/agreements-exceptions.njk diff --git a/app/views/return-requirements/setup/approved.njk b/app/views/return-versions/setup/approved.njk similarity index 100% rename from app/views/return-requirements/setup/approved.njk rename to app/views/return-versions/setup/approved.njk diff --git a/app/views/return-requirements/setup/cancel.njk b/app/views/return-versions/setup/cancel.njk similarity index 100% rename from app/views/return-requirements/setup/cancel.njk rename to app/views/return-versions/setup/cancel.njk diff --git a/app/views/return-requirements/setup/check.njk b/app/views/return-versions/setup/check.njk similarity index 97% rename from app/views/return-requirements/setup/check.njk rename to app/views/return-versions/setup/check.njk index 401345ce51..63a715277c 100644 --- a/app/views/return-requirements/setup/check.njk +++ b/app/views/return-versions/setup/check.njk @@ -44,7 +44,7 @@ items: [ { html: '' + 'Change' + '', - href: "/system/return-requirements/setup/" + sessionId + "/start-date", + href: "/system/return-versions/setup/" + sessionId + "/start-date", visuallyHiddenText: "the start date for the return requirement" } ] @@ -110,7 +110,7 @@ {% endif %} {# Add another requirement button #} -
+ {{ govukButton({ @@ -309,7 +309,7 @@ classes: "govuk-button--secondary" , attributes: { 'data-test': 'remove-' + rowIndex }, preventDoubleClick: true, - href: "/system/return-requirements/setup/" + sessionId + "/remove/" + requirement.index + href: "/system/return-versions/setup/" + sessionId + "/remove/" + requirement.index }) if requirements.length >= 2 } } @@ -374,7 +374,7 @@ text: "Cancel return requirements", classes: "govuk-button--secondary", preventDoubleClick: true, - href: "/system/return-requirements/setup/" + sessionId + "/cancel" + href: "/system/return-versions/setup/" + sessionId + "/cancel" }) }}
diff --git a/app/views/return-requirements/setup/existing.njk b/app/views/return-versions/setup/existing.njk similarity index 100% rename from app/views/return-requirements/setup/existing.njk rename to app/views/return-versions/setup/existing.njk diff --git a/app/views/return-requirements/setup/frequency-collected.njk b/app/views/return-versions/setup/frequency-collected.njk similarity index 100% rename from app/views/return-requirements/setup/frequency-collected.njk rename to app/views/return-versions/setup/frequency-collected.njk diff --git a/app/views/return-requirements/setup/frequency-reported.njk b/app/views/return-versions/setup/frequency-reported.njk similarity index 100% rename from app/views/return-requirements/setup/frequency-reported.njk rename to app/views/return-versions/setup/frequency-reported.njk diff --git a/app/views/return-requirements/setup/method.njk b/app/views/return-versions/setup/method.njk similarity index 100% rename from app/views/return-requirements/setup/method.njk rename to app/views/return-versions/setup/method.njk diff --git a/app/views/return-requirements/setup/no-returns-required.njk b/app/views/return-versions/setup/no-returns-required.njk similarity index 100% rename from app/views/return-requirements/setup/no-returns-required.njk rename to app/views/return-versions/setup/no-returns-required.njk diff --git a/app/views/return-requirements/setup/note.njk b/app/views/return-versions/setup/note.njk similarity index 100% rename from app/views/return-requirements/setup/note.njk rename to app/views/return-versions/setup/note.njk diff --git a/app/views/return-requirements/setup/points.njk b/app/views/return-versions/setup/points.njk similarity index 100% rename from app/views/return-requirements/setup/points.njk rename to app/views/return-versions/setup/points.njk diff --git a/app/views/return-requirements/setup/purpose.njk b/app/views/return-versions/setup/purpose.njk similarity index 100% rename from app/views/return-requirements/setup/purpose.njk rename to app/views/return-versions/setup/purpose.njk diff --git a/app/views/return-requirements/setup/reason.njk b/app/views/return-versions/setup/reason.njk similarity index 100% rename from app/views/return-requirements/setup/reason.njk rename to app/views/return-versions/setup/reason.njk diff --git a/app/views/return-requirements/setup/remove.njk b/app/views/return-versions/setup/remove.njk similarity index 100% rename from app/views/return-requirements/setup/remove.njk rename to app/views/return-versions/setup/remove.njk diff --git a/app/views/return-requirements/setup/returns-cycle.njk b/app/views/return-versions/setup/returns-cycle.njk similarity index 100% rename from app/views/return-requirements/setup/returns-cycle.njk rename to app/views/return-versions/setup/returns-cycle.njk diff --git a/app/views/return-requirements/setup/site-description.njk b/app/views/return-versions/setup/site-description.njk similarity index 100% rename from app/views/return-requirements/setup/site-description.njk rename to app/views/return-versions/setup/site-description.njk diff --git a/app/views/return-requirements/setup/start-date.njk b/app/views/return-versions/setup/start-date.njk similarity index 100% rename from app/views/return-requirements/setup/start-date.njk rename to app/views/return-versions/setup/start-date.njk diff --git a/app/views/return-requirements/view.njk b/app/views/return-versions/view.njk similarity index 100% rename from app/views/return-requirements/view.njk rename to app/views/return-versions/view.njk diff --git a/test/controllers/licences.controller.test.js b/test/controllers/licences.controller.test.js index 3803892f1a..5df2bec1f8 100644 --- a/test/controllers/licences.controller.test.js +++ b/test/controllers/licences.controller.test.js @@ -13,7 +13,7 @@ const Boom = require('@hapi/boom') const { postRequestOptions } = require('../support/general.js') // Things we need to stub -const InitiateSessionService = require('../../app/services/return-requirements/setup/initiate-session.service.js') +const InitiateSessionService = require('../../app/services/return-versions/setup/initiate-session.service.js') const LicenceSupplementaryProcessBillingFlagService = require('../../app/services/licences/supplementary/process-billing-flag.service.js') const MarkedForSupplementaryBillingService = require('../../app/services/licences/supplementary/marked-for-supplementary-billing.service.js') const MarkForSupplementaryBillingService = require('../../app/services/licences/supplementary/mark-for-supplementary-billing.service.js') @@ -214,7 +214,7 @@ describe('Licences controller', () => { const response = await server.inject(options) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal(`/system/return-requirements/setup/${session.id}/start-date`) + expect(response.headers.location).to.equal(`/system/return-versions/setup/${session.id}/start-date`) }) }) @@ -272,7 +272,7 @@ describe('Licences controller', () => { const response = await server.inject(options) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal(`/system/return-requirements/setup/${session.id}/start-date`) + expect(response.headers.location).to.equal(`/system/return-versions/setup/${session.id}/start-date`) }) }) diff --git a/test/controllers/return-requirements-setup.controller.test.js b/test/controllers/return-versions-setup.controller.test.js similarity index 80% rename from test/controllers/return-requirements-setup.controller.test.js rename to test/controllers/return-versions-setup.controller.test.js index 96bff6e054..e15839c364 100644 --- a/test/controllers/return-requirements-setup.controller.test.js +++ b/test/controllers/return-versions-setup.controller.test.js @@ -12,38 +12,38 @@ const { expect } = Code const { postRequestOptions } = require('../support/general.js') // Things we need to stub -const AbstractionPeriodService = require('../../app/services/return-requirements/setup/abstraction-period.service.js') -const AdditionalSubmissionOptionsService = require('../../app/services/return-requirements/setup/additional-submission-options.service.js') -const AgreementsExceptionService = require('../../app/services/return-requirements/setup/agreements-exceptions.service.js') -const CancelService = require('../../app/services/return-requirements/setup/cancel.service.js') -const CheckService = require('../../app/services/return-requirements/setup/check/check.service.js') -const DeleteNoteService = require('../../app/services/return-requirements/setup/delete-note.service.js') -const ExistingService = require('../../app/services/return-requirements/setup/existing.service.js') -const FrequencyCollectedService = require('../../app/services/return-requirements/setup/frequency-collected.service.js') -const FrequencyReportedService = require('../../app/services/return-requirements/setup/frequency-reported.service.js') -const MethodService = require('../../app/services/return-requirements/setup/method/method.service.js') -const NoReturnsRequiredService = require('../../app/services/return-requirements/setup/no-returns-required.service.js') -const NoteService = require('../../app/services/return-requirements/setup/note.service.js') -const PointsService = require('../../app/services/return-requirements/setup/points.service.js') -const RemoveService = require('../../app/services/return-requirements/setup/remove.service.js') -const ReturnCycleService = require('../../app/services/return-requirements/setup/returns-cycle.service.js') -const SelectPurposeService = require('../../app/services/return-requirements/setup/purpose.service.js') -const SelectReasonService = require('../../app/services/return-requirements/setup/reason.service.js') -const SiteDescriptionService = require('../../app/services/return-requirements/setup/site-description.service.js') -const StartDateService = require('../../app/services/return-requirements/setup/start-date.service.js') -const SubmitAbstractionPeriod = require('../../app/services/return-requirements/setup/submit-abstraction-period.service.js') -const SubmitAgreementsExceptions = require('../../app/services/return-requirements/setup/submit-agreements-exceptions.service.js') -const SubmitExistingService = require('../../app/services/return-requirements/setup/submit-existing.service.js') -const SubmitFrequencyCollectedService = require('../../app/services/return-requirements/setup/submit-frequency-collected.service.js') -const SubmitFrequencyReportedService = require('../../app/services/return-requirements/setup/submit-frequency-reported.service.js') -const SubmitMethodService = require('../../app/services/return-requirements/setup/method/submit-method.service.js') -const SubmitNoReturnsRequiredService = require('../../app/services/return-requirements/setup/submit-no-returns-required.service.js') -const SubmitPointsService = require('../../app/services/return-requirements/setup/submit-points.service.js') -const SubmitPurposeService = require('../../app/services/return-requirements/setup/submit-purpose.service.js') -const SubmitReasonService = require('../../app/services/return-requirements/setup/submit-reason.service.js') -const SubmitReturnsCycleService = require('../../app/services/return-requirements/setup/submit-returns-cycle.service.js') -const SubmitSiteDescriptionService = require('../../app/services/return-requirements/setup/submit-site-description.service.js') -const SubmitStartDateService = require('../../app/services/return-requirements/setup/submit-start-date.service.js') +const AbstractionPeriodService = require('../../app/services/return-versions/setup/abstraction-period.service.js') +const AdditionalSubmissionOptionsService = require('../../app/services/return-versions/setup/additional-submission-options.service.js') +const AgreementsExceptionService = require('../../app/services/return-versions/setup/agreements-exceptions.service.js') +const CancelService = require('../../app/services/return-versions/setup/cancel.service.js') +const CheckService = require('../../app/services/return-versions/setup/check/check.service.js') +const DeleteNoteService = require('../../app/services/return-versions/setup/delete-note.service.js') +const ExistingService = require('../../app/services/return-versions/setup/existing.service.js') +const FrequencyCollectedService = require('../../app/services/return-versions/setup/frequency-collected.service.js') +const FrequencyReportedService = require('../../app/services/return-versions/setup/frequency-reported.service.js') +const MethodService = require('../../app/services/return-versions/setup/method/method.service.js') +const NoReturnsRequiredService = require('../../app/services/return-versions/setup/no-returns-required.service.js') +const NoteService = require('../../app/services/return-versions/setup/note.service.js') +const PointsService = require('../../app/services/return-versions/setup/points.service.js') +const RemoveService = require('../../app/services/return-versions/setup/remove.service.js') +const ReturnCycleService = require('../../app/services/return-versions/setup/returns-cycle.service.js') +const SelectPurposeService = require('../../app/services/return-versions/setup/purpose.service.js') +const SelectReasonService = require('../../app/services/return-versions/setup/reason.service.js') +const SiteDescriptionService = require('../../app/services/return-versions/setup/site-description.service.js') +const StartDateService = require('../../app/services/return-versions/setup/start-date.service.js') +const SubmitAbstractionPeriod = require('../../app/services/return-versions/setup/submit-abstraction-period.service.js') +const SubmitAgreementsExceptions = require('../../app/services/return-versions/setup/submit-agreements-exceptions.service.js') +const SubmitExistingService = require('../../app/services/return-versions/setup/submit-existing.service.js') +const SubmitFrequencyCollectedService = require('../../app/services/return-versions/setup/submit-frequency-collected.service.js') +const SubmitFrequencyReportedService = require('../../app/services/return-versions/setup/submit-frequency-reported.service.js') +const SubmitMethodService = require('../../app/services/return-versions/setup/method/submit-method.service.js') +const SubmitNoReturnsRequiredService = require('../../app/services/return-versions/setup/submit-no-returns-required.service.js') +const SubmitPointsService = require('../../app/services/return-versions/setup/submit-points.service.js') +const SubmitPurposeService = require('../../app/services/return-versions/setup/submit-purpose.service.js') +const SubmitReasonService = require('../../app/services/return-versions/setup/submit-reason.service.js') +const SubmitReturnsCycleService = require('../../app/services/return-versions/setup/submit-returns-cycle.service.js') +const SubmitSiteDescriptionService = require('../../app/services/return-versions/setup/submit-site-description.service.js') +const SubmitStartDateService = require('../../app/services/return-versions/setup/submit-start-date.service.js') // For running our service const { init } = require('../../app/server.js') @@ -51,7 +51,7 @@ const { init } = require('../../app/server.js') const sessionId = '64924759-8142-4a08-9d1e-1e902cd9d316' const requirementIndex = 0 -describe('Return requirements controller', () => { +describe('Return Versions controller', () => { let server beforeEach(async () => { @@ -70,7 +70,7 @@ describe('Return requirements controller', () => { Sinon.restore() }) - describe('/return-requirements/setup/{sessionId}/abstraction-period', () => { + describe('/return-versions/setup/{sessionId}/abstraction-period', () => { const path = 'abstraction-period' describe('GET', () => { @@ -111,11 +111,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitAbstractionPeriod, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/returns-cycle/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/returns-cycle/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/returns-cycle/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/returns-cycle/0') }) }) @@ -124,18 +124,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitAbstractionPeriod, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/additional-submission-options', () => { + describe('/return-versions/setup/{sessionId}/additional-submission-options', () => { const path = 'additional-submission-options' describe('GET', () => { @@ -158,7 +158,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/note', () => { + describe('/return-versions/setup/{sessionId}/note', () => { const path = 'note' describe('GET', () => { @@ -179,7 +179,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/agreements-exceptions', () => { + describe('/return-versions/setup/{sessionId}/agreements-exceptions', () => { const path = 'agreements-exceptions' describe('GET', () => { @@ -220,18 +220,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitAgreementsExceptions, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{licenceId}/approved', () => { + describe('/return-versions/setup/{licenceId}/approved', () => { const path = 'approved' describe('GET', () => { @@ -246,7 +246,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/cancel', () => { + describe('/return-versions/setup/{sessionId}/cancel', () => { const path = 'cancel' describe('GET', () => { @@ -268,7 +268,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/check', () => { + describe('/return-versions/setup/{sessionId}/check', () => { const path = 'check' describe('GET', () => { @@ -289,7 +289,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/delete-note', () => { + describe('/return-versions/setup/{sessionId}/delete-note', () => { const path = 'delete-note' describe('GET', () => { @@ -304,12 +304,12 @@ describe('Return requirements controller', () => { const result = await server.inject(_getOptions(path)) expect(result.statusCode).to.equal(302) - expect(result.headers.location).to.equal(`/system/return-requirements/setup/${sessionId}/check`) + expect(result.headers.location).to.equal(`/system/return-versions/setup/${sessionId}/check`) }) }) }) - describe('/return-requirements/setup/{sessionId}/existing', () => { + describe('/return-versions/setup/{sessionId}/existing', () => { const path = 'existing' describe('GET', () => { @@ -349,18 +349,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitExistingService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/frequency-collected', () => { + describe('/return-versions/setup/{sessionId}/frequency-collected', () => { const path = 'frequency-collected' describe('GET ', () => { @@ -400,11 +400,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitFrequencyCollectedService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/frequency-reported/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/frequency-reported/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/frequency-reported/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/frequency-reported/0') }) }) @@ -413,18 +413,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitFrequencyCollectedService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/frequency-reported', () => { + describe('/return-versions/setup/{sessionId}/frequency-reported', () => { const path = 'frequency-reported' describe('GET', () => { @@ -464,11 +464,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitFrequencyReportedService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/agreements-exceptions/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/agreements-exceptions/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/agreements-exceptions/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/agreements-exceptions/0') }) }) @@ -477,18 +477,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitFrequencyReportedService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/method', () => { + describe('/return-versions/setup/{sessionId}/method', () => { const path = 'method' describe('GET', () => { @@ -528,18 +528,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitMethodService, 'go').resolves({ redirect: 'page-data-redirect' }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/{pageData.redirect}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/{pageData.redirect}', async () => { const response = await server.inject(_postOptions(path)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/page-data-redirect') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/page-data-redirect') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/no-returns-required', () => { + describe('/return-versions/setup/{sessionId}/no-returns-required', () => { const path = 'no-returns-required' describe('GET', () => { @@ -566,11 +566,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitNoReturnsRequiredService, 'go').resolves({ }) }) - it('redirects to /system/return-requirements/{sessionId}/check', async () => { + it('redirects to /system/return-versions/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) @@ -590,7 +590,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/points', () => { + describe('/return-versions/setup/{sessionId}/points', () => { const path = 'points' describe('GET', () => { @@ -630,11 +630,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitPointsService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/abstraction-period/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/abstraction-period/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/abstraction-period/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/abstraction-period/0') }) }) @@ -643,18 +643,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitPointsService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/purpose', () => { + describe('/return-versions/setup/{sessionId}/purpose', () => { const path = 'purpose' describe('GET', () => { @@ -694,11 +694,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitPurposeService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/points/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/points/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/points/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/points/0') }) }) @@ -707,18 +707,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitPurposeService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/reason', () => { + describe('/return-versions/setup/{sessionId}/reason', () => { const path = 'reason' describe('GET', () => { @@ -758,11 +758,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitReasonService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/method', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/method', async () => { const response = await server.inject(_postOptions(path)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/method') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/method') }) }) @@ -771,18 +771,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitReasonService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/{sessionId}/check', async () => { + it('redirects to /system/return-versions/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/remove', () => { + describe('/return-versions/setup/{sessionId}/remove', () => { const path = 'remove' describe('GET', () => { @@ -803,7 +803,7 @@ describe('Return requirements controller', () => { }) }) - describe('/return-requirements/setup/{sessionId}/returns-cycle', () => { + describe('/return-versions/setup/{sessionId}/returns-cycle', () => { const path = 'returns-cycle' describe('GET', () => { @@ -843,11 +843,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitReturnsCycleService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/site-description/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/site-description/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/site-description/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/site-description/0') }) }) @@ -856,18 +856,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitReturnsCycleService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/site-description', () => { + describe('/return-versions/setup/{sessionId}/site-description', () => { const path = 'site-description' describe('GET', () => { @@ -908,11 +908,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitSiteDescriptionService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/frequency-collected/{requirementIndex}', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/frequency-collected/{requirementIndex}', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/frequency-collected/0') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/frequency-collected/0') }) }) @@ -921,18 +921,18 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitSiteDescriptionService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { const response = await server.inject(_postOptions(path, requirementIndex)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) }) }) - describe('/return-requirements/setup/{sessionId}/start-date', () => { + describe('/return-versions/setup/{sessionId}/start-date', () => { const path = 'start-date' describe('GET', () => { @@ -960,7 +960,7 @@ describe('Return requirements controller', () => { }) it('returns the page successfully with the error summary banner', async () => { - const response = await server.inject(postRequestOptions(`/return-requirements/setup/${sessionId}/${path}`)) + const response = await server.inject(postRequestOptions(`/return-versions/setup/${sessionId}/${path}`)) expect(response.statusCode).to.equal(200) expect(response.payload).to.contain('There is a problem') @@ -972,11 +972,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitStartDateService, 'go').resolves({ journey: 'returns-required' }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/reason', async () => { - const response = await server.inject(postRequestOptions(`/return-requirements/setup/${sessionId}/${path}`)) + it('redirects to /system/return-versions/setup/{sessionId}/reason', async () => { + const response = await server.inject(postRequestOptions(`/return-versions/setup/${sessionId}/${path}`)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/reason') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/reason') }) }) @@ -985,11 +985,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitStartDateService, 'go').resolves({}) }) - it('redirects to /system/return-requirements/setup/{sessionId}/no-returns-required', async () => { - const response = await server.inject(postRequestOptions(`/return-requirements/setup/${sessionId}/${path}`)) + it('redirects to /system/return-versions/setup/{sessionId}/no-returns-required', async () => { + const response = await server.inject(postRequestOptions(`/return-versions/setup/${sessionId}/${path}`)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/no-returns-required') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/no-returns-required') }) }) @@ -998,11 +998,11 @@ describe('Return requirements controller', () => { Sinon.stub(SubmitStartDateService, 'go').resolves({ checkPageVisited: true }) }) - it('redirects to /system/return-requirements/setup/{sessionId}/check', async () => { - const response = await server.inject(postRequestOptions(`/return-requirements/setup/${sessionId}/${path}`)) + it('redirects to /system/return-versions/setup/{sessionId}/check', async () => { + const response = await server.inject(postRequestOptions(`/return-versions/setup/${sessionId}/${path}`)) expect(response.statusCode).to.equal(302) - expect(response.headers.location).to.equal('/system/return-requirements/setup/' + sessionId + '/check') + expect(response.headers.location).to.equal('/system/return-versions/setup/' + sessionId + '/check') }) }) }) @@ -1011,7 +1011,7 @@ describe('Return requirements controller', () => { }) function _getOptions (path, index = -1) { - let url = `/return-requirements/setup/${sessionId}/${path}` + let url = `/return-versions/setup/${sessionId}/${path}` if (index > -1) { url = `${url}/${index}` @@ -1028,7 +1028,7 @@ function _getOptions (path, index = -1) { } function _postOptions (path, index = -1, payload) { - let url = `/return-requirements/setup/${sessionId}/${path}` + let url = `/return-versions/setup/${sessionId}/${path}` if (index > -1) { url = `${url}/${index}` diff --git a/test/controllers/return-requirements.controller.test.js b/test/controllers/return-versions.controller.test.js similarity index 86% rename from test/controllers/return-requirements.controller.test.js rename to test/controllers/return-versions.controller.test.js index df8c0b3ffa..d96377a646 100644 --- a/test/controllers/return-requirements.controller.test.js +++ b/test/controllers/return-versions.controller.test.js @@ -9,12 +9,12 @@ const { describe, it, beforeEach, afterEach } = exports.lab = Lab.script() const { expect } = Code // Things we need to stub -const ViewService = require('../../app/services/return-requirements/view.service.js') +const ViewService = require('../../app/services/return-versions/view.service.js') // For running our service const { init } = require('../../app/server.js') -describe('Return requirements controller', () => { +describe('Return Versions controller', () => { let server beforeEach(async () => { @@ -33,7 +33,7 @@ describe('Return requirements controller', () => { Sinon.restore() }) - describe('/return-requirements/{id}', () => { + describe('/return-versions/{id}', () => { const id = '2a075724-b66c-410e-9fc8-b964077204f2' describe('GET', () => { @@ -47,7 +47,7 @@ describe('Return requirements controller', () => { it('returns the page successfully', async () => { const response = await server.inject({ method: 'GET', - url: `/return-requirements/${id}/`, + url: `/return-versions/${id}/`, auth: { strategy: 'session', credentials: { scope: ['billing'] } diff --git a/test/presenters/licences/view-licence-history.presenter.test.js b/test/presenters/licences/view-licence-history.presenter.test.js index d617c306c7..f2496961eb 100644 --- a/test/presenters/licences/view-licence-history.presenter.test.js +++ b/test/presenters/licences/view-licence-history.presenter.test.js @@ -61,7 +61,7 @@ describe('View Licence History presenter', () => { dateCreated: '5 April 2021', displayNote: true, notes: ['Test note'], - link: '/system/return-requirements/3f09ce0b-288c-4c0b-b519-7329fe70a6cc', + link: '/system/return-versions/3f09ce0b-288c-4c0b-b519-7329fe70a6cc', reason: 'New licence', type: { index: 2, name: 'Return version' } } @@ -131,7 +131,7 @@ describe('View Licence History presenter', () => { it('returns the return version link', () => { const result = ViewLicenceHistoryPresenter.go(licence) - expect(result.entries[2].link).to.equal('/system/return-requirements/3f09ce0b-288c-4c0b-b519-7329fe70a6cc') + expect(result.entries[2].link).to.equal('/system/return-versions/3f09ce0b-288c-4c0b-b519-7329fe70a6cc') }) }) }) diff --git a/test/presenters/licences/view-licence-set-up.presenter.test.js b/test/presenters/licences/view-licence-set-up.presenter.test.js index 2539b8c61d..eaf44f9209 100644 --- a/test/presenters/licences/view-licence-set-up.presenter.test.js +++ b/test/presenters/licences/view-licence-set-up.presenter.test.js @@ -617,7 +617,7 @@ describe('View Licence Set Up presenter', () => { { action: [ { - link: '/system/return-requirements/0312e5eb-67ae-44fb-922c-b1a0b81bc08d', + link: '/system/return-versions/0312e5eb-67ae-44fb-922c-b1a0b81bc08d', text: 'View' } ], @@ -645,7 +645,7 @@ describe('View Licence Set Up presenter', () => { { action: [ { - link: '/system/return-requirements/0312e5eb-67ae-44fb-922c-b1a0b81bc08d', + link: '/system/return-versions/0312e5eb-67ae-44fb-922c-b1a0b81bc08d', text: 'View' } ], diff --git a/test/presenters/return-requirements/setup/abstraction-period.presenter.test.js b/test/presenters/return-versions/setup/abstraction-period.presenter.test.js similarity index 85% rename from test/presenters/return-requirements/setup/abstraction-period.presenter.test.js rename to test/presenters/return-versions/setup/abstraction-period.presenter.test.js index 7daf475d62..22362fa758 100644 --- a/test/presenters/return-requirements/setup/abstraction-period.presenter.test.js +++ b/test/presenters/return-versions/setup/abstraction-period.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const AbstractionPeriodPresenter = require('../../../../app/presenters/return-requirements/setup/abstraction-period.presenter.js') +const AbstractionPeriodPresenter = require('../../../../app/presenters/return-versions/setup/abstraction-period.presenter.js') -describe('Return Requirements Setup - Abstraction Period presenter', () => { +describe('Return Versions Setup - Abstraction Period presenter', () => { const requirementIndex = 0 let session @@ -40,7 +40,7 @@ describe('Return Requirements Setup - Abstraction Period presenter', () => { expect(result).to.equal({ abstractionPeriod: null, - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/points/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/points/0', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', sessionId: '61e07498-f309-4829-96a9-72084a54996d' @@ -89,7 +89,7 @@ describe('Return Requirements Setup - Abstraction Period presenter', () => { it('returns a link back to the "check" page', () => { const result = AbstractionPeriodPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -97,7 +97,7 @@ describe('Return Requirements Setup - Abstraction Period presenter', () => { it('returns a link back to the "points" page', () => { const result = AbstractionPeriodPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/points/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/points/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/additional-submission-options.presenter.test.js b/test/presenters/return-versions/setup/additional-submission-options.presenter.test.js similarity index 86% rename from test/presenters/return-requirements/setup/additional-submission-options.presenter.test.js rename to test/presenters/return-versions/setup/additional-submission-options.presenter.test.js index ce86739950..bcf0ade848 100644 --- a/test/presenters/return-requirements/setup/additional-submission-options.presenter.test.js +++ b/test/presenters/return-versions/setup/additional-submission-options.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const AdditionalSubmissionOptionsPresenter = require('../../../../app/presenters/return-requirements/setup/additional-submission-options.presenter.js') +const AdditionalSubmissionOptionsPresenter = require('../../../../app/presenters/return-versions/setup/additional-submission-options.presenter.js') -describe('Return Requirements Setup - Additional Submission Options presenter', () => { +describe('Return Versions Setup - Additional Submission Options presenter', () => { let session beforeEach(() => { @@ -37,7 +37,7 @@ describe('Return Requirements Setup - Additional Submission Options presenter', const result = AdditionalSubmissionOptionsPresenter.go(session) expect(result).to.be.equal({ - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', additionalSubmissionOptions: [], licenceRef: '01/ABC', @@ -50,7 +50,7 @@ describe('Return Requirements Setup - Additional Submission Options presenter', it('returns a link back to the "check" page', () => { const result = AdditionalSubmissionOptionsPresenter.go(session) - expect(result.backLink).to.equal(`/system/return-requirements/setup/${session.id}/check`) + expect(result.backLink).to.equal(`/system/return-versions/setup/${session.id}/check`) }) }) diff --git a/test/presenters/return-requirements/setup/agreements-exceptions.presenter.test.js b/test/presenters/return-versions/setup/agreements-exceptions.presenter.test.js similarity index 83% rename from test/presenters/return-requirements/setup/agreements-exceptions.presenter.test.js rename to test/presenters/return-versions/setup/agreements-exceptions.presenter.test.js index f9a2a09140..dd115ff322 100644 --- a/test/presenters/return-requirements/setup/agreements-exceptions.presenter.test.js +++ b/test/presenters/return-versions/setup/agreements-exceptions.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const AgreementsExceptionsPresenter = require('../../../../app/presenters/return-requirements/setup/agreements-exceptions.presenter.js') +const AgreementsExceptionsPresenter = require('../../../../app/presenters/return-versions/setup/agreements-exceptions.presenter.js') -describe('Return Requirements Setup - Agreements Exceptions presenter', () => { +describe('Return Versions Setup - Agreements Exceptions presenter', () => { const requirementIndex = 0 let session @@ -40,7 +40,7 @@ describe('Return Requirements Setup - Agreements Exceptions presenter', () => { expect(result).to.equal({ agreementsExceptions: null, - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-reported/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-reported/0', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', sessionId: '61e07498-f309-4829-96a9-72084a54996d' @@ -79,7 +79,7 @@ describe('Return Requirements Setup - Agreements Exceptions presenter', () => { it('returns a link back to the "check" page', () => { const result = AgreementsExceptionsPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -87,7 +87,7 @@ describe('Return Requirements Setup - Agreements Exceptions presenter', () => { it('returns a link back to the "frequency-reported" page', () => { const result = AgreementsExceptionsPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-reported/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-reported/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/cancel.presenter.test.js b/test/presenters/return-versions/setup/cancel.presenter.test.js similarity index 94% rename from test/presenters/return-requirements/setup/cancel.presenter.test.js rename to test/presenters/return-versions/setup/cancel.presenter.test.js index 9c02fed1ae..bcb7e406aa 100644 --- a/test/presenters/return-requirements/setup/cancel.presenter.test.js +++ b/test/presenters/return-versions/setup/cancel.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const CancelPresenter = require('../../../../app/presenters/return-requirements/setup/cancel.presenter.js') +const CancelPresenter = require('../../../../app/presenters/return-versions/setup/cancel.presenter.js') -describe('Return Requirements Setup - Cancel presenter', () => { +describe('Return Versions Setup - Cancel presenter', () => { let session beforeEach(() => { @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Cancel presenter', () => { const result = CancelPresenter.go(session) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', reason: 'Major change', diff --git a/test/presenters/return-requirements/setup/check/check.presenter.test.js b/test/presenters/return-versions/setup/check/check.presenter.test.js similarity index 91% rename from test/presenters/return-requirements/setup/check/check.presenter.test.js rename to test/presenters/return-versions/setup/check/check.presenter.test.js index 41163f70b5..a76f007fdc 100644 --- a/test/presenters/return-requirements/setup/check/check.presenter.test.js +++ b/test/presenters/return-versions/setup/check/check.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const CheckPresenter = require('../../../../../app/presenters/return-requirements/setup/check/check.presenter.js') +const CheckPresenter = require('../../../../../app/presenters/return-versions/setup/check/check.presenter.js') -describe('Return Requirements Setup - Check presenter', () => { +describe('Return Versions Setup - Check presenter', () => { let session beforeEach(() => { @@ -49,7 +49,7 @@ describe('Return Requirements Setup - Check presenter', () => { }, pageTitle: 'Check the requirements for returns for Turbo Kid', reason: 'Major change', - reasonLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/reason', + reasonLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/reason', sessionId: '61e07498-f309-4829-96a9-72084a54996d', startDate: '1 January 2023' }) @@ -143,7 +143,7 @@ describe('Return Requirements Setup - Check presenter', () => { it('returns a link to the "reason" page', () => { const result = CheckPresenter.go(session) - expect(result.reasonLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/reason') + expect(result.reasonLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/reason') }) }) @@ -155,7 +155,7 @@ describe('Return Requirements Setup - Check presenter', () => { it('returns a link to the "no-returns-required" page', () => { const result = CheckPresenter.go(session) - expect(result.reasonLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/no-returns-required') + expect(result.reasonLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/no-returns-required') }) }) }) diff --git a/test/presenters/return-requirements/setup/check/returns-requirements.presenter.test.js b/test/presenters/return-versions/setup/check/returns-requirements.presenter.test.js similarity index 98% rename from test/presenters/return-requirements/setup/check/returns-requirements.presenter.test.js rename to test/presenters/return-versions/setup/check/returns-requirements.presenter.test.js index dee6eaf71e..6287f151c4 100644 --- a/test/presenters/return-requirements/setup/check/returns-requirements.presenter.test.js +++ b/test/presenters/return-versions/setup/check/returns-requirements.presenter.test.js @@ -11,9 +11,9 @@ const { expect } = Code const PointModel = require('../../../../../app/models/point.model.js') // Thing under test -const ReturnRequirementsPresenter = require('../../../../../app/presenters/return-requirements/setup/check/returns-requirements.presenter.js') +const ReturnRequirementsPresenter = require('../../../../../app/presenters/return-versions/setup/check/returns-requirements.presenter.js') -describe('Return Requirements Setup - Return Requirements presenter', () => { +describe('Return Versions Setup - Return Requirements presenter', () => { let journey let point let requirement diff --git a/test/presenters/return-requirements/setup/existing.presenter.test.js b/test/presenters/return-versions/setup/existing.presenter.test.js similarity index 97% rename from test/presenters/return-requirements/setup/existing.presenter.test.js rename to test/presenters/return-versions/setup/existing.presenter.test.js index 5797a934a9..ca9569b876 100644 --- a/test/presenters/return-requirements/setup/existing.presenter.test.js +++ b/test/presenters/return-versions/setup/existing.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const ExistingPresenter = require('../../../../app/presenters/return-requirements/setup/existing.presenter.js') +const ExistingPresenter = require('../../../../app/presenters/return-versions/setup/existing.presenter.js') -describe('Return Requirements Setup - Existing presenter', () => { +describe('Return Versions Setup - Existing presenter', () => { let session beforeEach(() => { diff --git a/test/presenters/return-requirements/setup/frequency-collected.presenter.test.js b/test/presenters/return-versions/setup/frequency-collected.presenter.test.js similarity index 83% rename from test/presenters/return-requirements/setup/frequency-collected.presenter.test.js rename to test/presenters/return-versions/setup/frequency-collected.presenter.test.js index 811fc07489..c798a0916d 100644 --- a/test/presenters/return-requirements/setup/frequency-collected.presenter.test.js +++ b/test/presenters/return-versions/setup/frequency-collected.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const FrequencyCollectedPresenter = require('../../../../app/presenters/return-requirements/setup/frequency-collected.presenter.js') +const FrequencyCollectedPresenter = require('../../../../app/presenters/return-versions/setup/frequency-collected.presenter.js') -describe('Return Requirements Setup - Frequency Collected presenter', () => { +describe('Return Versions Setup - Frequency Collected presenter', () => { const requirementIndex = 0 let session @@ -39,7 +39,7 @@ describe('Return Requirements Setup - Frequency Collected presenter', () => { const result = FrequencyCollectedPresenter.go(session, requirementIndex) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/site-description/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/site-description/0', frequencyCollected: null, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Frequency Collected presenter', () => { it('returns a link back to the "check" page', () => { const result = FrequencyCollectedPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -65,7 +65,7 @@ describe('Return Requirements Setup - Frequency Collected presenter', () => { it('returns a link back to the "site-description" page', () => { const result = FrequencyCollectedPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/site-description/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/site-description/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/frequency-reported.presenter.test.js b/test/presenters/return-versions/setup/frequency-reported.presenter.test.js similarity index 83% rename from test/presenters/return-requirements/setup/frequency-reported.presenter.test.js rename to test/presenters/return-versions/setup/frequency-reported.presenter.test.js index 5c7ee3f842..1638c3dc10 100644 --- a/test/presenters/return-requirements/setup/frequency-reported.presenter.test.js +++ b/test/presenters/return-versions/setup/frequency-reported.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const FrequencyReportedPresenter = require('../../../../app/presenters/return-requirements/setup/frequency-reported.presenter.js') +const FrequencyReportedPresenter = require('../../../../app/presenters/return-versions/setup/frequency-reported.presenter.js') -describe('Return Requirements Setup - Frequency Reported presenter', () => { +describe('Return Versions Setup - Frequency Reported presenter', () => { const requirementIndex = 0 let session @@ -39,7 +39,7 @@ describe('Return Requirements Setup - Frequency Reported presenter', () => { const result = FrequencyReportedPresenter.go(session, requirementIndex) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-collected/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-collected/0', frequencyReported: null, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Frequency Reported presenter', () => { it('returns a link back to the "check" page', () => { const result = FrequencyReportedPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -65,7 +65,7 @@ describe('Return Requirements Setup - Frequency Reported presenter', () => { it('returns a link back to the "frequency-collected" page', () => { const result = FrequencyReportedPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-collected/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/frequency-collected/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/method.presenter.test.js b/test/presenters/return-versions/setup/method.presenter.test.js similarity index 89% rename from test/presenters/return-requirements/setup/method.presenter.test.js rename to test/presenters/return-versions/setup/method.presenter.test.js index 0d5348ea75..fe553da941 100644 --- a/test/presenters/return-requirements/setup/method.presenter.test.js +++ b/test/presenters/return-versions/setup/method.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const MethodPresenter = require('../../../../app/presenters/return-requirements/setup/method.presenter.js') +const MethodPresenter = require('../../../../app/presenters/return-versions/setup/method.presenter.js') -describe('Return Requirements Setup - Method presenter', () => { +describe('Return Versions Setup - Method presenter', () => { let session beforeEach(() => { @@ -42,7 +42,7 @@ describe('Return Requirements Setup - Method presenter', () => { const result = MethodPresenter.go(session) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/reason', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/reason', displayCopyExisting: true, licenceRef: '01/ABC', sessionId: '61e07498-f309-4829-96a9-72084a54996d', @@ -55,7 +55,7 @@ describe('Return Requirements Setup - Method presenter', () => { it('returns a link back to the "start-date" page', () => { const result = MethodPresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/reason') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/reason') }) }) diff --git a/test/presenters/return-requirements/setup/no-returns-required.presenter.test.js b/test/presenters/return-versions/setup/no-returns-required.presenter.test.js similarity index 82% rename from test/presenters/return-requirements/setup/no-returns-required.presenter.test.js rename to test/presenters/return-versions/setup/no-returns-required.presenter.test.js index 3cd66f32cc..151e78ad92 100644 --- a/test/presenters/return-requirements/setup/no-returns-required.presenter.test.js +++ b/test/presenters/return-versions/setup/no-returns-required.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const NoReturnsRequiredPresenter = require('../../../../app/presenters/return-requirements/setup/no-returns-required.presenter.js') +const NoReturnsRequiredPresenter = require('../../../../app/presenters/return-versions/setup/no-returns-required.presenter.js') -describe('Return Requirements Setup - No Returns Required presenter', () => { +describe('Return Versions Setup - No Returns Required presenter', () => { let session beforeEach(() => { @@ -36,7 +36,7 @@ describe('Return Requirements Setup - No Returns Required presenter', () => { const result = NoReturnsRequiredPresenter.go(session) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/start-date', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/start-date', licenceRef: '01/ABC', reason: null, sessionId: '61e07498-f309-4829-96a9-72084a54996d' @@ -53,7 +53,7 @@ describe('Return Requirements Setup - No Returns Required presenter', () => { it('returns a link back to the "check" page', () => { const result = NoReturnsRequiredPresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -61,7 +61,7 @@ describe('Return Requirements Setup - No Returns Required presenter', () => { it('returns a link back to the "start-date" page', () => { const result = NoReturnsRequiredPresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/start-date') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/start-date') }) }) }) diff --git a/test/presenters/return-requirements/setup/note.presenter.test.js b/test/presenters/return-versions/setup/note.presenter.test.js similarity index 86% rename from test/presenters/return-requirements/setup/note.presenter.test.js rename to test/presenters/return-versions/setup/note.presenter.test.js index 8e493fd9cc..d0859dc277 100644 --- a/test/presenters/return-requirements/setup/note.presenter.test.js +++ b/test/presenters/return-versions/setup/note.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const NotePresenter = require('../../../../app/presenters/return-requirements/setup/note.presenter.js') +const NotePresenter = require('../../../../app/presenters/return-versions/setup/note.presenter.js') -describe('Return Requirements Setup - Note presenter', () => { +describe('Return Versions Setup - Note presenter', () => { let session beforeEach(() => { @@ -37,7 +37,7 @@ describe('Return Requirements Setup - Note presenter', () => { const result = NotePresenter.go(session) expect(result).to.be.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check', licenceRef: '01/ABC', note: null, sessionId: '61e07498-f309-4829-96a9-72084a54996d' @@ -49,7 +49,7 @@ describe('Return Requirements Setup - Note presenter', () => { it('returns a link back to the "check" page', () => { const result = NotePresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) diff --git a/test/presenters/return-requirements/setup/points.presenter.test.js b/test/presenters/return-versions/setup/points.presenter.test.js similarity index 92% rename from test/presenters/return-requirements/setup/points.presenter.test.js rename to test/presenters/return-versions/setup/points.presenter.test.js index 11eb5c2fd3..887c9f6528 100644 --- a/test/presenters/return-requirements/setup/points.presenter.test.js +++ b/test/presenters/return-versions/setup/points.presenter.test.js @@ -11,9 +11,9 @@ const { expect } = Code const PointModel = require('../../../../app/models/point.model.js') // Thing under test -const PointsPresenter = require('../../../../app/presenters/return-requirements/setup/points.presenter.js') +const PointsPresenter = require('../../../../app/presenters/return-versions/setup/points.presenter.js') -describe('Return Requirements Setup - Points presenter', () => { +describe('Return Versions Setup - Points presenter', () => { const requirementIndex = 0 let points @@ -45,7 +45,7 @@ describe('Return Requirements Setup - Points presenter', () => { const result = PointsPresenter.go(session, requirementIndex, points) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/purpose/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/purpose/0', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licencePoints: [{ id: 'd03d7d7c-4e33-4b4d-ac9b-6ebac9a5e5f6', @@ -73,7 +73,7 @@ describe('Return Requirements Setup - Points presenter', () => { it('returns a link back to the "check" page', () => { const result = PointsPresenter.go(session, requirementIndex, points) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -81,7 +81,7 @@ describe('Return Requirements Setup - Points presenter', () => { it('returns a link back to the "purpose" page', () => { const result = PointsPresenter.go(session, requirementIndex, points) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/purpose/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/purpose/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/purpose.presenter.test.js b/test/presenters/return-versions/setup/purpose.presenter.test.js similarity index 91% rename from test/presenters/return-requirements/setup/purpose.presenter.test.js rename to test/presenters/return-versions/setup/purpose.presenter.test.js index ff5ca95346..a5b81a346e 100644 --- a/test/presenters/return-requirements/setup/purpose.presenter.test.js +++ b/test/presenters/return-versions/setup/purpose.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const PurposePresenter = require('../../../../app/presenters/return-requirements/setup/purpose.presenter.js') +const PurposePresenter = require('../../../../app/presenters/return-versions/setup/purpose.presenter.js') -describe('Return Requirements Setup - Purpose presenter', () => { +describe('Return Versions Setup - Purpose presenter', () => { const requirementIndex = 0 let licencePurposes @@ -47,7 +47,7 @@ describe('Return Requirements Setup - Purpose presenter', () => { const result = PurposePresenter.go(session, requirementIndex, licencePurposes) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/method', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/method', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', purposes: [ @@ -71,7 +71,7 @@ describe('Return Requirements Setup - Purpose presenter', () => { it('returns a link back to the "check" page', () => { const result = PurposePresenter.go(session, requirementIndex, licencePurposes) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -86,7 +86,7 @@ describe('Return Requirements Setup - Purpose presenter', () => { it('returns a link back to the "check" page', () => { const result = PurposePresenter.go(session, requirementIndex, licencePurposes) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) }) @@ -95,7 +95,7 @@ describe('Return Requirements Setup - Purpose presenter', () => { it('returns a link back to the "method" page', () => { const result = PurposePresenter.go(session, requirementIndex, licencePurposes) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/method') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/method') }) }) }) diff --git a/test/presenters/return-requirements/setup/reason.presenter.test.js b/test/presenters/return-versions/setup/reason.presenter.test.js similarity index 83% rename from test/presenters/return-requirements/setup/reason.presenter.test.js rename to test/presenters/return-versions/setup/reason.presenter.test.js index dba54f7aae..77a3c0f1f1 100644 --- a/test/presenters/return-requirements/setup/reason.presenter.test.js +++ b/test/presenters/return-versions/setup/reason.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const ReasonPresenter = require('../../../../app/presenters/return-requirements/setup/reason.presenter.js') +const ReasonPresenter = require('../../../../app/presenters/return-versions/setup/reason.presenter.js') -describe('Return Requirements Setup - Reason presenter', () => { +describe('Return Versions Setup - Reason presenter', () => { let session beforeEach(() => { @@ -36,7 +36,7 @@ describe('Return Requirements Setup - Reason presenter', () => { const result = ReasonPresenter.go(session) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/start-date', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/start-date', licenceRef: '01/ABC', reason: null, sessionId: '61e07498-f309-4829-96a9-72084a54996d' @@ -53,7 +53,7 @@ describe('Return Requirements Setup - Reason presenter', () => { it('returns a link back to the "check" page', () => { const result = ReasonPresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -61,7 +61,7 @@ describe('Return Requirements Setup - Reason presenter', () => { it('returns a link back to the "start-date" page', () => { const result = ReasonPresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/start-date') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/start-date') }) }) }) diff --git a/test/presenters/return-requirements/setup/remove.presenter.test.js b/test/presenters/return-versions/setup/remove.presenter.test.js similarity index 91% rename from test/presenters/return-requirements/setup/remove.presenter.test.js rename to test/presenters/return-versions/setup/remove.presenter.test.js index ea6d10df11..5799481c3c 100644 --- a/test/presenters/return-requirements/setup/remove.presenter.test.js +++ b/test/presenters/return-versions/setup/remove.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const RemovePresenter = require('../../../../app/presenters/return-requirements/setup/remove.presenter.js') +const RemovePresenter = require('../../../../app/presenters/return-versions/setup/remove.presenter.js') -describe('Return Requirements Setup - Remove presenter', () => { +describe('Return Versions Setup - Remove presenter', () => { const requirementIndex = 0 let session @@ -59,7 +59,7 @@ describe('Return Requirements Setup - Remove presenter', () => { const result = RemovePresenter.go(session, requirementIndex) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', returnRequirement: 'Winter and all year monthly requirements for returns, Bore hole in rear field.', @@ -73,7 +73,7 @@ describe('Return Requirements Setup - Remove presenter', () => { it('returns a link back to the "setup" page', () => { const result = RemovePresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) diff --git a/test/presenters/return-requirements/setup/returns-cycle.presenter.test.js b/test/presenters/return-versions/setup/returns-cycle.presenter.test.js similarity index 83% rename from test/presenters/return-requirements/setup/returns-cycle.presenter.test.js rename to test/presenters/return-versions/setup/returns-cycle.presenter.test.js index c075b074ca..360bc5c0e1 100644 --- a/test/presenters/return-requirements/setup/returns-cycle.presenter.test.js +++ b/test/presenters/return-versions/setup/returns-cycle.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const ReturnsCyclePresenter = require('../../../../app/presenters/return-requirements/setup/returns-cycle.presenter.js') +const ReturnsCyclePresenter = require('../../../../app/presenters/return-versions/setup/returns-cycle.presenter.js') -describe('Return Requirements Setup - Returns Cycle presenter', () => { +describe('Return Versions Setup - Returns Cycle presenter', () => { const requirementIndex = 0 let session @@ -39,7 +39,7 @@ describe('Return Requirements Setup - Returns Cycle presenter', () => { const result = ReturnsCyclePresenter.go(session, requirementIndex) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/abstraction-period/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/abstraction-period/0', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', returnsCycle: null, @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Returns Cycle presenter', () => { it('returns a link back to the "check" page', () => { const result = ReturnsCyclePresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -65,7 +65,7 @@ describe('Return Requirements Setup - Returns Cycle presenter', () => { it('returns a link back to the "abstraction-period" page', () => { const result = ReturnsCyclePresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/abstraction-period/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/abstraction-period/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/site-description.presenter.test.js b/test/presenters/return-versions/setup/site-description.presenter.test.js similarity index 84% rename from test/presenters/return-requirements/setup/site-description.presenter.test.js rename to test/presenters/return-versions/setup/site-description.presenter.test.js index 1308b32fd6..0d538130b3 100644 --- a/test/presenters/return-requirements/setup/site-description.presenter.test.js +++ b/test/presenters/return-versions/setup/site-description.presenter.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const SiteDescriptionPresenter = require('../../../../app/presenters/return-requirements/setup/site-description.presenter.js') +const SiteDescriptionPresenter = require('../../../../app/presenters/return-versions/setup/site-description.presenter.js') -describe('Return Requirements Setup - Site Description presenter', () => { +describe('Return Versions Setup - Site Description presenter', () => { const requirementIndex = 0 let session @@ -39,7 +39,7 @@ describe('Return Requirements Setup - Site Description presenter', () => { const result = SiteDescriptionPresenter.go(session, requirementIndex) expect(result).to.equal({ - backLink: '/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/returns-cycle/0', + backLink: '/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/returns-cycle/0', licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', sessionId: '61e07498-f309-4829-96a9-72084a54996d', @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Site Description presenter', () => { it('returns a link back to the "check" page', () => { const result = SiteDescriptionPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) @@ -65,7 +65,7 @@ describe('Return Requirements Setup - Site Description presenter', () => { it('returns a link back to the "returns-cycle" page', () => { const result = SiteDescriptionPresenter.go(session, requirementIndex) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/returns-cycle/0') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/returns-cycle/0') }) }) }) diff --git a/test/presenters/return-requirements/setup/start-date.presenter.test.js b/test/presenters/return-versions/setup/start-date.presenter.test.js similarity index 94% rename from test/presenters/return-requirements/setup/start-date.presenter.test.js rename to test/presenters/return-versions/setup/start-date.presenter.test.js index 34814f70d5..96c4e2511e 100644 --- a/test/presenters/return-requirements/setup/start-date.presenter.test.js +++ b/test/presenters/return-versions/setup/start-date.presenter.test.js @@ -10,9 +10,9 @@ const { expect } = Code // Thing under test const FeatureFlagsConfig = require('../../../../config/feature-flags.config.js') -const StartDatePresenter = require('../../../../app/presenters/return-requirements/setup/start-date.presenter.js') +const StartDatePresenter = require('../../../../app/presenters/return-versions/setup/start-date.presenter.js') -describe('Return Requirements Setup - Start Date presenter', () => { +describe('Return Versions Setup - Start Date presenter', () => { let session beforeEach(async () => { @@ -61,7 +61,7 @@ describe('Return Requirements Setup - Start Date presenter', () => { it('returns a link back to the "check" page', () => { const result = StartDatePresenter.go(session) - expect(result.backLink).to.equal('/system/return-requirements/setup/61e07498-f309-4829-96a9-72084a54996d/check') + expect(result.backLink).to.equal('/system/return-versions/setup/61e07498-f309-4829-96a9-72084a54996d/check') }) }) diff --git a/test/presenters/return-requirements/view.presenter.test.js b/test/presenters/return-versions/view.presenter.test.js similarity index 98% rename from test/presenters/return-requirements/view.presenter.test.js rename to test/presenters/return-versions/view.presenter.test.js index 0b3c8148d9..976934318d 100644 --- a/test/presenters/return-requirements/view.presenter.test.js +++ b/test/presenters/return-versions/view.presenter.test.js @@ -14,9 +14,9 @@ const PointModel = require('../../../app/models/point.model.js') const ReturnVersionModel = require('../../../app/models/return-version.model.js') // Thing under test -const ViewPresenter = require('../../../app/presenters/return-requirements/view.presenter.js') +const ViewPresenter = require('../../../app/presenters/return-versions/view.presenter.js') -describe('Return Requirements - View presenter', () => { +describe('Return Versions - View presenter', () => { let returnVersion beforeEach(() => { diff --git a/test/services/licences/view-licence-history.service.test.js b/test/services/licences/view-licence-history.service.test.js index f0a0020328..069013271c 100644 --- a/test/services/licences/view-licence-history.service.test.js +++ b/test/services/licences/view-licence-history.service.test.js @@ -66,7 +66,7 @@ describe('View Licence History service', () => { dateCreated: '5 April 2021', displayNote: true, notes: ['Test note'], - link: '/system/return-requirements/3f09ce0b-288c-4c0b-b519-7329fe70a6cc', + link: '/system/return-versions/3f09ce0b-288c-4c0b-b519-7329fe70a6cc', reason: 'New licence', type: { index: 2, name: 'Return version' } } diff --git a/test/services/licences/view-licence-set-up.service.test.js b/test/services/licences/view-licence-set-up.service.test.js index d50cc2151a..4631f9f8f7 100644 --- a/test/services/licences/view-licence-set-up.service.test.js +++ b/test/services/licences/view-licence-set-up.service.test.js @@ -152,7 +152,7 @@ describe('View Licence Set Up service', () => { { action: [ { - link: '/system/return-requirements/0312e5eb-67ae-44fb-922c-b1a0b81bc08d', + link: '/system/return-versions/0312e5eb-67ae-44fb-922c-b1a0b81bc08d', text: 'View' } ], diff --git a/test/services/return-requirements/fetch-return-version.service.test.js b/test/services/return-versions/fetch-return-version.service.test.js similarity index 95% rename from test/services/return-requirements/fetch-return-version.service.test.js rename to test/services/return-versions/fetch-return-version.service.test.js index bf5bbdf68f..9b4fe3a2f6 100644 --- a/test/services/return-requirements/fetch-return-version.service.test.js +++ b/test/services/return-versions/fetch-return-version.service.test.js @@ -12,9 +12,9 @@ const RequirementsForReturnsSeeder = require('../../support/seeders/requirements const ModLogHelper = require('../../support/helpers/mod-log.helper.js') // Thing under test -const FetchReturnVersionService = require('../../../app/services/return-requirements/fetch-return-version.service.js') +const FetchReturnVersionService = require('../../../app/services/return-versions/fetch-return-version.service.js') -describe('Return Requirements - Fetch Return Version service', () => { +describe('Return Versions - Fetch Return Version service', () => { let licence let modLog let returnVersion @@ -30,7 +30,7 @@ describe('Return Requirements - Fetch Return Version service', () => { user = seedData.user }) - it('returns the details of the requirements for returns', async () => { + it('returns the details of the return version', async () => { const result = await FetchReturnVersionService.go(returnVersion.id) const [returnRequirementsOne, returnRequirementsTwo] = result.returnRequirements diff --git a/test/services/return-requirements/setup/abstraction-period.service.test.js b/test/services/return-versions/setup/abstraction-period.service.test.js similarity index 88% rename from test/services/return-requirements/setup/abstraction-period.service.test.js rename to test/services/return-versions/setup/abstraction-period.service.test.js index 964136e0be..b74408486e 100644 --- a/test/services/return-requirements/setup/abstraction-period.service.test.js +++ b/test/services/return-versions/setup/abstraction-period.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const AbstractionPeriodService = require('../../../../app/services/return-requirements/setup/abstraction-period.service.js') +const AbstractionPeriodService = require('../../../../app/services/return-versions/setup/abstraction-period.service.js') -describe('Return Requirements Setup - Abstraction Period service', () => { +describe('Return Versions Setup - Abstraction Period service', () => { const requirementIndex = 0 let session @@ -52,7 +52,7 @@ describe('Return Requirements Setup - Abstraction Period service', () => { activeNavBar: 'search', pageTitle: 'Enter the abstraction period for the requirements for returns', abstractionPeriod: null, - backLink: `/system/return-requirements/setup/${session.id}/points/0`, + backLink: `/system/return-versions/setup/${session.id}/points/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' }, { skip: ['sessionId'] }) diff --git a/test/services/return-requirements/setup/add.service.test.js b/test/services/return-versions/setup/add.service.test.js similarity index 90% rename from test/services/return-requirements/setup/add.service.test.js rename to test/services/return-versions/setup/add.service.test.js index a348c2ad93..7cfded55f4 100644 --- a/test/services/return-requirements/setup/add.service.test.js +++ b/test/services/return-versions/setup/add.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const AddService = require('../../../../app/services/return-requirements/setup/add.service.js') +const AddService = require('../../../../app/services/return-versions/setup/add.service.js') -describe('Return Requirements Setup - Add service', () => { +describe('Return Versions Setup - Add service', () => { let session beforeEach(async () => { diff --git a/test/services/return-requirements/setup/additional-submission-options.service.test.js b/test/services/return-versions/setup/additional-submission-options.service.test.js similarity index 87% rename from test/services/return-requirements/setup/additional-submission-options.service.test.js rename to test/services/return-versions/setup/additional-submission-options.service.test.js index b43fc12486..d4e9cd84f5 100644 --- a/test/services/return-requirements/setup/additional-submission-options.service.test.js +++ b/test/services/return-versions/setup/additional-submission-options.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const AdditionalSubmissionOptionsService = require('../../../../app/services/return-requirements/setup/additional-submission-options.service.js') +const AdditionalSubmissionOptionsService = require('../../../../app/services/return-versions/setup/additional-submission-options.service.js') -describe('Return Requirements Setup - Additional Submission Options service', () => { +describe('Return Versions Setup - Additional Submission Options service', () => { let session beforeEach(async () => { @@ -49,7 +49,7 @@ describe('Return Requirements Setup - Additional Submission Options service', () expect(result).to.equal({ activeNavBar: 'search', additionalSubmissionOptions: [], - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', pageTitle: 'Select any additional submission options for the return requirements' diff --git a/test/services/return-requirements/setup/agreements-exceptions.service.test.js b/test/services/return-versions/setup/agreements-exceptions.service.test.js similarity index 87% rename from test/services/return-requirements/setup/agreements-exceptions.service.test.js rename to test/services/return-versions/setup/agreements-exceptions.service.test.js index d1681215f3..c45c54c753 100644 --- a/test/services/return-requirements/setup/agreements-exceptions.service.test.js +++ b/test/services/return-versions/setup/agreements-exceptions.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const AgreementsExceptionsService = require('../../../../app/services/return-requirements/setup/agreements-exceptions.service.js') +const AgreementsExceptionsService = require('../../../../app/services/return-versions/setup/agreements-exceptions.service.js') -describe('Return Requirements Setup - Agreements Exceptions service', () => { +describe('Return Versions Setup - Agreements Exceptions service', () => { const requirementIndex = 0 let session @@ -52,7 +52,7 @@ describe('Return Requirements Setup - Agreements Exceptions service', () => { activeNavBar: 'search', pageTitle: 'Select agreements and exceptions for the requirements for returns', agreementsExceptions: null, - backLink: `/system/return-requirements/setup/${session.id}/frequency-reported/0`, + backLink: `/system/return-versions/setup/${session.id}/frequency-reported/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' }, { skip: ['sessionId'] }) diff --git a/test/services/return-requirements/setup/cancel.service.test.js b/test/services/return-versions/setup/cancel.service.test.js similarity index 91% rename from test/services/return-requirements/setup/cancel.service.test.js rename to test/services/return-versions/setup/cancel.service.test.js index acfe2cb9ad..432bd35992 100644 --- a/test/services/return-requirements/setup/cancel.service.test.js +++ b/test/services/return-versions/setup/cancel.service.test.js @@ -12,9 +12,9 @@ const SessionHelper = require('../../../support/helpers/session.helper.js') const { generateUUID } = require('../../../../app/lib/general.lib.js') // Thing under test -const CancelService = require('../../../../app/services/return-requirements/setup/cancel.service.js') +const CancelService = require('../../../../app/services/return-versions/setup/cancel.service.js') -describe('Return Requirements Setup - Cancel service', () => { +describe('Return Versions Setup - Cancel service', () => { let session beforeEach(async () => { @@ -66,7 +66,7 @@ describe('Return Requirements Setup - Cancel service', () => { expect(result).to.equal({ activeNavBar: 'search', - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', pageTitle: 'You are about to cancel these requirements for returns', diff --git a/test/services/return-requirements/setup/check/check.service.test.js b/test/services/return-versions/setup/check/check.service.test.js similarity index 91% rename from test/services/return-requirements/setup/check/check.service.test.js rename to test/services/return-versions/setup/check/check.service.test.js index f0d7efb4c9..9ff5f24c02 100644 --- a/test/services/return-requirements/setup/check/check.service.test.js +++ b/test/services/return-versions/setup/check/check.service.test.js @@ -9,13 +9,13 @@ const { describe, it, beforeEach, afterEach } = exports.lab = Lab.script() const { expect } = Code // Test helpers -const FetchPointsService = require('../../../../../app/services/return-requirements/setup/fetch-points.service.js') +const FetchPointsService = require('../../../../../app/services/return-versions/setup/fetch-points.service.js') const SessionHelper = require('../../../../support/helpers/session.helper.js') // Thing under test -const CheckService = require('../../../../../app/services/return-requirements/setup/check/check.service.js') +const CheckService = require('../../../../../app/services/return-versions/setup/check/check.service.js') -describe('Return Requirements Setup - Check service', () => { +describe('Return Versions Setup - Check service', () => { let session let yarStub @@ -73,7 +73,7 @@ describe('Return Requirements Setup - Check service', () => { notification: undefined, pageTitle: 'Check the requirements for returns for Turbo Kid', reason: 'Major change', - reasonLink: `/system/return-requirements/setup/${session.id}/reason`, + reasonLink: `/system/return-versions/setup/${session.id}/reason`, requirements: [], returnsRequired: true, startDate: '1 January 2023' diff --git a/test/services/return-requirements/setup/check/generate-return-version-requirements.service.test.js b/test/services/return-versions/setup/check/generate-return-version-requirements.service.test.js similarity index 98% rename from test/services/return-requirements/setup/check/generate-return-version-requirements.service.test.js rename to test/services/return-versions/setup/check/generate-return-version-requirements.service.test.js index 88157c726d..a31f92efb3 100644 --- a/test/services/return-requirements/setup/check/generate-return-version-requirements.service.test.js +++ b/test/services/return-versions/setup/check/generate-return-version-requirements.service.test.js @@ -15,9 +15,9 @@ const LicenceVersionPurposeHelper = require('../../../../support/helpers/licence const RegionHelper = require('../../../../support/helpers/region.helper.js') // Thing under test -const GenerateReturnVersionRequirementsService = require('../../../../../app/services/return-requirements/setup/check/generate-return-version-requirements.service.js') +const GenerateReturnVersionRequirementsService = require('../../../../../app/services/return-versions/setup/check/generate-return-version-requirements.service.js') -describe('Return Requirements Setup - Generate Return Version Requirements service', () => { +describe('Return Versions Setup - Generate Return Version Requirements service', () => { let licenceId let naldRegionId let requirements diff --git a/test/services/return-requirements/setup/check/generate-return-version.service.test.js b/test/services/return-versions/setup/check/generate-return-version.service.test.js similarity index 95% rename from test/services/return-requirements/setup/check/generate-return-version.service.test.js rename to test/services/return-versions/setup/check/generate-return-version.service.test.js index c67c665c08..67dc96de27 100644 --- a/test/services/return-requirements/setup/check/generate-return-version.service.test.js +++ b/test/services/return-versions/setup/check/generate-return-version.service.test.js @@ -13,13 +13,13 @@ const { generateUUID } = require('../../../../../app/lib/general.lib.js') const ReturnVersionHelper = require('../../../../support/helpers/return-version.helper.js') // Things we need to stub -const GenerateReturnVersionRequirementsService = require('../../../../../app/services/return-requirements/setup/check/generate-return-version-requirements.service.js') -const ProcessExistingReturnVersionsService = require('../../../../../app/services/return-requirements/setup/check/process-existing-return-versions.service.js') +const GenerateReturnVersionRequirementsService = require('../../../../../app/services/return-versions/setup/check/generate-return-version-requirements.service.js') +const ProcessExistingReturnVersionsService = require('../../../../../app/services/return-versions/setup/check/process-existing-return-versions.service.js') // Thing under test -const GenerateReturnVersionService = require('../../../../../app/services/return-requirements/setup/check/generate-return-version.service.js') +const GenerateReturnVersionService = require('../../../../../app/services/return-versions/setup/check/generate-return-version.service.js') -describe('Return Requirements Setup - Generate Return Version service', () => { +describe('Return Versions Setup - Generate Return Version service', () => { const userId = 12345 let licenceId diff --git a/test/services/return-requirements/setup/check/persist-return-version.service.test.js b/test/services/return-versions/setup/check/persist-return-version.service.test.js similarity index 97% rename from test/services/return-requirements/setup/check/persist-return-version.service.test.js rename to test/services/return-versions/setup/check/persist-return-version.service.test.js index bee0b1eeb1..3c2b093669 100644 --- a/test/services/return-requirements/setup/check/persist-return-version.service.test.js +++ b/test/services/return-versions/setup/check/persist-return-version.service.test.js @@ -15,9 +15,9 @@ const ReturnRequirementPointModel = require('../../../../../app/models/return-re const ReturnRequirementPurposeModel = require('../../../../../app/models/return-requirement-purpose.model.js') // Thing under test -const PersistReturnVersionService = require('../../../../../app/services/return-requirements/setup/check/persist-return-version.service.js') +const PersistReturnVersionService = require('../../../../../app/services/return-versions/setup/check/persist-return-version.service.js') -describe('Return Requirements Setup - Persist Return Version service', () => { +describe('Return Versions Setup - Persist Return Version service', () => { describe('when called with data to persist', () => { let licenceId let returnVersionData diff --git a/test/services/return-requirements/setup/check/process-existing-return-versions.service.test.js b/test/services/return-versions/setup/check/process-existing-return-versions.service.test.js similarity index 95% rename from test/services/return-requirements/setup/check/process-existing-return-versions.service.test.js rename to test/services/return-versions/setup/check/process-existing-return-versions.service.test.js index 9be1dd9a1e..75f1e30aba 100644 --- a/test/services/return-requirements/setup/check/process-existing-return-versions.service.test.js +++ b/test/services/return-versions/setup/check/process-existing-return-versions.service.test.js @@ -13,9 +13,9 @@ const ReturnVersionHelper = require('../../../../support/helpers/return-version. const ReturnVersionModel = require('../../../../../app/models/return-version.model.js') // Thing under test -const ProcessExistingReturnVersionsService = require('../../../../../app/services/return-requirements/setup/check/process-existing-return-versions.service.js') +const ProcessExistingReturnVersionsService = require('../../../../../app/services/return-versions/setup/check/process-existing-return-versions.service.js') -describe('Return Requirements Setup - Process Existing Return Versions service', () => { +describe('Return Versions Setup - Process Existing Return Versions service', () => { let existingReturnVersionId let licenceId let newVersionStartDate diff --git a/test/services/return-requirements/setup/check/submit-check.service.test.js b/test/services/return-versions/setup/check/submit-check.service.test.js similarity index 87% rename from test/services/return-requirements/setup/check/submit-check.service.test.js rename to test/services/return-versions/setup/check/submit-check.service.test.js index ef4de08757..bbdb054ff9 100644 --- a/test/services/return-requirements/setup/check/submit-check.service.test.js +++ b/test/services/return-versions/setup/check/submit-check.service.test.js @@ -12,13 +12,13 @@ const { expect } = Code const SessionHelper = require('../../../../support/helpers/session.helper.js') // Things we need to stub -const GenerateReturnVersionService = require('../../../../../app/services/return-requirements/setup/check/generate-return-version.service.js') -const PersistReturnVersionService = require('../../../../../app/services/return-requirements/setup/check/persist-return-version.service.js') +const GenerateReturnVersionService = require('../../../../../app/services/return-versions/setup/check/generate-return-version.service.js') +const PersistReturnVersionService = require('../../../../../app/services/return-versions/setup/check/persist-return-version.service.js') // Thing under test -const SubmitCheckService = require('../../../../../app/services/return-requirements/setup/check/submit-check.service.js') +const SubmitCheckService = require('../../../../../app/services/return-versions/setup/check/submit-check.service.js') -describe('Return Requirements Setup - Submit Check service', () => { +describe('Return Versions Setup - Submit Check service', () => { let session let sessionId diff --git a/test/services/return-requirements/setup/delete-note.service.test.js b/test/services/return-versions/setup/delete-note.service.test.js similarity index 93% rename from test/services/return-requirements/setup/delete-note.service.test.js rename to test/services/return-versions/setup/delete-note.service.test.js index 387e69d544..a0742bf75f 100644 --- a/test/services/return-requirements/setup/delete-note.service.test.js +++ b/test/services/return-versions/setup/delete-note.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const DeleteNoteService = require('../../../../app/services/return-requirements/setup/delete-note.service.js') +const DeleteNoteService = require('../../../../app/services/return-versions/setup/delete-note.service.js') -describe('Return Requirements Setup - Delete Note service', () => { +describe('Return Versions Setup - Delete Note service', () => { let session let yarStub diff --git a/test/services/return-requirements/setup/existing.service.test.js b/test/services/return-versions/setup/existing.service.test.js similarity index 94% rename from test/services/return-requirements/setup/existing.service.test.js rename to test/services/return-versions/setup/existing.service.test.js index f9cd164357..574d080930 100644 --- a/test/services/return-requirements/setup/existing.service.test.js +++ b/test/services/return-versions/setup/existing.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const ExistingService = require('../../../../app/services/return-requirements/setup/existing.service.js') +const ExistingService = require('../../../../app/services/return-versions/setup/existing.service.js') -describe('Return Requirements Setup - Existing service', () => { +describe('Return Versions Setup - Existing service', () => { let session beforeEach(async () => { diff --git a/test/services/return-requirements/setup/fetch-existing-requirements.test.js b/test/services/return-versions/setup/fetch-existing-requirements.test.js similarity index 96% rename from test/services/return-requirements/setup/fetch-existing-requirements.test.js rename to test/services/return-versions/setup/fetch-existing-requirements.test.js index c5b3dd2f2d..b6730530d4 100644 --- a/test/services/return-requirements/setup/fetch-existing-requirements.test.js +++ b/test/services/return-versions/setup/fetch-existing-requirements.test.js @@ -11,9 +11,9 @@ const { expect } = Code const RequirementsForReturnsSeeder = require('../../../support/seeders/requirements-for-returns.seeder.js') // Thing under test -const FetchExistingRequirementsService = require('../../../../app/services/return-requirements/setup/fetch-existing-requirements.js') +const FetchExistingRequirementsService = require('../../../../app/services/return-versions/setup/fetch-existing-requirements.js') -describe('Return Requirements Setup - Fetch Existing Requirements service', () => { +describe('Return Versions Setup - Fetch Existing Requirements service', () => { let returnVersion describe('when a matching return version exists', () => { diff --git a/test/services/return-requirements/setup/fetch-points.service.test.js b/test/services/return-versions/setup/fetch-points.service.test.js similarity index 95% rename from test/services/return-requirements/setup/fetch-points.service.test.js rename to test/services/return-versions/setup/fetch-points.service.test.js index a203680163..839377ff3d 100644 --- a/test/services/return-requirements/setup/fetch-points.service.test.js +++ b/test/services/return-versions/setup/fetch-points.service.test.js @@ -16,9 +16,9 @@ const PointHelper = require('../../../support/helpers/point.helper.js') const RegionHelper = require('../../../support/helpers/region.helper.js') // Thing under test -const FetchPointsService = require('../../../../app/services/return-requirements/setup/fetch-points.service.js') +const FetchPointsService = require('../../../../app/services/return-versions/setup/fetch-points.service.js') -describe('Return Requirements Setup - Fetch Points service', () => { +describe('Return Versions Setup - Fetch Points service', () => { let licence let points diff --git a/test/services/return-requirements/setup/fetch-purposes.service.test.js b/test/services/return-versions/setup/fetch-purposes.service.test.js similarity index 95% rename from test/services/return-requirements/setup/fetch-purposes.service.test.js rename to test/services/return-versions/setup/fetch-purposes.service.test.js index 6a03fc96ee..e49c60c366 100644 --- a/test/services/return-requirements/setup/fetch-purposes.service.test.js +++ b/test/services/return-versions/setup/fetch-purposes.service.test.js @@ -13,9 +13,9 @@ const LicenceVersionPurposeHelper = require('../../../support/helpers/licence-ve const PurposeHelper = require('../../../support/helpers/purpose.helper.js') // Thing under test -const FetchPurposesService = require('../../../../app/services/return-requirements/setup/fetch-purposes.service.js') +const FetchPurposesService = require('../../../../app/services/return-versions/setup/fetch-purposes.service.js') -describe('Return Requirements Setup - Fetch Purposes service', () => { +describe('Return Versions Setup - Fetch Purposes service', () => { let licenceVersion let purposes diff --git a/test/services/return-requirements/setup/frequency-collected.service.test.js b/test/services/return-versions/setup/frequency-collected.service.test.js similarity index 89% rename from test/services/return-requirements/setup/frequency-collected.service.test.js rename to test/services/return-versions/setup/frequency-collected.service.test.js index 34a7f95422..68d2ab4ef4 100644 --- a/test/services/return-requirements/setup/frequency-collected.service.test.js +++ b/test/services/return-versions/setup/frequency-collected.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const FrequencyCollectedService = require('../../../../app/services/return-requirements/setup/frequency-collected.service.js') +const FrequencyCollectedService = require('../../../../app/services/return-versions/setup/frequency-collected.service.js') -describe('Return Requirements Setup - Frequency Collected service', () => { +describe('Return Versions Setup - Frequency Collected service', () => { const requirementIndex = 0 let session @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Frequency Collected service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select how often readings or volumes are collected', - backLink: `/system/return-requirements/setup/${session.id}/site-description/0`, + backLink: `/system/return-versions/setup/${session.id}/site-description/0`, frequencyCollected: null, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' diff --git a/test/services/return-requirements/setup/frequency-reported.service.test.js b/test/services/return-versions/setup/frequency-reported.service.test.js similarity index 89% rename from test/services/return-requirements/setup/frequency-reported.service.test.js rename to test/services/return-versions/setup/frequency-reported.service.test.js index 46704e7bb6..6c5cfc99f9 100644 --- a/test/services/return-requirements/setup/frequency-reported.service.test.js +++ b/test/services/return-versions/setup/frequency-reported.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const FrequencyReportedService = require('../../../../app/services/return-requirements/setup/frequency-reported.service.js') +const FrequencyReportedService = require('../../../../app/services/return-versions/setup/frequency-reported.service.js') -describe('Return Requirements Setup - Frequency Reported service', () => { +describe('Return Versions Setup - Frequency Reported service', () => { const requirementIndex = 0 let session @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Frequency Reported service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select how often readings or volumes are reported', - backLink: `/system/return-requirements/setup/${session.id}/frequency-collected/0`, + backLink: `/system/return-versions/setup/${session.id}/frequency-collected/0`, frequencyReported: null, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' diff --git a/test/services/return-requirements/setup/generate-from-existing-requirements.service.test.js b/test/services/return-versions/setup/generate-from-existing-requirements.service.test.js similarity index 96% rename from test/services/return-requirements/setup/generate-from-existing-requirements.service.test.js rename to test/services/return-versions/setup/generate-from-existing-requirements.service.test.js index 1e274f4c9c..ee817af11f 100644 --- a/test/services/return-requirements/setup/generate-from-existing-requirements.service.test.js +++ b/test/services/return-versions/setup/generate-from-existing-requirements.service.test.js @@ -9,12 +9,12 @@ const { describe, it, beforeEach, afterEach } = exports.lab = Lab.script() const { expect } = Code // Things we need to stub -const FetchExistingRequirementsService = require('../../../../app/services/return-requirements/setup/fetch-existing-requirements.js') +const FetchExistingRequirementsService = require('../../../../app/services/return-versions/setup/fetch-existing-requirements.js') // Thing under test -const GenerateFromExistingRequirementsService = require('../../../../app/services/return-requirements/setup/generate-from-existing-requirements.service.js') +const GenerateFromExistingRequirementsService = require('../../../../app/services/return-versions/setup/generate-from-existing-requirements.service.js') -describe('Return Requirements Setup - Generate From Existing Requirements service', () => { +describe('Return Versions Setup - Generate From Existing Requirements service', () => { let returnVersion afterEach(() => { diff --git a/test/services/return-requirements/setup/initiate-session.service.test.js b/test/services/return-versions/setup/initiate-session.service.test.js similarity index 97% rename from test/services/return-requirements/setup/initiate-session.service.test.js rename to test/services/return-versions/setup/initiate-session.service.test.js index e1d0135aec..730886bad3 100644 --- a/test/services/return-requirements/setup/initiate-session.service.test.js +++ b/test/services/return-versions/setup/initiate-session.service.test.js @@ -17,9 +17,9 @@ const ReturnVersionHelper = require('../../../support/helpers/return-version.hel const { generateLicenceRef } = require('../../../support/helpers/licence.helper.js') // Thing under test -const InitiateSessionService = require('../../../../app/services/return-requirements/setup/initiate-session.service.js') +const InitiateSessionService = require('../../../../app/services/return-versions/setup/initiate-session.service.js') -describe('Return Requirements Setup - Initiate Session service', () => { +describe('Return Versions Setup - Initiate Session service', () => { let journey let licence let licenceRef diff --git a/test/services/return-requirements/setup/method/fetch-abstraction-data.service.test.js b/test/services/return-versions/setup/method/fetch-abstraction-data.service.test.js similarity index 97% rename from test/services/return-requirements/setup/method/fetch-abstraction-data.service.test.js rename to test/services/return-versions/setup/method/fetch-abstraction-data.service.test.js index 8f983f6789..bfda20ae7d 100644 --- a/test/services/return-requirements/setup/method/fetch-abstraction-data.service.test.js +++ b/test/services/return-versions/setup/method/fetch-abstraction-data.service.test.js @@ -12,9 +12,9 @@ const LicenceAbstractionDataSeeder = require('../../../../support/seeders/licenc const LicenceAgreementModel = require('../../../../../app/models/licence-agreement.model.js') // Thing under test -const FetchAbstractionDataService = require('../../../../../app/services/return-requirements/setup/method/fetch-abstraction-data.service.js') +const FetchAbstractionDataService = require('../../../../../app/services/return-versions/setup/method/fetch-abstraction-data.service.js') -describe('Return Requirements - Fetch Abstraction Data service', () => { +describe('Return Versions Setup - Fetch Abstraction Data service', () => { let seedData beforeEach(async () => { diff --git a/test/services/return-requirements/setup/method/generate-from-abstraction-data.service.test.js b/test/services/return-versions/setup/method/generate-from-abstraction-data.service.test.js similarity index 97% rename from test/services/return-requirements/setup/method/generate-from-abstraction-data.service.test.js rename to test/services/return-versions/setup/method/generate-from-abstraction-data.service.test.js index b81dd6655a..f9d1076df1 100644 --- a/test/services/return-requirements/setup/method/generate-from-abstraction-data.service.test.js +++ b/test/services/return-versions/setup/method/generate-from-abstraction-data.service.test.js @@ -9,14 +9,14 @@ const { describe, it, beforeEach, afterEach } = exports.lab = Lab.script() const { expect } = Code // Test helpers -const FetchAbstractionDataService = require('../../../../../app/services/return-requirements/setup/method/fetch-abstraction-data.service.js') +const FetchAbstractionDataService = require('../../../../../app/services/return-versions/setup/method/fetch-abstraction-data.service.js') const LicenceModel = require('../../../../../app/models/licence.model.js') const LicenceVersionPurposeModel = require('../../../../../app/models/licence-version-purpose.model.js') // Thing under test -const GenerateFromAbstractionDataService = require('../../../../../app/services/return-requirements/setup/method/generate-from-abstraction-data.service.js') +const GenerateFromAbstractionDataService = require('../../../../../app/services/return-versions/setup/method/generate-from-abstraction-data.service.js') -describe('Return Requirements - Generate From Abstraction Data service', () => { +describe('Return Versions Setup - Generate From Abstraction Data service', () => { const licenceId = 'af0e52a3-db43-4add-b388-1b2564a437c7' let fetchResult diff --git a/test/services/return-requirements/setup/method/method.service.test.js b/test/services/return-versions/setup/method/method.service.test.js similarity index 90% rename from test/services/return-requirements/setup/method/method.service.test.js rename to test/services/return-versions/setup/method/method.service.test.js index 338d028a7d..09a51881e0 100644 --- a/test/services/return-requirements/setup/method/method.service.test.js +++ b/test/services/return-versions/setup/method/method.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../../support/helpers/session.helper.js') // Thing under test -const MethodService = require('../../../../../app/services/return-requirements/setup/method/method.service.js') +const MethodService = require('../../../../../app/services/return-versions/setup/method/method.service.js') -describe('Return Requirements - Method service', () => { +describe('Return Versions Setup - Method service', () => { let session beforeEach(async () => { @@ -54,7 +54,7 @@ describe('Return Requirements - Method service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'How do you want to set up the requirements for returns?', - backLink: `/system/return-requirements/setup/${session.id}/reason`, + backLink: `/system/return-versions/setup/${session.id}/reason`, displayCopyExisting: true, licenceRef: '01/ABC', method: null diff --git a/test/services/return-requirements/setup/method/submit-method.service.test.js b/test/services/return-versions/setup/method/submit-method.service.test.js similarity index 94% rename from test/services/return-requirements/setup/method/submit-method.service.test.js rename to test/services/return-versions/setup/method/submit-method.service.test.js index 784d68a0f9..19f072d435 100644 --- a/test/services/return-requirements/setup/method/submit-method.service.test.js +++ b/test/services/return-versions/setup/method/submit-method.service.test.js @@ -12,12 +12,12 @@ const { expect } = Code const SessionHelper = require('../../../../support/helpers/session.helper.js') // Things we need to stub -const GenerateFromAbstractionDataService = require('../../../../../app/services/return-requirements/setup/method/generate-from-abstraction-data.service.js') +const GenerateFromAbstractionDataService = require('../../../../../app/services/return-versions/setup/method/generate-from-abstraction-data.service.js') // Thing under test -const SubmitMethodService = require('../../../../../app/services/return-requirements/setup/method/submit-method.service.js') +const SubmitMethodService = require('../../../../../app/services/return-versions/setup/method/submit-method.service.js') -describe('Return Requirements - Submit Method service', () => { +describe('Return Versions Setup - Submit Method service', () => { let payload let session @@ -124,7 +124,7 @@ describe('Return Requirements - Submit Method service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'How do you want to set up the requirements for returns?', - backLink: `/system/return-requirements/setup/${session.id}/reason`, + backLink: `/system/return-versions/setup/${session.id}/reason`, displayCopyExisting: true, licenceRef: '01/ABC', method: null diff --git a/test/services/return-requirements/setup/no-returns-required.service.test.js b/test/services/return-versions/setup/no-returns-required.service.test.js similarity index 88% rename from test/services/return-requirements/setup/no-returns-required.service.test.js rename to test/services/return-versions/setup/no-returns-required.service.test.js index 41353217d9..ee07169929 100644 --- a/test/services/return-requirements/setup/no-returns-required.service.test.js +++ b/test/services/return-versions/setup/no-returns-required.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const NoReturnsRequiredService = require('../../../../app/services/return-requirements/setup/no-returns-required.service.js') +const NoReturnsRequiredService = require('../../../../app/services/return-versions/setup/no-returns-required.service.js') -describe('Return Requirements Setup - No Returns Required service', () => { +describe('Return Versions Setup - No Returns Required service', () => { let session beforeEach(async () => { @@ -54,7 +54,7 @@ describe('Return Requirements Setup - No Returns Required service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Why are no returns required?', - backLink: `/system/return-requirements/setup/${session.id}/start-date`, + backLink: `/system/return-versions/setup/${session.id}/start-date`, licenceRef: '01/ABC', reason: null }, { skip: ['sessionId'] }) diff --git a/test/services/return-requirements/setup/note.service.test.js b/test/services/return-versions/setup/note.service.test.js similarity index 87% rename from test/services/return-requirements/setup/note.service.test.js rename to test/services/return-versions/setup/note.service.test.js index b36ec66217..c9471b7a11 100644 --- a/test/services/return-requirements/setup/note.service.test.js +++ b/test/services/return-versions/setup/note.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const NoteService = require('../../../../app/services/return-requirements/setup/note.service.js') +const NoteService = require('../../../../app/services/return-versions/setup/note.service.js') -describe('Return Requirements Setup - Note service', () => { +describe('Return Versions Setup - Note service', () => { let session beforeEach(async () => { @@ -55,7 +55,7 @@ describe('Return Requirements Setup - Note service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Add a note', - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, licenceRef: '01/ABC', note: null }, { skip: ['sessionId'] }) diff --git a/test/services/return-requirements/setup/points.service.test.js b/test/services/return-versions/setup/points.service.test.js similarity index 91% rename from test/services/return-requirements/setup/points.service.test.js rename to test/services/return-versions/setup/points.service.test.js index 2a116236b4..be35f1cc7b 100644 --- a/test/services/return-requirements/setup/points.service.test.js +++ b/test/services/return-versions/setup/points.service.test.js @@ -13,12 +13,12 @@ const PointModel = require('../../../../app/models/point.model.js') const SessionHelper = require('../../../support/helpers/session.helper.js') // Things we need to stub -const FetchPointsService = require('../../../../app/services/return-requirements/setup/fetch-points.service.js') +const FetchPointsService = require('../../../../app/services/return-versions/setup/fetch-points.service.js') // Thing under test -const SelectPointsService = require('../../../../app/services/return-requirements/setup/points.service.js') +const SelectPointsService = require('../../../../app/services/return-versions/setup/points.service.js') -describe('Return Requirements Setup - Points service', () => { +describe('Return Versions Setup - Points service', () => { const requirementIndex = 0 let session @@ -77,7 +77,7 @@ describe('Return Requirements Setup - Points service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the points for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/purpose/0`, + backLink: `/system/return-versions/setup/${session.id}/purpose/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licencePoints: [ { diff --git a/test/services/return-requirements/setup/purpose.service.test.js b/test/services/return-versions/setup/purpose.service.test.js similarity index 91% rename from test/services/return-requirements/setup/purpose.service.test.js rename to test/services/return-versions/setup/purpose.service.test.js index 4db524bc8a..e91516770c 100644 --- a/test/services/return-requirements/setup/purpose.service.test.js +++ b/test/services/return-versions/setup/purpose.service.test.js @@ -12,12 +12,12 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Things we need to stub -const FetchPurposesService = require('../../../../app/services/return-requirements/setup/fetch-purposes.service.js') +const FetchPurposesService = require('../../../../app/services/return-versions/setup/fetch-purposes.service.js') // Thing under test -const PurposeService = require('../../../../app/services/return-requirements/setup/purpose.service.js') +const PurposeService = require('../../../../app/services/return-versions/setup/purpose.service.js') -describe('Return Requirements Setup - Purpose service', () => { +describe('Return Versions Setup - Purpose service', () => { const requirementIndex = 0 let session @@ -70,7 +70,7 @@ describe('Return Requirements Setup - Purpose service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the purpose for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/method`, + backLink: `/system/return-versions/setup/${session.id}/method`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', purposes: [ diff --git a/test/services/return-requirements/setup/reason.service.test.js b/test/services/return-versions/setup/reason.service.test.js similarity index 86% rename from test/services/return-requirements/setup/reason.service.test.js rename to test/services/return-versions/setup/reason.service.test.js index 7a97a6f4ea..5d70d0515a 100644 --- a/test/services/return-requirements/setup/reason.service.test.js +++ b/test/services/return-versions/setup/reason.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const ReasonService = require('../../../../app/services/return-requirements/setup/reason.service.js') +const ReasonService = require('../../../../app/services/return-versions/setup/reason.service.js') -describe('Return Requirements Setup - Reason service', () => { +describe('Return Versions Setup - Reason service', () => { let session beforeEach(async () => { @@ -54,7 +54,7 @@ describe('Return Requirements Setup - Reason service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the reason for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/start-date`, + backLink: `/system/return-versions/setup/${session.id}/start-date`, licenceRef: '01/ABC', reason: null }, { skip: ['sessionId'] }) diff --git a/test/services/return-requirements/setup/remove.service.test.js b/test/services/return-versions/setup/remove.service.test.js similarity index 91% rename from test/services/return-requirements/setup/remove.service.test.js rename to test/services/return-versions/setup/remove.service.test.js index b82e76c542..f844150738 100644 --- a/test/services/return-requirements/setup/remove.service.test.js +++ b/test/services/return-versions/setup/remove.service.test.js @@ -12,9 +12,9 @@ const SessionHelper = require('../../../support/helpers/session.helper.js') const { generateUUID } = require('../../../../app/lib/general.lib.js') // Thing under test -const RemoveService = require('../../../../app/services/return-requirements/setup/remove.service.js') +const RemoveService = require('../../../../app/services/return-versions/setup/remove.service.js') -describe('Return Requirements Setup - Remove service', () => { +describe('Return Versions Setup - Remove service', () => { const requirementIndex = 0 let session @@ -73,7 +73,7 @@ describe('Return Requirements Setup - Remove service', () => { expect(result).to.equal({ activeNavBar: 'search', - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', pageTitle: 'You are about to remove these requirements for returns', diff --git a/test/services/return-requirements/setup/returns-cycle.service.test.js b/test/services/return-versions/setup/returns-cycle.service.test.js similarity index 89% rename from test/services/return-requirements/setup/returns-cycle.service.test.js rename to test/services/return-versions/setup/returns-cycle.service.test.js index 18ba4a04af..ea4a923637 100644 --- a/test/services/return-requirements/setup/returns-cycle.service.test.js +++ b/test/services/return-versions/setup/returns-cycle.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const ReturnsCycleService = require('../../../../app/services/return-requirements/setup/returns-cycle.service.js') +const ReturnsCycleService = require('../../../../app/services/return-versions/setup/returns-cycle.service.js') -describe('Return Requirements Setup - Returns Cycle service', () => { +describe('Return Versions Setup - Returns Cycle service', () => { const requirementIndex = 0 let session @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Returns Cycle service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the returns cycle for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/abstraction-period/0`, + backLink: `/system/return-versions/setup/${session.id}/abstraction-period/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', returnsCycle: null diff --git a/test/services/return-requirements/setup/site-description.service.test.js b/test/services/return-versions/setup/site-description.service.test.js similarity index 89% rename from test/services/return-requirements/setup/site-description.service.test.js rename to test/services/return-versions/setup/site-description.service.test.js index d795b92c82..0865a0a4dd 100644 --- a/test/services/return-requirements/setup/site-description.service.test.js +++ b/test/services/return-versions/setup/site-description.service.test.js @@ -11,9 +11,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Things under test -const SiteDescriptionService = require('../../../../app/services/return-requirements/setup/site-description.service.js') +const SiteDescriptionService = require('../../../../app/services/return-versions/setup/site-description.service.js') -describe('Return Requirements Setup - Site Description service', () => { +describe('Return Versions Setup - Site Description service', () => { const requirementIndex = 0 let session @@ -57,7 +57,7 @@ describe('Return Requirements Setup - Site Description service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Enter a site description for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/returns-cycle/0`, + backLink: `/system/return-versions/setup/${session.id}/returns-cycle/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', siteDescription: null diff --git a/test/services/return-requirements/setup/start-date.service.test.js b/test/services/return-versions/setup/start-date.service.test.js similarity index 95% rename from test/services/return-requirements/setup/start-date.service.test.js rename to test/services/return-versions/setup/start-date.service.test.js index 5700a9eb9c..584af64204 100644 --- a/test/services/return-requirements/setup/start-date.service.test.js +++ b/test/services/return-versions/setup/start-date.service.test.js @@ -13,9 +13,9 @@ const FeatureFlagsConfig = require('../../../../config/feature-flags.config.js') const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const StartDateService = require('../../../../app/services/return-requirements/setup/start-date.service.js') +const StartDateService = require('../../../../app/services/return-versions/setup/start-date.service.js') -describe('Return Requirements Setup - Start Date service', () => { +describe('Return Versions Setup - Start Date service', () => { let session beforeEach(async () => { diff --git a/test/services/return-requirements/setup/submit-abstraction-period.service.test.js b/test/services/return-versions/setup/submit-abstraction-period.service.test.js similarity index 97% rename from test/services/return-requirements/setup/submit-abstraction-period.service.test.js rename to test/services/return-versions/setup/submit-abstraction-period.service.test.js index 1b26406888..62535a9f47 100644 --- a/test/services/return-requirements/setup/submit-abstraction-period.service.test.js +++ b/test/services/return-versions/setup/submit-abstraction-period.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitAbstractionPeriodService = require('../../../../app/services/return-requirements/setup/submit-abstraction-period.service.js') +const SubmitAbstractionPeriodService = require('../../../../app/services/return-versions/setup/submit-abstraction-period.service.js') -describe('Return Requirements Setup - Submit Abstraction Period service', () => { +describe('Return Versions Setup - Submit Abstraction Period service', () => { const requirementIndex = 0 let payload @@ -122,7 +122,7 @@ describe('Return Requirements Setup - Submit Abstraction Period service', () => activeNavBar: 'search', pageTitle: 'Enter the abstraction period for the requirements for returns', abstractionPeriod: null, - backLink: `/system/return-requirements/setup/${session.id}/points/0`, + backLink: `/system/return-versions/setup/${session.id}/points/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' }, { skip: ['sessionId', 'error'] }) diff --git a/test/services/return-requirements/setup/submit-additional-submission-options.service.test.js b/test/services/return-versions/setup/submit-additional-submission-options.service.test.js similarity index 92% rename from test/services/return-requirements/setup/submit-additional-submission-options.service.test.js rename to test/services/return-versions/setup/submit-additional-submission-options.service.test.js index a88ccaf860..b844590279 100644 --- a/test/services/return-requirements/setup/submit-additional-submission-options.service.test.js +++ b/test/services/return-versions/setup/submit-additional-submission-options.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitAdditionalSubmissionOptionsService = require('../../../../app/services/return-requirements/setup/submit-additional-submission-options.service.js') +const SubmitAdditionalSubmissionOptionsService = require('../../../../app/services/return-versions/setup/submit-additional-submission-options.service.js') -describe('Return Requirements Setup - Submit Additional Submission Options service', () => { +describe('Return Versions Setup - Submit Additional Submission Options service', () => { let payload let session let yarStub @@ -87,7 +87,7 @@ describe('Return Requirements Setup - Submit Additional Submission Options servi expect(result).to.equal({ activeNavBar: 'search', - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, pageTitle: 'Select any additional submission options for the return requirements', licenceRef: '01/ABC', additionalSubmissionOptions: [undefined] diff --git a/test/services/return-requirements/setup/submit-agreements-exceptions.service.test.js b/test/services/return-versions/setup/submit-agreements-exceptions.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-agreements-exceptions.service.test.js rename to test/services/return-versions/setup/submit-agreements-exceptions.service.test.js index 59696d2752..9b6c34b625 100644 --- a/test/services/return-requirements/setup/submit-agreements-exceptions.service.test.js +++ b/test/services/return-versions/setup/submit-agreements-exceptions.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitAgreementsExceptionsService = require('../../../../app/services/return-requirements/setup/submit-agreements-exceptions.service.js') +const SubmitAgreementsExceptionsService = require('../../../../app/services/return-versions/setup/submit-agreements-exceptions.service.js') -describe('Return Requirements Setup - Submit Agreements and Exceptions service', () => { +describe('Return Versions Setup - Submit Agreements and Exceptions service', () => { const requirementIndex = 0 let payload @@ -132,7 +132,7 @@ describe('Return Requirements Setup - Submit Agreements and Exceptions service', activeNavBar: 'search', pageTitle: 'Select agreements and exceptions for the requirements for returns', agreementsExceptions: null, - backLink: `/system/return-requirements/setup/${session.id}/frequency-reported/0`, + backLink: `/system/return-versions/setup/${session.id}/frequency-reported/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' }, { skip: ['sessionId', 'error'] }) diff --git a/test/services/return-requirements/setup/submit-cancel.service.test.js b/test/services/return-versions/setup/submit-cancel.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-cancel.service.test.js rename to test/services/return-versions/setup/submit-cancel.service.test.js index 28d353ad31..56fff4ad80 100644 --- a/test/services/return-requirements/setup/submit-cancel.service.test.js +++ b/test/services/return-versions/setup/submit-cancel.service.test.js @@ -12,9 +12,9 @@ const SessionHelper = require('../../../support/helpers/session.helper.js') const { generateUUID } = require('../../../../app/lib/general.lib.js') // Thing under test -const SubmitCancelService = require('../../../../app/services/return-requirements/setup/submit-cancel.service.js') +const SubmitCancelService = require('../../../../app/services/return-versions/setup/submit-cancel.service.js') -describe('Return Requirements Setup - Submit Cancel service', () => { +describe('Return Versions Setup - Submit Cancel service', () => { let session beforeEach(async () => { diff --git a/test/services/return-requirements/setup/submit-existing.service.test.js b/test/services/return-versions/setup/submit-existing.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-existing.service.test.js rename to test/services/return-versions/setup/submit-existing.service.test.js index e36d36a861..5f5eaccf09 100644 --- a/test/services/return-requirements/setup/submit-existing.service.test.js +++ b/test/services/return-versions/setup/submit-existing.service.test.js @@ -12,12 +12,12 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Things we need to stub -const GenerateFromExistingRequirementsService = require('../../../../app/services/return-requirements/setup/generate-from-existing-requirements.service.js') +const GenerateFromExistingRequirementsService = require('../../../../app/services/return-versions/setup/generate-from-existing-requirements.service.js') // Thing under test -const SubmitExistingService = require('../../../../app/services/return-requirements/setup/submit-existing.service.js') +const SubmitExistingService = require('../../../../app/services/return-versions/setup/submit-existing.service.js') -describe('Return Requirements Setup - Submit Existing service', () => { +describe('Return Versions Setup - Submit Existing service', () => { let payload let session let sessionData diff --git a/test/services/return-requirements/setup/submit-frequency-collected.service.test.js b/test/services/return-versions/setup/submit-frequency-collected.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-frequency-collected.service.test.js rename to test/services/return-versions/setup/submit-frequency-collected.service.test.js index 31ca9ae840..df6fb87d2e 100644 --- a/test/services/return-requirements/setup/submit-frequency-collected.service.test.js +++ b/test/services/return-versions/setup/submit-frequency-collected.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitFrequencyCollectedService = require('../../../../app/services/return-requirements/setup/submit-frequency-collected.service.js') +const SubmitFrequencyCollectedService = require('../../../../app/services/return-versions/setup/submit-frequency-collected.service.js') -describe('Return Requirements Setup - Submit Frequency Collected service', () => { +describe('Return Versions Setup - Submit Frequency Collected service', () => { const requirementIndex = 0 let payload @@ -113,7 +113,7 @@ describe('Return Requirements Setup - Submit Frequency Collected service', () => expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select how often readings or volumes are collected', - backLink: `/system/return-requirements/setup/${session.id}/site-description/0`, + backLink: `/system/return-versions/setup/${session.id}/site-description/0`, frequencyCollected: null, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' diff --git a/test/services/return-requirements/setup/submit-frequency-reported.service.test.js b/test/services/return-versions/setup/submit-frequency-reported.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-frequency-reported.service.test.js rename to test/services/return-versions/setup/submit-frequency-reported.service.test.js index b18afc8a63..66a04d8cdd 100644 --- a/test/services/return-requirements/setup/submit-frequency-reported.service.test.js +++ b/test/services/return-versions/setup/submit-frequency-reported.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitFrequencyReportedService = require('../../../../app/services/return-requirements/setup/submit-frequency-reported.service.js') +const SubmitFrequencyReportedService = require('../../../../app/services/return-versions/setup/submit-frequency-reported.service.js') -describe('Return Requirements Setup - Submit Frequency Reported service', () => { +describe('Return Versions Setup - Submit Frequency Reported service', () => { const requirementIndex = 0 let payload @@ -113,7 +113,7 @@ describe('Return Requirements Setup - Submit Frequency Reported service', () => expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select how often readings or volumes are reported', - backLink: `/system/return-requirements/setup/${session.id}/frequency-collected/0`, + backLink: `/system/return-versions/setup/${session.id}/frequency-collected/0`, frequencyReported: null, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC' diff --git a/test/services/return-requirements/setup/submit-no-returns-required.service.test.js b/test/services/return-versions/setup/submit-no-returns-required.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-no-returns-required.service.test.js rename to test/services/return-versions/setup/submit-no-returns-required.service.test.js index 1aecc6a5e8..dbf0b8aa64 100644 --- a/test/services/return-requirements/setup/submit-no-returns-required.service.test.js +++ b/test/services/return-versions/setup/submit-no-returns-required.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitNoReturnsRequiredService = require('../../../../app/services/return-requirements/setup/submit-no-returns-required.service.js') +const SubmitNoReturnsRequiredService = require('../../../../app/services/return-versions/setup/submit-no-returns-required.service.js') -describe('Return Requirements Setup - Submit No Returns Required service', () => { +describe('Return Versions Setup - Submit No Returns Required service', () => { let payload let session let sessionData @@ -111,7 +111,7 @@ describe('Return Requirements Setup - Submit No Returns Required service', () => expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Why are no returns required?', - backLink: `/system/return-requirements/setup/${session.id}/start-date`, + backLink: `/system/return-versions/setup/${session.id}/start-date`, licenceRef: '01/ABC', reason: null }, { skip: ['sessionId', 'error'] }) diff --git a/test/services/return-requirements/setup/submit-note.service.test.js b/test/services/return-versions/setup/submit-note.service.test.js similarity index 97% rename from test/services/return-requirements/setup/submit-note.service.test.js rename to test/services/return-versions/setup/submit-note.service.test.js index 9b78f6b0ac..4dd52ccd74 100644 --- a/test/services/return-requirements/setup/submit-note.service.test.js +++ b/test/services/return-versions/setup/submit-note.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitNoteService = require('../../../../app/services/return-requirements/setup/submit-note.service.js') +const SubmitNoteService = require('../../../../app/services/return-versions/setup/submit-note.service.js') -describe('Return Requirements Setup - Submit Note service', () => { +describe('Return Versions Setup - Submit Note service', () => { const user = { username: 'carol.shaw@atari.com' } let payload @@ -157,7 +157,7 @@ describe('Return Requirements Setup - Submit Note service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Add a note', - backLink: `/system/return-requirements/setup/${session.id}/check`, + backLink: `/system/return-versions/setup/${session.id}/check`, licenceRef: '01/ABC', note: null }, { skip: ['sessionId', 'error'] }) diff --git a/test/services/return-requirements/setup/submit-points.service.test.js b/test/services/return-versions/setup/submit-points.service.test.js similarity index 95% rename from test/services/return-requirements/setup/submit-points.service.test.js rename to test/services/return-versions/setup/submit-points.service.test.js index 7d1c466833..605a04c5ff 100644 --- a/test/services/return-requirements/setup/submit-points.service.test.js +++ b/test/services/return-versions/setup/submit-points.service.test.js @@ -13,12 +13,12 @@ const PointModel = require('../../../../app/models/point.model.js') const SessionHelper = require('../../../support/helpers/session.helper.js') // Things we need to stub -const FetchPointsService = require('../../../../app/services/return-requirements/setup/fetch-points.service.js') +const FetchPointsService = require('../../../../app/services/return-versions/setup/fetch-points.service.js') // Thing under test -const SubmitPointsService = require('../../../../app/services/return-requirements/setup/submit-points.service.js') +const SubmitPointsService = require('../../../../app/services/return-versions/setup/submit-points.service.js') -describe('Return Requirements Setup - Submit Points service', () => { +describe('Return Versions Setup - Submit Points service', () => { const requirementIndex = 0 let payload @@ -128,7 +128,7 @@ describe('Return Requirements Setup - Submit Points service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the points for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/purpose/0`, + backLink: `/system/return-versions/setup/${session.id}/purpose/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licencePoints: [{ id: 'd03d7d7c-4e33-4b4d-ac9b-6ebac9a5e5f6', diff --git a/test/services/return-requirements/setup/submit-purpose.service.test.js b/test/services/return-versions/setup/submit-purpose.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-purpose.service.test.js rename to test/services/return-versions/setup/submit-purpose.service.test.js index 6a86246f47..8ee894103f 100644 --- a/test/services/return-requirements/setup/submit-purpose.service.test.js +++ b/test/services/return-versions/setup/submit-purpose.service.test.js @@ -12,12 +12,12 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Things we need to stub -const FetchPurposesService = require('../../../../app/services/return-requirements/setup/fetch-purposes.service.js') +const FetchPurposesService = require('../../../../app/services/return-versions/setup/fetch-purposes.service.js') // Thing under test -const SubmitPurposeService = require('../../../../app/services/return-requirements/setup/submit-purpose.service.js') +const SubmitPurposeService = require('../../../../app/services/return-versions/setup/submit-purpose.service.js') -describe('Return Requirements Setup - Submit Purpose service', () => { +describe('Return Versions Setup - Submit Purpose service', () => { const requirementIndex = 0 let payload @@ -132,7 +132,7 @@ describe('Return Requirements Setup - Submit Purpose service', () => { text: 'Select any purpose for the requirements for returns' }, pageTitle: 'Select the purpose for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/method`, + backLink: `/system/return-versions/setup/${session.id}/method`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', purposes: [ @@ -161,7 +161,7 @@ describe('Return Requirements Setup - Submit Purpose service', () => { text: 'Purpose description must be 100 characters or less' }, pageTitle: 'Select the purpose for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/method`, + backLink: `/system/return-versions/setup/${session.id}/method`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', purposes: [ diff --git a/test/services/return-requirements/setup/submit-reason.service.test.js b/test/services/return-versions/setup/submit-reason.service.test.js similarity index 95% rename from test/services/return-requirements/setup/submit-reason.service.test.js rename to test/services/return-versions/setup/submit-reason.service.test.js index df7b5c35dc..dacdfce97f 100644 --- a/test/services/return-requirements/setup/submit-reason.service.test.js +++ b/test/services/return-versions/setup/submit-reason.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitReasonService = require('../../../../app/services/return-requirements/setup/submit-reason.service.js') +const SubmitReasonService = require('../../../../app/services/return-versions/setup/submit-reason.service.js') -describe('Return Requirements Setup - Submit Reason service', () => { +describe('Return Versions Setup - Submit Reason service', () => { let payload let session let sessionData @@ -114,7 +114,7 @@ describe('Return Requirements Setup - Submit Reason service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the reason for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/start-date`, + backLink: `/system/return-versions/setup/${session.id}/start-date`, licenceRef: '01/ABC', reason: null }, { skip: ['sessionId', 'error'] }) diff --git a/test/services/return-requirements/setup/submit-remove.service.test.js b/test/services/return-versions/setup/submit-remove.service.test.js similarity index 95% rename from test/services/return-requirements/setup/submit-remove.service.test.js rename to test/services/return-versions/setup/submit-remove.service.test.js index 25551c32e7..cbdf28142d 100644 --- a/test/services/return-requirements/setup/submit-remove.service.test.js +++ b/test/services/return-versions/setup/submit-remove.service.test.js @@ -13,9 +13,9 @@ const SessionHelper = require('../../../support/helpers/session.helper.js') const { generateUUID } = require('../../../../app/lib/general.lib.js') // Thing under test -const SubmitRemoveService = require('../../../../app/services/return-requirements/setup/submit-remove.service.js') +const SubmitRemoveService = require('../../../../app/services/return-versions/setup/submit-remove.service.js') -describe('Return Requirements Setup - Submit Remove service', () => { +describe('Return Versions Setup - Submit Remove service', () => { const requirementIndex = 0 let session diff --git a/test/services/return-requirements/setup/submit-returns-cycle.service.test.js b/test/services/return-versions/setup/submit-returns-cycle.service.test.js similarity index 94% rename from test/services/return-requirements/setup/submit-returns-cycle.service.test.js rename to test/services/return-versions/setup/submit-returns-cycle.service.test.js index 970134a542..12e5e96bf8 100644 --- a/test/services/return-requirements/setup/submit-returns-cycle.service.test.js +++ b/test/services/return-versions/setup/submit-returns-cycle.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitReturnsCycleService = require('../../../../app/services/return-requirements/setup/submit-returns-cycle.service.js') +const SubmitReturnsCycleService = require('../../../../app/services/return-versions/setup/submit-returns-cycle.service.js') -describe('Return Requirements Setup - Submit Returns Cycle service', () => { +describe('Return Versions Setup - Submit Returns Cycle service', () => { const requirementIndex = 0 let payload @@ -113,7 +113,7 @@ describe('Return Requirements Setup - Submit Returns Cycle service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Select the returns cycle for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/abstraction-period/0`, + backLink: `/system/return-versions/setup/${session.id}/abstraction-period/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', returnsCycle: null diff --git a/test/services/return-requirements/setup/submit-site-description.service.test.js b/test/services/return-versions/setup/submit-site-description.service.test.js similarity index 96% rename from test/services/return-requirements/setup/submit-site-description.service.test.js rename to test/services/return-versions/setup/submit-site-description.service.test.js index a663b51dc9..1cdde50bee 100644 --- a/test/services/return-requirements/setup/submit-site-description.service.test.js +++ b/test/services/return-versions/setup/submit-site-description.service.test.js @@ -12,9 +12,9 @@ const { expect } = Code const SessionHelper = require('../../../support/helpers/session.helper.js') // Things under test -const SubmitSiteDescriptionService = require('../../../../app/services/return-requirements/setup/submit-site-description.service.js') +const SubmitSiteDescriptionService = require('../../../../app/services/return-versions/setup/submit-site-description.service.js') -describe('Return Requirements Setup - Submit Site Description service', () => { +describe('Return Versions Setup - Submit Site Description service', () => { const requirementIndex = 0 let payload @@ -113,7 +113,7 @@ describe('Return Requirements Setup - Submit Site Description service', () => { expect(result).to.equal({ activeNavBar: 'search', pageTitle: 'Enter a site description for the requirements for returns', - backLink: `/system/return-requirements/setup/${session.id}/returns-cycle/0`, + backLink: `/system/return-versions/setup/${session.id}/returns-cycle/0`, licenceId: '8b7f78ba-f3ad-4cb6-a058-78abc4d1383d', licenceRef: '01/ABC', siteDescription: null diff --git a/test/services/return-requirements/setup/submit-start-date.service.test.js b/test/services/return-versions/setup/submit-start-date.service.test.js similarity index 98% rename from test/services/return-requirements/setup/submit-start-date.service.test.js rename to test/services/return-versions/setup/submit-start-date.service.test.js index 2927fff04e..883a29de0b 100644 --- a/test/services/return-requirements/setup/submit-start-date.service.test.js +++ b/test/services/return-versions/setup/submit-start-date.service.test.js @@ -13,9 +13,9 @@ const FeatureFlagsConfig = require('../../../../config/feature-flags.config.js') const SessionHelper = require('../../../support/helpers/session.helper.js') // Thing under test -const SubmitStartDateService = require('../../../../app/services/return-requirements/setup/submit-start-date.service.js') +const SubmitStartDateService = require('../../../../app/services/return-versions/setup/submit-start-date.service.js') -describe('Return Requirements Setup - Submit Start Date service', () => { +describe('Return Versions Setup - Submit Start Date service', () => { let payload let session let sessionData diff --git a/test/services/return-requirements/view.service.test.js b/test/services/return-versions/view.service.test.js similarity index 95% rename from test/services/return-requirements/view.service.test.js rename to test/services/return-versions/view.service.test.js index 43eb7bb7e2..ac2f2b832b 100644 --- a/test/services/return-requirements/view.service.test.js +++ b/test/services/return-versions/view.service.test.js @@ -14,12 +14,12 @@ const LicenceModel = require('../../../app/models/licence.model.js') const ReturnVersionModel = require('../../../app/models/return-version.model.js') // Things we want to stub -const FetchReturnVersionService = require('../../../app/services/return-requirements/fetch-return-version.service.js') +const FetchReturnVersionService = require('../../../app/services/return-versions/fetch-return-version.service.js') // Thing under test -const ViewService = require('../../../app/services/return-requirements/view.service.js') +const ViewService = require('../../../app/services/return-versions/view.service.js') -describe('Return Requirements - View service', () => { +describe('Return Versions - View service', () => { const returnVersionId = '0c6ed18f-39fb-4d70-93bb-cf24453dbb70' beforeEach(async () => { diff --git a/test/validators/return-requirements/setup/abstraction-period.validator.test.js b/test/validators/return-versions/setup/abstraction-period.validator.test.js similarity index 96% rename from test/validators/return-requirements/setup/abstraction-period.validator.test.js rename to test/validators/return-versions/setup/abstraction-period.validator.test.js index 222ea12f2d..edbeb6d41f 100644 --- a/test/validators/return-requirements/setup/abstraction-period.validator.test.js +++ b/test/validators/return-versions/setup/abstraction-period.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const AbstractionPeriodValidator = require('../../../../app/validators/return-requirements/setup/abstraction-period.validator.js') +const AbstractionPeriodValidator = require('../../../../app/validators/return-versions/setup/abstraction-period.validator.js') -describe('Return Requirements Setup - Abstraction Period validator', () => { +describe('Return Versions Setup - Abstraction Period validator', () => { let payload describe('when valid data is provided', () => { diff --git a/test/validators/return-requirements/setup/additional-submission-options.validator.test.js b/test/validators/return-versions/setup/additional-submission-options.validator.test.js similarity index 89% rename from test/validators/return-requirements/setup/additional-submission-options.validator.test.js rename to test/validators/return-versions/setup/additional-submission-options.validator.test.js index 14dcf9890d..cabc72c035 100644 --- a/test/validators/return-requirements/setup/additional-submission-options.validator.test.js +++ b/test/validators/return-versions/setup/additional-submission-options.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const AdditionalSubmissionOptionsValidator = require('../../../../app/validators/return-requirements/setup/additional-submission-options.validator.js') +const AdditionalSubmissionOptionsValidator = require('../../../../app/validators/return-versions/setup/additional-submission-options.validator.js') -describe('Return Requirements Setup - Additional Submission Options validator', () => { +describe('Return Versions Setup - Additional Submission Options validator', () => { describe('when valid data is provided', () => { const payload = { additionalSubmissionOptions: [ diff --git a/test/validators/return-requirements/setup/agreements-exceptions.validator.test.js b/test/validators/return-versions/setup/agreements-exceptions.validator.test.js similarity index 91% rename from test/validators/return-requirements/setup/agreements-exceptions.validator.test.js rename to test/validators/return-versions/setup/agreements-exceptions.validator.test.js index a0df9ccaab..5c0f471aa0 100644 --- a/test/validators/return-requirements/setup/agreements-exceptions.validator.test.js +++ b/test/validators/return-versions/setup/agreements-exceptions.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const AgreementsExceptionsValidator = require('../../../../app/validators/return-requirements/setup/agreements-exceptions.validator.js') +const AgreementsExceptionsValidator = require('../../../../app/validators/return-versions/setup/agreements-exceptions.validator.js') -describe('Return Requirements Setup - Agreements Exception validator', () => { +describe('Return Versions Setup - Agreements Exception validator', () => { let payload describe('when valid data is provided', () => { diff --git a/test/validators/return-requirements/setup/existing.validator.test.js b/test/validators/return-versions/setup/existing.validator.test.js similarity index 93% rename from test/validators/return-requirements/setup/existing.validator.test.js rename to test/validators/return-versions/setup/existing.validator.test.js index e7efcd955a..1144d5a534 100644 --- a/test/validators/return-requirements/setup/existing.validator.test.js +++ b/test/validators/return-versions/setup/existing.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const ExistingValidator = require('../../../../app/validators/return-requirements/setup/existing.validator.js') +const ExistingValidator = require('../../../../app/validators/return-versions/setup/existing.validator.js') -describe('Return Requirements Setup - Existing validator', () => { +describe('Return Versions Setup - Existing validator', () => { const returnVersions = [ { id: '60b5d10d-1372-4fb2-b222-bfac81da69ab', reason: null, startDate: '2023-01-01T00:00:00.000Z' diff --git a/test/validators/return-requirements/setup/frequency-collected.validator.test.js b/test/validators/return-versions/setup/frequency-collected.validator.test.js similarity index 90% rename from test/validators/return-requirements/setup/frequency-collected.validator.test.js rename to test/validators/return-versions/setup/frequency-collected.validator.test.js index 3184f9c518..a0faf21f15 100644 --- a/test/validators/return-requirements/setup/frequency-collected.validator.test.js +++ b/test/validators/return-versions/setup/frequency-collected.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const FrequencyCollectedValidator = require('../../../../app/validators/return-requirements/setup/frequency-collected.validator.js') +const FrequencyCollectedValidator = require('../../../../app/validators/return-versions/setup/frequency-collected.validator.js') -describe('Return Requirements Setup - Frequency Collected validator', () => { +describe('Return Versions Setup - Frequency Collected validator', () => { let payload describe('when valid data is provided', () => { diff --git a/test/validators/return-requirements/setup/frequency-reported.validator.test.js b/test/validators/return-versions/setup/frequency-reported.validator.test.js similarity index 90% rename from test/validators/return-requirements/setup/frequency-reported.validator.test.js rename to test/validators/return-versions/setup/frequency-reported.validator.test.js index b98f69b6dc..240153ebb6 100644 --- a/test/validators/return-requirements/setup/frequency-reported.validator.test.js +++ b/test/validators/return-versions/setup/frequency-reported.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const FrequencyReportedValidator = require('../../../../app/validators/return-requirements/setup/frequency-reported.validator.js') +const FrequencyReportedValidator = require('../../../../app/validators/return-versions/setup/frequency-reported.validator.js') -describe('Return Requirements Setup - Frequency reported validator', () => { +describe('Return Versions Setup - Frequency reported validator', () => { let payload describe('when valid data is provided', () => { diff --git a/test/validators/return-requirements/setup/method.validator.test.js b/test/validators/return-versions/setup/method.validator.test.js similarity index 92% rename from test/validators/return-requirements/setup/method.validator.test.js rename to test/validators/return-versions/setup/method.validator.test.js index 8b4e08ec5b..8d7fa7a588 100644 --- a/test/validators/return-requirements/setup/method.validator.test.js +++ b/test/validators/return-versions/setup/method.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const MethodValidator = require('../../../../app/validators/return-requirements/setup/method.validator.js') +const MethodValidator = require('../../../../app/validators/return-versions/setup/method.validator.js') -describe('Return Requirements Setup - Method validator', () => { +describe('Return Versions Setup - Method validator', () => { describe('when valid data is provided', () => { it('confirms the data is valid', () => { const result = MethodValidator.go({ method: 'use-abstraction-data' }) diff --git a/test/validators/return-requirements/setup/no-returns-required.validator.test.js b/test/validators/return-versions/setup/no-returns-required.validator.test.js similarity index 90% rename from test/validators/return-requirements/setup/no-returns-required.validator.test.js rename to test/validators/return-versions/setup/no-returns-required.validator.test.js index 6b95ced846..76faf8c9a9 100644 --- a/test/validators/return-requirements/setup/no-returns-required.validator.test.js +++ b/test/validators/return-versions/setup/no-returns-required.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const NoReturnsRequiredValidator = require('../../../../app/validators/return-requirements/setup/no-returns-required.validator.js') +const NoReturnsRequiredValidator = require('../../../../app/validators/return-versions/setup/no-returns-required.validator.js') -describe('Return Requirements Setup - No Returns Required validator', () => { +describe('Return Versions Setup - No Returns Required validator', () => { describe('when valid data is provided', () => { it('confirms the data is valid', () => { const result = NoReturnsRequiredValidator.go({ reason: 'licence-conditions-do-not-require-returns' }) diff --git a/test/validators/return-requirements/setup/note.validator.test.js b/test/validators/return-versions/setup/note.validator.test.js similarity index 95% rename from test/validators/return-requirements/setup/note.validator.test.js rename to test/validators/return-versions/setup/note.validator.test.js index 159b63a0cf..dec806b162 100644 --- a/test/validators/return-requirements/setup/note.validator.test.js +++ b/test/validators/return-versions/setup/note.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const NoteValidator = require('../../../../app/validators/return-requirements/setup/note.validator.js') +const NoteValidator = require('../../../../app/validators/return-versions/setup/note.validator.js') -describe('Return Requirements Setup - Note validator', () => { +describe('Return Versions Setup - Note validator', () => { describe('when valid data is provided', () => { it('confirms the data is valid', () => { const result = NoteValidator.go({ note: 'Note added to return requirement' }) diff --git a/test/validators/return-requirements/setup/points.validator.test.js b/test/validators/return-versions/setup/points.validator.test.js similarity index 92% rename from test/validators/return-requirements/setup/points.validator.test.js rename to test/validators/return-versions/setup/points.validator.test.js index cd40985506..7b2391fd52 100644 --- a/test/validators/return-requirements/setup/points.validator.test.js +++ b/test/validators/return-versions/setup/points.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const PointsValidator = require('../../../../app/validators/return-requirements/setup/points.validator.js') +const PointsValidator = require('../../../../app/validators/return-versions/setup/points.validator.js') -describe('Return Requirements Setup - Point validator', () => { +describe('Return Versions Setup - Point validator', () => { describe('when valid data is provided', () => { const points = [ 'c083c0cc-42ca-4917-a929-e1fed906ff66', diff --git a/test/validators/return-requirements/setup/purpose.validator.test.js b/test/validators/return-versions/setup/purpose.validator.test.js similarity index 97% rename from test/validators/return-requirements/setup/purpose.validator.test.js rename to test/validators/return-versions/setup/purpose.validator.test.js index 420ee5372f..637f4dae5d 100644 --- a/test/validators/return-requirements/setup/purpose.validator.test.js +++ b/test/validators/return-versions/setup/purpose.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const PurposeValidator = require('../../../../app/validators/return-requirements/setup/purpose.validator.js') +const PurposeValidator = require('../../../../app/validators/return-versions/setup/purpose.validator.js') -describe('Return Requirements Setup - Purpose validator', () => { +describe('Return Versions Setup - Purpose validator', () => { const validPurposeIds = [ '14794d57-1acf-4c91-8b48-4b1ec68bfd6f', '49088608-ee9f-491a-8070-6831240945ac', diff --git a/test/validators/return-requirements/setup/reason.validator.test.js b/test/validators/return-versions/setup/reason.validator.test.js similarity index 92% rename from test/validators/return-requirements/setup/reason.validator.test.js rename to test/validators/return-versions/setup/reason.validator.test.js index dc2a0a2b05..ebb6734ddf 100644 --- a/test/validators/return-requirements/setup/reason.validator.test.js +++ b/test/validators/return-versions/setup/reason.validator.test.js @@ -8,9 +8,9 @@ const { describe, it } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const ReasonValidator = require('../../../../app/validators/return-requirements/setup/reason.validator.js') +const ReasonValidator = require('../../../../app/validators/return-versions/setup/reason.validator.js') -describe('Return Requirements Setup - Reason validator', () => { +describe('Return Versions Setup - Reason validator', () => { describe('when valid data is provided', () => { it('confirms the data is valid', () => { const result = ReasonValidator.go({ reason: 'new-licence' }) diff --git a/test/validators/return-requirements/setup/returns-cycle.validator.test.js b/test/validators/return-versions/setup/returns-cycle.validator.test.js similarity index 90% rename from test/validators/return-requirements/setup/returns-cycle.validator.test.js rename to test/validators/return-versions/setup/returns-cycle.validator.test.js index 191212a1f2..630982f979 100644 --- a/test/validators/return-requirements/setup/returns-cycle.validator.test.js +++ b/test/validators/return-versions/setup/returns-cycle.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const ReturnsCycleValidator = require('../../../../app/validators/return-requirements/setup/returns-cycle.validator.js') +const ReturnsCycleValidator = require('../../../../app/validators/return-versions/setup/returns-cycle.validator.js') -describe('Return Requirements Setup - Returns Cycle validator', () => { +describe('Return Versions Setup - Returns Cycle validator', () => { let payload describe('when valid data is provided', () => { diff --git a/test/validators/return-requirements/setup/site-description.validator.test.js b/test/validators/return-versions/setup/site-description.validator.test.js similarity index 94% rename from test/validators/return-requirements/setup/site-description.validator.test.js rename to test/validators/return-versions/setup/site-description.validator.test.js index 7f4e604640..98e14cad00 100644 --- a/test/validators/return-requirements/setup/site-description.validator.test.js +++ b/test/validators/return-versions/setup/site-description.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const SiteDescriptionValidator = require('../../../../app/validators/return-requirements/setup/site-description.validator.js') +const SiteDescriptionValidator = require('../../../../app/validators/return-versions/setup/site-description.validator.js') -describe('Return Requirements Setup - Site Description validator', () => { +describe('Return Versions Setup - Site Description validator', () => { let payload describe('when a valid payload is provided', () => { diff --git a/test/validators/return-requirements/setup/start-date.validator.test.js b/test/validators/return-versions/setup/start-date.validator.test.js similarity index 98% rename from test/validators/return-requirements/setup/start-date.validator.test.js rename to test/validators/return-versions/setup/start-date.validator.test.js index acb9600239..5b44f59df6 100644 --- a/test/validators/return-requirements/setup/start-date.validator.test.js +++ b/test/validators/return-versions/setup/start-date.validator.test.js @@ -8,9 +8,9 @@ const { describe, it, beforeEach } = exports.lab = Lab.script() const { expect } = Code // Thing under test -const StartDateValidator = require('../../../../app/validators/return-requirements/setup/start-date.validator.js') +const StartDateValidator = require('../../../../app/validators/return-versions/setup/start-date.validator.js') -describe('Return Requirements Setup - Start Date validator', () => { +describe('Return Versions Setup - Start Date validator', () => { const licenceEndDate = '2023-12-31T00:00:00.000Z' const licenceStartDate = '2023-01-01T00:00:00.000Z'