@defra-fish/gafl-webapp-service 1.65.0-rc.4 → 1.65.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/gafl-webapp-service",
3
- "version": "1.65.0-rc.4",
3
+ "version": "1.65.0-rc.6",
4
4
  "description": "The websales frontend for the GAFL service",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,8 +36,8 @@
36
36
  "prepare": "gulp --gulpfile build/gulpfile.cjs"
37
37
  },
38
38
  "dependencies": {
39
- "@defra-fish/business-rules-lib": "1.65.0-rc.4",
40
- "@defra-fish/connectors-lib": "1.65.0-rc.4",
39
+ "@defra-fish/business-rules-lib": "1.65.0-rc.6",
40
+ "@defra-fish/connectors-lib": "1.65.0-rc.6",
41
41
  "@defra/hapi-gapi": "2.0.0",
42
42
  "@hapi/boom": "9.1.2",
43
43
  "@hapi/catbox-redis": "6.0.2",
@@ -79,5 +79,5 @@
79
79
  "./gafl-jest-matchers.js"
80
80
  ]
81
81
  },
82
- "gitHead": "47a57b982b698bea3a6e03473d7bbaa4ec733180"
82
+ "gitHead": "b6f6c0f7013edf124c9509603b05fe626170d68a"
83
83
  }
@@ -1,5 +1,11 @@
1
1
  import handler from '../cancel-recurring-payment-authentication-handler'
2
- import { CANCEL_RP_IDENTIFY, CANCEL_RP_DETAILS, CANCEL_RP_AGREEMENT_NOT_FOUND, CANCEL_RP_ALREADY_CANCELLED } from '../../uri.js'
2
+ import {
3
+ CANCEL_RP_IDENTIFY,
4
+ CANCEL_RP_DETAILS,
5
+ CANCEL_RP_AGREEMENT_NOT_FOUND,
6
+ CANCEL_RP_ALREADY_CANCELLED,
7
+ CANCEL_RP_LICENCE_NOT_FOUND
8
+ } from '../../uri.js'
3
9
  import { salesApi } from '@defra-fish/connectors-lib'
4
10
 
5
11
  jest.mock('../../processors/uri-helper.js')
@@ -20,7 +26,8 @@ jest.mock('../../uri.js', () => ({
20
26
  CANCEL_RP_IDENTIFY: { page: 'cancel-rp-identify page', uri: Symbol('cancel-rp-identify-uri') },
21
27
  CANCEL_RP_DETAILS: { uri: Symbol('cancel-rp-details-uri') },
22
28
  CANCEL_RP_AGREEMENT_NOT_FOUND: { uri: Symbol('cancel-rp-agreement-not-found-uri') },
23
- CANCEL_RP_ALREADY_CANCELLED: { uri: Symbol('cancel-rp-already-cancelled-uri ') }
29
+ CANCEL_RP_ALREADY_CANCELLED: { uri: Symbol('cancel-rp-already-cancelled-uri ') },
30
+ CANCEL_RP_LICENCE_NOT_FOUND: { uri: Symbol('cancel-rp-licence-not-found-uri') }
24
31
  }))
25
32
  jest.mock('../../processors/recurring-payments-write-cache.js')
26
33
 
@@ -100,9 +107,9 @@ describe('Cancel RP Authentication Handler', () => {
100
107
  })
101
108
 
