@defra-fish/gafl-webapp-service 1.63.0 → 1.64.0-rc.0
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.
|
|
3
|
+
"version": "1.64.0-rc.0",
|
|
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.
|
|
40
|
-
"@defra-fish/connectors-lib": "1.
|
|
39
|
+
"@defra-fish/business-rules-lib": "1.64.0-rc.0",
|
|
40
|
+
"@defra-fish/connectors-lib": "1.64.0-rc.0",
|
|
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": "
|
|
82
|
+
"gitHead": "53e28e0083ecb2c50138497dd15a0570a342eca2"
|
|
83
83
|
}
|
package/src/locales/cy.json
CHANGED
|
@@ -350,6 +350,7 @@
|
|
|
350
350
|
"identify_title": "Adnewyddu eich trwydded bysgota?",
|
|
351
351
|
"important_info_contact_content_salmon": "Byddwn yn defnyddio’r cyfeiriad e-bost neu’r rhif symudol hwn i anfon nodyn atgoffa i anfon adroddiad daliad. Mae’n bosibl y byddwn hefyd yn anfon gwybodaeth bwysig arall, megis newidiadau sy’n effeithio ar y drwydded neu is-ddeddfau pysgota.",
|
|
352
352
|
"important_info_contact_content_not_salmon": "Mae’n bosibl y byddwn hefyd yn defnyddio’r cyfeiriad e-bost neu’r rhif symudol hwn i anfon gwybodaeth bwysig, megis newidiadau sy’n effeithio ar y drwydded neu’r is-ddeddfau pysgota.",
|
|
353
|
+
"important_info_contact_content_junior_12_months": "Byddwn hefyd yn defnyddio’r cyfeiriad e-bost neu’r rhif symudol hwn i anfon nodyn atgoffa am adnewyddu neu ddiweddariadau pwysig eraill, fel newidiadau i is-ddeddfau pysgota.",
|
|
353
354
|
"important_info_contact_error_choose_short": "Dewiswch i ble y dylem anfon y drwydded bysgota",
|
|
354
355
|
"important_info_contact_error_choose": "Dewiswch sut y dylem gysylltu â deiliad y drwydded",
|
|
355
356
|
"important_info_contact_error_email": "Rhowch gyfeiriad e-bost yn y fformat cywir",
|
package/src/locales/en.json
CHANGED
|
@@ -350,6 +350,7 @@
|
|
|
350
350
|
"identify_title": "Renew your rod fishing licence?",
|
|
351
351
|
"important_info_contact_content_salmon": "We will use this email or mobile number to send a reminder to report a catch return. We may also send other important information, such as changes affecting the licence or the fishing byelaws.",
|
|
352
352
|
"important_info_contact_content_not_salmon": "We may also use this email or mobile number to send important information, such as changes affecting the licence or the fishing byelaws.",
|
|
353
|
+
"important_info_contact_content_junior_12_months": "We will also use this email or mobile number to send renewal reminders and other important updates, like changes to rod fishing byelaws.",
|
|
353
354
|
"important_info_contact_error_choose_short": "Choose where we should send the fishing licence",
|
|
354
355
|
"important_info_contact_error_choose": "Choose how we should contact the licence holder",
|
|
355
356
|
"important_info_contact_error_email": "Enter an email address in the correct format",
|
|
@@ -56,7 +56,8 @@ describe('name > route', () => {
|
|
|
56
56
|
important_info_contact_content_salmon: 'Salmon content',
|
|
57
57
|
important_info_contact_content_not_salmon: 'Not salmon content',
|
|
58
58
|
licence_confirm_method_where_title_you: 'Where send you',
|
|
59
|
-
licence_confirm_method_where_title_other: 'Where send other'
|
|
59
|
+
licence_confirm_method_where_title_other: 'Where send other',
|
|
60
|
+
important_info_contact_content_junior_12_months: 'Junior content'
|
|
60
61
|
})
|
|
61
62
|
|
|
62
63
|
describe('getData', () => {
|
|
@@ -149,10 +150,10 @@ describe('name > route', () => {
|
|
|
149
150
|
[true, 'Trout and coarse', '8D', false, 'Not salmon content'],
|
|
150
151
|
[false, 'Salmon and sea trout', '1D', false, 'Salmon content'],
|
|
151
152
|
[false, 'Trout and coarse', '1D', false, 'Not salmon content'],
|
|
152
|
-
[true, 'Salmon and sea trout', '12M', true, '
|
|
153
|
-
[true, 'Trout and coarse', '12M', true, '
|
|
154
|
-
[false, 'Salmon and sea trout', '12M', true, '
|
|
155
|
-
[false, 'Trout and coarse', '12M', true, '
|
|
153
|
+
[true, 'Salmon and sea trout', '12M', true, 'Junior content'],
|
|
154
|
+
[true, 'Trout and coarse', '12M', true, 'Junior content'],
|
|
155
|
+
[false, 'Salmon and sea trout', '12M', true, 'Junior content'],
|
|
156
|
+
[false, 'Trout and coarse', '12M', true, 'Junior content']
|
|
156
157
|
])(
|
|
157
158
|
'content has correct value depending on isLicenceForYou is %s, licenceType is %s, licenceLength is %s and junior is %s',
|
|
158
159
|
async (isLicenceForYou, licenceType, licenceLength, junior, expected) => {
|
|
@@ -13,8 +13,7 @@ export const getData = async request => {
|
|
|
13
13
|
const permission = await request.cache().helpers.transaction.getCurrentPermission()
|
|
14
14
|
const mssgs = request.i18n.getCatalog()
|
|
15
15
|
|
|
16
|
-
// We need to have set the licence length, dob and start date here to
|
|
17
|
-
// messaging
|
|
16
|
+
// We need to have set the licence length, dob and start date here to determine the contact messaging
|
|
18
17
|
if (!permission.licensee.birthDate) {
|
|
19
18
|
throw new GetDataRedirect(DATE_OF_BIRTH.uri)
|
|
20
19
|
}
|
|
@@ -29,11 +28,12 @@ export const getData = async request => {
|
|
|
29
28
|
|
|
30
29
|
const junior = hasJunior(permission)
|
|
31
30
|
const twelveMonthNonJuniorLicence = !junior && permission.licenceLength === '12M'
|
|
31
|
+
const twelveMonthJuniorLicence = junior && permission.licenceLength === '12M'
|
|
32
32
|
|
|
33
33
|
return {
|
|
34
34
|
title: getTitle(permission, mssgs, twelveMonthNonJuniorLicence),
|
|
35
35
|
postHint: getPostHint(permission, mssgs),
|
|
36
|
-
content: getContent(permission, mssgs, twelveMonthNonJuniorLicence),
|
|
36
|
+
content: getContent(permission, mssgs, twelveMonthNonJuniorLicence, twelveMonthJuniorLicence),
|
|
37
37
|
emailConfirmation: permission.licensee.preferredMethodOfConfirmation === HOW_CONTACTED.email,
|
|
38
38
|
emailText: getEmailText(permission, mssgs, twelveMonthNonJuniorLicence),
|
|
39
39
|
mobileConfirmation: permission.licensee.preferredMethodOfConfirmation === HOW_CONTACTED.text,
|
|
@@ -41,7 +41,8 @@ export const getData = async request => {
|
|
|
41
41
|
licensee: permission.licensee,
|
|
42
42
|
isPhysical: isPhysical(permission),
|
|
43
43
|
errorMessage: getErrorText(mssgs, twelveMonthNonJuniorLicence),
|
|
44
|
-
twelveMonthNonJuniorLicence
|
|
44
|
+
twelveMonthNonJuniorLicence,
|
|
45
|
+
twelveMonthJuniorLicence
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -55,8 +56,9 @@ const getTitle = (permission, messages, twelveMonthNonJuniorLicence) => {
|
|
|
55
56
|
const getPostHint = (permission, messages) =>
|
|
56
57
|
permission.isLicenceForYou ? messages.important_info_contact_post_hint_you : messages.important_info_contact_post_hint_other
|
|
57
58
|
|
|
58
|
-
const getContent = (permission, messages, twelveMonthNonJuniorLicence) => {
|
|
59
|
+
const getContent = (permission, messages, twelveMonthNonJuniorLicence, twelveMonthJuniorLicence) => {
|
|
59
60
|
const isSalmonLicense = permission.licenceType === 'Salmon and sea trout'
|
|
61
|
+
|
|
60
62
|
if (twelveMonthNonJuniorLicence) {
|
|
61
63
|
if (isSalmonLicense) {
|
|
62
64
|
return permission.isLicenceForYou
|
|
@@ -67,6 +69,11 @@ const getContent = (permission, messages, twelveMonthNonJuniorLicence) => {
|
|
|
67
69
|
? messages.important_info_contact_post_not_salmon_you
|
|
68
70
|
: messages.important_info_contact_post_not_salmon_other
|
|
69
71
|
}
|
|
72
|
+
|
|
73
|
+
if (twelveMonthJuniorLicence) {
|
|
74
|
+
return messages.important_info_contact_content_junior_12_months
|
|
75
|
+
}
|
|
76
|
+
|
|
70
77
|
return isSalmonLicense ? messages.important_info_contact_content_salmon : messages.important_info_contact_content_not_salmon
|
|
71
78
|
}
|
|
72
79
|
|