@defra-fish/gafl-webapp-service 1.70.0 → 1.71.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.71.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.71.0-rc.0",
|
|
40
|
+
"@defra-fish/connectors-lib": "1.71.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": "fa8ad0d1d338a670b9d1c5fc65f1b4ab80eef3f4"
|
|
83
83
|
}
|
package/src/locales/cy.json
CHANGED
|
@@ -145,14 +145,15 @@
|
|
|
145
145
|
"cancel_rp_identify_body": "Ni fydd canslo eich cytundeb taliad cerdyn rheolaidd yn canslo nac yn ad-dalu eich trwydded gyfredol. Gallwch barhau i bysgota tan fydd eich trwydded gyfredol yn dod i ben ond ni fydd eich trwydded yn adnewyddu’n awtomatig.",
|
|
146
146
|
"cancel_rp_identify_ref_number": "Chwe nodyn olaf eich trwydded",
|
|
147
147
|
"cancel_rp_identify_ref_number_hint": "Er enghraifft, F4A315",
|
|
148
|
-
"cancel_rp_identify_ref_number_error": "
|
|
149
|
-
"cancel_rp_identify_ref_pattern": "
|
|
148
|
+
"cancel_rp_identify_ref_number_error": "Rhowch chwe nodyn olaf eich trwydded",
|
|
149
|
+
"cancel_rp_identify_ref_pattern": "Nid yw chwe nodyn olaf eich trwydded yn edrych yn gywir. Gwiriwch a rhowch gynnig arall arni",
|
|
150
150
|
"cancel_rp_identify_dob": "Dyddiad geni",
|
|
151
151
|
"cancel_rp_identify_dob_hint": "Er enghraifft, 31 3 1980",
|
|
152
152
|
"cancel_rp_identify_postcode": "Cod post",
|
|
153
153
|
"cancel_rp_identify_postcode_hint": "Er enghraifft, WA4 1AB",
|
|
154
|
-
"cancel_rp_identify_postcode_error": "
|
|
155
|
-
"
|
|
154
|
+
"cancel_rp_identify_postcode_error": "Nodwch god post",
|
|
155
|
+
"cancel_rp_identify_postcode_error_empty": "Nid ydych wedi nodi cod post",
|
|
156
|
+
"cancel_rp_identify_postcode_pattern": "Nid yw’r cod post yn edrych yn gywir. Gwiriwch a rhowch gynnig arall arni",
|
|
156
157
|
"change_licence_details_you": "Adolygu neu newid manylion eich trwydded",
|
|
157
158
|
"change_licence_details_other": "Adolygu neu newid manylion y drwydded",
|
|
158
159
|
"change_licence_number": "Newid rhif y drwydded",
|
|
@@ -350,7 +351,7 @@
|
|
|
350
351
|
"identify_error_missing_month": "Mae’n rhaid i’r dyddiad geni gynnwys mis",
|
|
351
352
|
"identify_error_missing_year": "Mae’n rhaid i’r dyddiad geni gynnwys blwyddyn",
|
|
352
353
|
"identify_error_non_numeric": "Rhowch rifau yn unig",
|
|
353
|
-
"identify_error_pattern_postcode": "
|
|
354
|
+
"identify_error_pattern_postcode": "Nid yw’r cod post yn edrych yn gywir. Gwiriwch a rhowch gynnig arall arni",
|
|
354
355
|
"identify_error_pattern": "Nid yw chwe nodyn olaf eich trwydded yn edrych yn gywir. Gwiriwch a rhowch gynnig arall arni",
|
|
355
356
|
"identify_error_year_min": "Mae’r dyddiad geni yn rhy bell yn ôl",
|
|
356
357
|
"identify_error_year_max": "Mae'n rhaid i’r dyddiad geni fod yn y gorffennol",
|
package/src/locales/en.json
CHANGED
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
"cancel_rp_identify_postcode": "Postcode",
|
|
153
153
|
"cancel_rp_identify_postcode_hint": "For example, WA4 1AB",
|
|
154
154
|
"cancel_rp_identify_postcode_error": "Enter a postcode",
|
|
155
|
+
"cancel_rp_identify_postcode_error_empty": "You did not enter a postcode",
|
|
155
156
|
"cancel_rp_identify_postcode_pattern": "Your postcode doesn’t look right. Check and enter again",
|
|
156
157
|
"change_licence_details_you": "Review or change the licence details",
|
|
157
158
|
"change_licence_details_other": "Review or change the licence details",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
'string.pattern.base': { text: mssgs.cancel_rp_identify_ref_pattern, ref: '#ref' }
|
|
19
19
|
},
|
|
20
20
|
'postcode': {
|
|
21
|
-
'string.empty': { ref: '#postcode', text: mssgs.
|
|
21
|
+
'string.empty': { ref: '#postcode', text: mssgs.cancel_rp_identify_postcode_error_empty },
|
|
22
22
|
'string.pattern.base': { ref: '#postcode', text: mssgs.cancel_rp_identify_postcode_pattern }
|
|
23
23
|
},
|
|
24
24
|
'full-date': {
|
|
@@ -5,6 +5,7 @@ import { validation } from '@defra-fish/business-rules-lib'
|
|
|
5
5
|
import { addLanguageCodeToUri } from '../../../../processors/uri-helper.js'
|
|
6
6
|
import GetDataRedirect from '../../../../handlers/get-data-redirect.js'
|
|
7
7
|
import { dateOfBirthValidator, getDateErrorFlags } from '../../../../schema/validators/validators.js'
|
|
8
|
+
import { runValidators } from '../../../../utils/validators.js'
|
|
8
9
|
|
|
9
10
|
export const getData = async request => {
|
|
10
11
|
const permission = await request.cache().helpers.transaction.getCurrentPermission()
|
|
@@ -35,17 +36,22 @@ export const getData = async request => {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export const validator = payload => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
runValidators(
|
|
40
|
+
[
|
|
41
|
+
p =>
|
|
42
|
+
Joi.assert(
|
|
43
|
+
{
|
|
44
|
+
postcode: p.postcode,
|
|
45
|
+
referenceNumber: p.referenceNumber
|
|
46
|
+
},
|
|
47
|
+
Joi.object({
|
|
48
|
+
referenceNumber: validation.permission.permissionNumberUniqueComponentValidator(Joi),
|
|
49
|
+
postcode: validation.contact.createOverseasPostcodeValidator(Joi)
|
|
50
|
+
}).options({ abortEarly: false })
|
|
51
|
+
),
|
|
52
|
+
dateOfBirthValidator
|
|
53
|
+
],
|
|
54
|
+
payload
|
|
49
55
|
)
|
|
50
56
|
}
|
|
51
57
|
|