102
109
  describe('Unsuccessful authentication - no match', () => {
103
- it('redirects to the CANCEL_RP_IDENTIFY.uri', async () => {
110
+ it('redirects to the CANCEL_RP_LICENCE_NOT_FOUND.uri', async () => {
104
111
  const { h } = await invokeHandlerWithMocks({ salesApiResponse: null })
105
- expect(h.redirectWithLanguageCode).toHaveBeenCalledWith(CANCEL_RP_IDENTIFY.uri)
112
+ expect(h.redirectWithLanguageCode).toHaveBeenCalledWith(CANCEL_RP_LICENCE_NOT_FOUND.uri)
106
113
  })
107
114
 
108
115
  it('returns value of redirect', async () => {
@@ -122,7 +129,7 @@ describe('Cancel RP Authentication Handler', () => {
122
129
  CANCEL_RP_IDENTIFY.page,
123
130
  expect.objectContaining({
124
131
  payload: expect.any(Object),
125
- error: { referenceNumber: 'not-found' }
132
+ errorRedirect: true
126
133
  })
127
134
  )
128
135
  })
@@ -1,4 +1,10 @@
1
- import { CANCEL_RP_IDENTIFY, CANCEL_RP_DETAILS, CANCEL_RP_AGREEMENT_NOT_FOUND, CANCEL_RP_ALREADY_CANCELLED } from '../../src/uri.js'
1
+ import {
2
+ CANCEL_RP_IDENTIFY,
3
+ CANCEL_RP_DETAILS,
4
+ CANCEL_RP_AGREEMENT_NOT_FOUND,
5
+ CANCEL_RP_ALREADY_CANCELLED,
6
+ CANCEL_RP_LICENCE_NOT_FOUND
7
+ } from '../../src/uri.js'
2
8
  import { salesApi } from '@defra-fish/connectors-lib'
3
9
  import { validation } from '@defra-fish/business-rules-lib'
4
10
  import { setupCancelRecurringPaymentCacheFromAuthResult } from '../processors/recurring-payments-write-cache.js'
@@ -32,7 +38,8 @@ const cancelRecurringPaymentAuthenticationHandler = async (request, h) => {
32
38
  }
33
39
 
34
40
  if (!authenticationResult) {
35
- context.pageData.error = { referenceNumber: 'not-found' }
41
+ context.pageData.errorRedirect = true
42
+ context.redirectUri = CANCEL_RP_LICENCE_NOT_FOUND.uri
36
43
  } else if (!authenticationResult.recurringPayment) {
37
44
  context.pageData.errorRedirect = true
38
45
  context.redirectUri = CANCEL_RP_AGREEMENT_NOT_FOUND.uri
@@ -440,6 +440,10 @@
440
440
  "licence_not_found_body_ea_link": "enquiries@environment-agency.gov.uk",
441
441
  "licence_not_found_body_3": " neu ffonio 03708 506 506 (8am - 6pm o ddydd Llun i ddydd Gwener, ac eithrio gwyliau cyhoeddus). ",
442
442
  "licence_not_found_body_call_charges_link": "Gallwch weld costau’r galwadau yma (yn agor mewn tab newydd)",
443
+ "licence_not_found_rp_body_1": "If you keep seeing this page you can cancel your recurring card payment by:",
444
+ "licence_not_found_rp_bullet_point_1": "emailing ",
445
+ "licence_not_found_rp_bullet_point_1_2": " up to 15 days before your payment date",
446
+ "licence_not_found_rp_bullet_point_2": "calling 03708 506 506 (8am to 6pm, Monday to Friday, except public holidays) up to the day before your payment date.",
443
447
  "licence_start_days": " diwrnod nesaf",
444
448
  "licence_start_enter_todays_date": "Rhowch ddyddiad heddiw os ydych chi am i’r drwydded 1 diwrnod neu 8 diwrnod ddechrau yn hwyrach heddiw.",
445
449
  "licence_start_error_date_real": "Mae’n rhaid i ddyddiad dechrau’r drwydded fod yn ddyddiad dilys",
@@ -439,6 +439,10 @@
439
439
  "licence_not_found_body_ea_link": "enquiries@environment-agency.gov.uk",
440
440
  "licence_not_found_body_3": " or calling 03708 506 506 (8am to 6pm, Monday to Friday, except public holidays). ",
441
441
  "licence_not_found_body_call_charges_link": "View call charges (opens in new tab)",
442
+ "licence_not_found_rp_body_1": "If you keep seeing this page you can cancel your recurring card payment by:",
443
+ "licence_not_found_rp_bullet_point_1": "emailing ",
444
+ "licence_not_found_rp_bullet_point_1_2": " up to 15 days before your payment date",
445
+ "licence_not_found_rp_bullet_point_2": "calling 03708 506 506 (8am to 6pm, Monday to Friday, except public holidays) up to the day before your payment date.",
442
446
  "licence_num": "Licence number",
443
447
  "licence_start_days": " days",
444
448
  "licence_start_enter_todays_date": "Enter today’s date if you want the 1-day or 8-day licence to start later today.",
@@ -0,0 +1,21 @@
1
+ import pageRoute from '../../../../../routes/page-route.js'
2
+ import { CANCEL_RP_LICENCE_NOT_FOUND } from '../../../../../uri.js'
3
+ import '../route.js'
4
+
5
+ jest.mock('../../../../../routes/page-route.js', () => jest.fn())
6
+ jest.mock('../../../../../uri.js', () => ({
7
+ CANCEL_RP_LICENCE_NOT_FOUND: {
8
+ page: Symbol('licence-not-found page'),
9
+ uri: Symbol('licence-not-found uri')
10
+ }
11
+ }))
12
+
13
+ describe('CANCEL_RP_LICENCE_NOT_FOUND route', () => {
14
+ it('passes CANCEL_RP_LICENCE_NOT_FOUND.page as the first argument to pageRoute', () => {
15
+ expect(pageRoute).toHaveBeenCalledWith(CANCEL_RP_LICENCE_NOT_FOUND.page, expect.anything())
16
+ })
17
+
18
+ it('passes CANCEL_RP_LICENCE_NOT_FOUND.uri as the second argument to pageRoute', () => {
19
+ expect(pageRoute).toHaveBeenCalledWith(expect.anything(), CANCEL_RP_LICENCE_NOT_FOUND.uri)
20
+ })
21
+ })
@@ -0,0 +1,27 @@
1
+ {% extends "layout.njk" %}
2
+ {% extends "standard-form.njk" %}
3
+
4
+ {% set title = mssgs.licence_not_found_title %}
5
+
6
+ {% block content %}
7
+ <div class="govuk-grid-row">
8
+ <div class="govuk-grid-column-two-thirds">
9
+ <h1 class="govuk-heading-l">{{ mssgs.licence_not_found_title }}</h1>
10
+ <p class="govuk-body">
11
+ {{ mssgs.licence_not_found_body_1 }}
12
+ <a class="govuk-link" href="/buy/renew/identify">{{ mssgs.licence_not_found_body_previous_page }}</a>{{ mssgs.full_stop }}
13
+ </p>
14
+ <p class="govuk-body">
15
+ {{ mssgs.licence_not_found_rp_body_1}}
16
+ </p>
17
+ <ul class="govuk-list govuk-list--bullet">
18
+ <li> {{ mssgs.licence_not_found_rp_bullet_point_1 }} <a href="mailto:enquiries@environment-agency.gov.uk"> {{ mssgs.licence_not_found_body_ea_link }}
19
+ </a> {{ mssgs.licence_not_found_rp_bullet_point_1_2 }} </li>
20
+
21
+ <li> {{ mssgs.licence_not_found_rp_bullet_point_2 }} <a href="https://www.gov.uk/call-charges" target="_blank" rel="noopener"> {{ mssgs.licence_not_found_body_call_charges_link }}
22
+ </a>{{ mssgs.full_stop }} </li>
23
+ </ul>
24
+
25
+ </div>
26
+ </div>
27
+ {% endblock %}
@@ -0,0 +1,4 @@
1
+ import { CANCEL_RP_LICENCE_NOT_FOUND } from '../../../../uri.js'
2
+ import pageRoute from '../../../../routes/page-route.js'
3
+
4
+ export default pageRoute(CANCEL_RP_LICENCE_NOT_FOUND.page, CANCEL_RP_LICENCE_NOT_FOUND.uri)
@@ -132,6 +132,22 @@ Object {
132
132
  },
133
133
  "path": "/buy/cancel-recurring-payment/already-cancelled",
134
134
  },
135
+ Object {
136
+ "handler": [Function],
137
+ "method": "GET",
138
+ "path": "/buy/cancel-recurring-payment/licence-not-found",
139
+ },
140
+ Object {
141
+ "handler": [Function],
142
+ "method": "POST",
143
+ "options": Object {
144
+ "validate": Object {
145
+ "failAction": [Function],
146
+ "payload": undefined,
147
+ },
148
+ },
149
+ "path": "/buy/cancel-recurring-payment/licence-not-found",
150
+ },
135
151
  ],
136
152
  }
137
153
  `;
@@ -35,7 +35,8 @@ import {
35
35
  CANCEL_RP_CONFIRM,
36
36
  CANCEL_RP_COMPLETE,
37
37
  CANCEL_RP_AGREEMENT_NOT_FOUND,
38
- CANCEL_RP_ALREADY_CANCELLED
38
+ CANCEL_RP_ALREADY_CANCELLED,
39
+ CANCEL_RP_LICENCE_NOT_FOUND
39
40
  } from '../uri.js'
40
41
 
41
42
  import { CommonResults, CONTACT_SUMMARY_SEEN, ShowDigitalLicencePages } from '../constants.js'
@@ -465,8 +466,16 @@ export default [
465
466
  current: CANCEL_RP_AGREEMENT_NOT_FOUND,
466
467
  backLink: CANCEL_RP_IDENTIFY.uri
467
468
  },
469
+ {
470
+ current: CANCEL_RP_LICENCE_NOT_FOUND,
471
+ backLink: CANCEL_RP_IDENTIFY.uri
472
+ },
468
473
  {
469
474
  current: CANCEL_RP_ALREADY_CANCELLED,
470
475
  backLink: CANCEL_RP_IDENTIFY.uri
476
+ },
477
+ {
478
+ current: CANCEL_RP_LICENCE_NOT_FOUND,
479
+ backLink: CANCEL_RP_IDENTIFY.uri
471
480
  }
472
481
  ]
@@ -5,6 +5,7 @@ import cancelRPDetails from '../pages/recurring-payments/cancel/details/route.js
5
5
  import cancelRPConfirm from '../pages/recurring-payments/cancel/confirm/route.js'
6
6
  import cancelRPComplete from '../pages/recurring-payments/cancel/complete/route.js'
7
7
  import cancelRPAgreementNotFound from '../pages/recurring-payments/cancel/agreement-not-found/route.js'
8
+ import cancelRPLicenceNotFound from '../pages/recurring-payments/cancel/licence-not-found/route.js'
8
9
  import cancelRPAlreadyCancelled from '../pages/recurring-payments/cancel/already-cancelled/route.js'
9
10
 
10
11
  const telesalesRoutes = [
@@ -40,7 +41,8 @@ if (process.env.SHOW_CANCELLATION_JOURNEY === 'true') {
40
41
  ...cancelRPConfirm,
41
42
  ...cancelRPComplete,
42
43
  ...cancelRPAgreementNotFound,
43
- ...cancelRPAlreadyCancelled
44
+ ...cancelRPAlreadyCancelled,
45
+ ...cancelRPLicenceNotFound
44
46
  )
45
47
  }
46
48
  export default telesalesRoutes
package/src/uri.js CHANGED
@@ -74,6 +74,7 @@ export const CANCEL_RP_AGREEMENT_NOT_FOUND = {
74
74
  uri: '/buy/cancel-recurring-payment/agreement-not-found',
75
75
  page: 'cancel-rp-agreement-not-found'
76
76
  }
77
+ export const CANCEL_RP_LICENCE_NOT_FOUND = { uri: '/buy/cancel-recurring-payment/licence-not-found', page: 'licence-not-found' }
77
78
  export const CANCEL_RP_ALREADY_CANCELLED = { uri: '/buy/cancel-recurring-payment/already-cancelled', page: 'already-cancelled' }
78
79
 
79
80
  /**