@defra/fcp-sfd-frontend-engine 0.31.1 → 0.32.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/dist/index.cjs
CHANGED
|
@@ -98,11 +98,20 @@ var MONTH_MAP = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
// src/constants/success-messages.js
|
|
101
|
+
var BUSINESS_ADDRESS = "You have updated your business address";
|
|
102
|
+
var BUSINESS_CHARITY_REGISTRATION_NUMBER = "You have updated your charity commission registration number";
|
|
103
|
+
var BUSINESS_COMPANY_REGISTRATION_NUMBER = "You have updated your company registration number";
|
|
101
104
|
var BUSINESS_EMAIL_ADDRESS = "You have updated your business email address";
|
|
105
|
+
var BUSINESS_LEGAL_STATUS = "You have updated your business legal status";
|
|
102
106
|
var BUSINESS_NAME = "You have updated your business name";
|
|
103
107
|
var BUSINESS_PHONE_NUMBERS = "You have updated your business phone numbers";
|
|
104
108
|
var BUSINESS_VAT = "You have updated your VAT registration number";
|
|
105
109
|
var BUSINESS_VAT_REMOVE = "You have removed your VAT registration number";
|
|
110
|
+
var PERSONAL_ADDRESS = "You have updated your personal address";
|
|
111
|
+
var PERSONAL_DOB = "You have updated your date of birth";
|
|
112
|
+
var PERSONAL_EMAIL_ADDRESS = "You have updated your personal email address";
|
|
113
|
+
var PERSONAL_NAME = "You have updated your full name";
|
|
114
|
+
var PERSONAL_PHONE_NUMBERS = "You have updated your personal phone numbers";
|
|
106
115
|
|
|
107
116
|
// src/constants/interrupter-journey.js
|
|
108
117
|
var PERSONAL_SECTION_FIELD_ORDER = {
|
|
@@ -151,7 +160,7 @@ var BUSINESS_UPDATE_TEXT_LABELS = {
|
|
|
151
160
|
};
|
|
152
161
|
|
|
153
162
|
// src/constants/business-legal-status.js
|
|
154
|
-
var
|
|
163
|
+
var BUSINESS_LEGAL_STATUS2 = {
|
|
155
164
|
charitableIncorporatedOrganisation: {
|
|
156
165
|
text: "Charitable incorporated organisation (CIO)",
|
|
157
166
|
code: "102101"
|
|
@@ -209,18 +218,18 @@ var BUSINESS_LEGAL_STATUS = {
|
|
|
209
218
|
code: "102114"
|
|
210
219
|
}
|
|
211
220
|
};
|
|
212
|
-
var BUSINESS_LEGAL_STATUS_CODES = Object.values(
|
|
221
|
+
var BUSINESS_LEGAL_STATUS_CODES = Object.values(BUSINESS_LEGAL_STATUS2).map(({ code }) => code);
|
|
213
222
|
var CHARITY_REGISTRATION_LEGAL_STATUS_CODES = [
|
|
214
|
-
|
|
223
|
+
BUSINESS_LEGAL_STATUS2.charitableIncorporatedOrganisation.code
|
|
215
224
|
];
|
|
216
225
|
var COMPANY_REGISTRATION_LEGAL_STATUS_CODES = [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
BUSINESS_LEGAL_STATUS2.communityInterestCompany.code,
|
|
227
|
+
BUSINESS_LEGAL_STATUS2.limitedLiabilityPartnership.code,
|
|
228
|
+
BUSINESS_LEGAL_STATUS2.limitedPartnership.code,
|
|
229
|
+
BUSINESS_LEGAL_STATUS2.nonUkCompany.code,
|
|
230
|
+
BUSINESS_LEGAL_STATUS2.privateLimitedCompany.code,
|
|
231
|
+
BUSINESS_LEGAL_STATUS2.publicLimitedCompany.code,
|
|
232
|
+
BUSINESS_LEGAL_STATUS2.unlimitedCompany.code
|
|
224
233
|
];
|
|
225
234
|
|
|
226
235
|
// src/constants/index.js
|
|
@@ -257,11 +266,20 @@ var constants = {
|
|
|
257
266
|
},
|
|
258
267
|
monthMap: MONTH_MAP,
|
|
259
268
|
successMessages: {
|
|
269
|
+
BUSINESS_ADDRESS,
|
|
270
|
+
BUSINESS_CHARITY_REGISTRATION_NUMBER,
|
|
271
|
+
BUSINESS_COMPANY_REGISTRATION_NUMBER,
|
|
260
272
|
BUSINESS_EMAIL_ADDRESS,
|
|
273
|
+
BUSINESS_LEGAL_STATUS,
|
|
261
274
|
BUSINESS_NAME,
|
|
262
275
|
BUSINESS_PHONE_NUMBERS,
|
|
263
276
|
BUSINESS_VAT,
|
|
264
|
-
BUSINESS_VAT_REMOVE
|
|
277
|
+
BUSINESS_VAT_REMOVE,
|
|
278
|
+
PERSONAL_ADDRESS,
|
|
279
|
+
PERSONAL_DOB,
|
|
280
|
+
PERSONAL_EMAIL_ADDRESS,
|
|
281
|
+
PERSONAL_NAME,
|
|
282
|
+
PERSONAL_PHONE_NUMBERS
|
|
265
283
|
},
|
|
266
284
|
interrupterJourney: {
|
|
267
285
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -274,7 +292,7 @@ var constants = {
|
|
|
274
292
|
BUSINESS_UPDATE_TEXT_LABELS
|
|
275
293
|
},
|
|
276
294
|
business: {
|
|
277
|
-
LEGAL_STATUS:
|
|
295
|
+
LEGAL_STATUS: BUSINESS_LEGAL_STATUS2,
|
|
278
296
|
LEGAL_STATUS_CODES: BUSINESS_LEGAL_STATUS_CODES,
|
|
279
297
|
CHARITY_REGISTRATION_LEGAL_STATUS_CODES,
|
|
280
298
|
COMPANY_REGISTRATION_LEGAL_STATUS_CODES
|
|
@@ -518,10 +536,10 @@ var businessLegalStatusSchema = Joi.object({
|
|
|
518
536
|
|
|
519
537
|
// src/schemas/business/business-charity-registration-number-schema.js
|
|
520
538
|
var businessCharityRegistrationNumberSchema = Joi.object({
|
|
521
|
-
charityCommissionRegistrationNumber: Joi.string().trim().required().pattern(/^\d{
|
|
539
|
+
charityCommissionRegistrationNumber: Joi.string().trim().required().pattern(/^\d{6,8}$/).messages({
|
|
522
540
|
"string.empty": "Enter the charity commission registration number",
|
|
523
541
|
"any.required": "Enter the charity commission registration number",
|
|
524
|
-
"string.pattern.base": "Charity commission registration number must be
|
|
542
|
+
"string.pattern.base": "Charity commission registration number must be 6 to 8 numbers",
|
|
525
543
|
"string.noControlChars": "Charity commission registration number must only include numbers"
|
|
526
544
|
})
|
|
527
545
|
});
|
package/dist/index.js
CHANGED
|
@@ -57,11 +57,20 @@ var MONTH_MAP = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
// src/constants/success-messages.js
|
|
60
|
+
var BUSINESS_ADDRESS = "You have updated your business address";
|
|
61
|
+
var BUSINESS_CHARITY_REGISTRATION_NUMBER = "You have updated your charity commission registration number";
|
|
62
|
+
var BUSINESS_COMPANY_REGISTRATION_NUMBER = "You have updated your company registration number";
|
|
60
63
|
var BUSINESS_EMAIL_ADDRESS = "You have updated your business email address";
|
|
64
|
+
var BUSINESS_LEGAL_STATUS = "You have updated your business legal status";
|
|
61
65
|
var BUSINESS_NAME = "You have updated your business name";
|
|
62
66
|
var BUSINESS_PHONE_NUMBERS = "You have updated your business phone numbers";
|
|
63
67
|
var BUSINESS_VAT = "You have updated your VAT registration number";
|
|
64
68
|
var BUSINESS_VAT_REMOVE = "You have removed your VAT registration number";
|
|
69
|
+
var PERSONAL_ADDRESS = "You have updated your personal address";
|
|
70
|
+
var PERSONAL_DOB = "You have updated your date of birth";
|
|
71
|
+
var PERSONAL_EMAIL_ADDRESS = "You have updated your personal email address";
|
|
72
|
+
var PERSONAL_NAME = "You have updated your full name";
|
|
73
|
+
var PERSONAL_PHONE_NUMBERS = "You have updated your personal phone numbers";
|
|
65
74
|
|
|
66
75
|
// src/constants/interrupter-journey.js
|
|
67
76
|
var PERSONAL_SECTION_FIELD_ORDER = {
|
|
@@ -110,7 +119,7 @@ var BUSINESS_UPDATE_TEXT_LABELS = {
|
|
|
110
119
|
};
|
|
111
120
|
|
|
112
121
|
// src/constants/business-legal-status.js
|
|
113
|
-
var
|
|
122
|
+
var BUSINESS_LEGAL_STATUS2 = {
|
|
114
123
|
charitableIncorporatedOrganisation: {
|
|
115
124
|
text: "Charitable incorporated organisation (CIO)",
|
|
116
125
|
code: "102101"
|
|
@@ -168,18 +177,18 @@ var BUSINESS_LEGAL_STATUS = {
|
|
|
168
177
|
code: "102114"
|
|
169
178
|
}
|
|
170
179
|
};
|
|
171
|
-
var BUSINESS_LEGAL_STATUS_CODES = Object.values(
|
|
180
|
+
var BUSINESS_LEGAL_STATUS_CODES = Object.values(BUSINESS_LEGAL_STATUS2).map(({ code }) => code);
|
|
172
181
|
var CHARITY_REGISTRATION_LEGAL_STATUS_CODES = [
|
|
173
|
-
|
|
182
|
+
BUSINESS_LEGAL_STATUS2.charitableIncorporatedOrganisation.code
|
|
174
183
|
];
|
|
175
184
|
var COMPANY_REGISTRATION_LEGAL_STATUS_CODES = [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
BUSINESS_LEGAL_STATUS2.communityInterestCompany.code,
|
|
186
|
+
BUSINESS_LEGAL_STATUS2.limitedLiabilityPartnership.code,
|
|
187
|
+
BUSINESS_LEGAL_STATUS2.limitedPartnership.code,
|
|
188
|
+
BUSINESS_LEGAL_STATUS2.nonUkCompany.code,
|
|
189
|
+
BUSINESS_LEGAL_STATUS2.privateLimitedCompany.code,
|
|
190
|
+
BUSINESS_LEGAL_STATUS2.publicLimitedCompany.code,
|
|
191
|
+
BUSINESS_LEGAL_STATUS2.unlimitedCompany.code
|
|
183
192
|
];
|
|
184
193
|
|
|
185
194
|
// src/constants/index.js
|
|
@@ -216,11 +225,20 @@ var constants = {
|
|
|
216
225
|
},
|
|
217
226
|
monthMap: MONTH_MAP,
|
|
218
227
|
successMessages: {
|
|
228
|
+
BUSINESS_ADDRESS,
|
|
229
|
+
BUSINESS_CHARITY_REGISTRATION_NUMBER,
|
|
230
|
+
BUSINESS_COMPANY_REGISTRATION_NUMBER,
|
|
219
231
|
BUSINESS_EMAIL_ADDRESS,
|
|
232
|
+
BUSINESS_LEGAL_STATUS,
|
|
220
233
|
BUSINESS_NAME,
|
|
221
234
|
BUSINESS_PHONE_NUMBERS,
|
|
222
235
|
BUSINESS_VAT,
|
|
223
|
-
BUSINESS_VAT_REMOVE
|
|
236
|
+
BUSINESS_VAT_REMOVE,
|
|
237
|
+
PERSONAL_ADDRESS,
|
|
238
|
+
PERSONAL_DOB,
|
|
239
|
+
PERSONAL_EMAIL_ADDRESS,
|
|
240
|
+
PERSONAL_NAME,
|
|
241
|
+
PERSONAL_PHONE_NUMBERS
|
|
224
242
|
},
|
|
225
243
|
interrupterJourney: {
|
|
226
244
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -233,7 +251,7 @@ var constants = {
|
|
|
233
251
|
BUSINESS_UPDATE_TEXT_LABELS
|
|
234
252
|
},
|
|
235
253
|
business: {
|
|
236
|
-
LEGAL_STATUS:
|
|
254
|
+
LEGAL_STATUS: BUSINESS_LEGAL_STATUS2,
|
|
237
255
|
LEGAL_STATUS_CODES: BUSINESS_LEGAL_STATUS_CODES,
|
|
238
256
|
CHARITY_REGISTRATION_LEGAL_STATUS_CODES,
|
|
239
257
|
COMPANY_REGISTRATION_LEGAL_STATUS_CODES
|
|
@@ -477,10 +495,10 @@ var businessLegalStatusSchema = Joi.object({
|
|
|
477
495
|
|
|
478
496
|
// src/schemas/business/business-charity-registration-number-schema.js
|
|
479
497
|
var businessCharityRegistrationNumberSchema = Joi.object({
|
|
480
|
-
charityCommissionRegistrationNumber: Joi.string().trim().required().pattern(/^\d{
|
|
498
|
+
charityCommissionRegistrationNumber: Joi.string().trim().required().pattern(/^\d{6,8}$/).messages({
|
|
481
499
|
"string.empty": "Enter the charity commission registration number",
|
|
482
500
|
"any.required": "Enter the charity commission registration number",
|
|
483
|
-
"string.pattern.base": "Charity commission registration number must be
|
|
501
|
+
"string.pattern.base": "Charity commission registration number must be 6 to 8 numbers",
|
|
484
502
|
"string.noControlChars": "Charity commission registration number must only include numbers"
|
|
485
503
|
})
|
|
486
504
|
});
|
package/package.json
CHANGED
package/src/constants/index.js
CHANGED
|
@@ -34,11 +34,20 @@ import { MONTH_MAP } from './month-map.js'
|
|
|
34
34
|
|
|
35
35
|
// Success messages
|
|
36
36
|
import {
|
|
37
|
+
BUSINESS_ADDRESS,
|
|
38
|
+
BUSINESS_CHARITY_REGISTRATION_NUMBER,
|
|
39
|
+
BUSINESS_COMPANY_REGISTRATION_NUMBER,
|
|
37
40
|
BUSINESS_EMAIL_ADDRESS,
|
|
41
|
+
BUSINESS_LEGAL_STATUS as BUSINESS_LEGAL_STATUS_MESSAGE,
|
|
38
42
|
BUSINESS_NAME,
|
|
39
43
|
BUSINESS_PHONE_NUMBERS,
|
|
40
44
|
BUSINESS_VAT,
|
|
41
|
-
BUSINESS_VAT_REMOVE
|
|
45
|
+
BUSINESS_VAT_REMOVE,
|
|
46
|
+
PERSONAL_ADDRESS,
|
|
47
|
+
PERSONAL_DOB,
|
|
48
|
+
PERSONAL_EMAIL_ADDRESS,
|
|
49
|
+
PERSONAL_NAME,
|
|
50
|
+
PERSONAL_PHONE_NUMBERS
|
|
42
51
|
} from './success-messages.js'
|
|
43
52
|
|
|
44
53
|
// Interrupter journey constants
|
|
@@ -93,11 +102,20 @@ export const constants = {
|
|
|
93
102
|
},
|
|
94
103
|
monthMap: MONTH_MAP,
|
|
95
104
|
successMessages: {
|
|
105
|
+
BUSINESS_ADDRESS,
|
|
106
|
+
BUSINESS_CHARITY_REGISTRATION_NUMBER,
|
|
107
|
+
BUSINESS_COMPANY_REGISTRATION_NUMBER,
|
|
96
108
|
BUSINESS_EMAIL_ADDRESS,
|
|
109
|
+
BUSINESS_LEGAL_STATUS: BUSINESS_LEGAL_STATUS_MESSAGE,
|
|
97
110
|
BUSINESS_NAME,
|
|
98
111
|
BUSINESS_PHONE_NUMBERS,
|
|
99
112
|
BUSINESS_VAT,
|
|
100
|
-
BUSINESS_VAT_REMOVE
|
|
113
|
+
BUSINESS_VAT_REMOVE,
|
|
114
|
+
PERSONAL_ADDRESS,
|
|
115
|
+
PERSONAL_DOB,
|
|
116
|
+
PERSONAL_EMAIL_ADDRESS,
|
|
117
|
+
PERSONAL_NAME,
|
|
118
|
+
PERSONAL_PHONE_NUMBERS
|
|
101
119
|
},
|
|
102
120
|
interrupterJourney: {
|
|
103
121
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
export const BUSINESS_ADDRESS = 'You have updated your business address'
|
|
2
|
+
export const BUSINESS_CHARITY_REGISTRATION_NUMBER = 'You have updated your charity commission registration number'
|
|
3
|
+
export const BUSINESS_COMPANY_REGISTRATION_NUMBER = 'You have updated your company registration number'
|
|
1
4
|
export const BUSINESS_EMAIL_ADDRESS = 'You have updated your business email address'
|
|
5
|
+
export const BUSINESS_LEGAL_STATUS = 'You have updated your business legal status'
|
|
2
6
|
export const BUSINESS_NAME = 'You have updated your business name'
|
|
3
7
|
export const BUSINESS_PHONE_NUMBERS = 'You have updated your business phone numbers'
|
|
4
8
|
export const BUSINESS_VAT = 'You have updated your VAT registration number'
|
|
5
9
|
export const BUSINESS_VAT_REMOVE = 'You have removed your VAT registration number'
|
|
10
|
+
export const PERSONAL_ADDRESS = 'You have updated your personal address'
|
|
11
|
+
export const PERSONAL_DOB = 'You have updated your date of birth'
|
|
12
|
+
export const PERSONAL_EMAIL_ADDRESS = 'You have updated your personal email address'
|
|
13
|
+
export const PERSONAL_NAME = 'You have updated your full name'
|
|
14
|
+
export const PERSONAL_PHONE_NUMBERS = 'You have updated your personal phone numbers'
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Joi } from '../../utils/joi.js'
|
|
2
2
|
|
|
3
|
-
// Charity Commission registration numbers are
|
|
3
|
+
// Charity Commission registration numbers are 6 to 8 digits (England and Wales)
|
|
4
4
|
export const businessCharityRegistrationNumberSchema = Joi.object({
|
|
5
5
|
charityCommissionRegistrationNumber: Joi.string()
|
|
6
6
|
.trim()
|
|
7
7
|
.required()
|
|
8
|
-
.pattern(/^\d{
|
|
8
|
+
.pattern(/^\d{6,8}$/)
|
|
9
9
|
.messages({
|
|
10
10
|
'string.empty': 'Enter the charity commission registration number',
|
|
11
11
|
'any.required': 'Enter the charity commission registration number',
|
|
12
|
-
'string.pattern.base': 'Charity commission registration number must be
|
|
12
|
+
'string.pattern.base': 'Charity commission registration number must be 6 to 8 numbers',
|
|
13
13
|
'string.noControlChars': 'Charity commission registration number must only include numbers'
|
|
14
14
|
})
|
|
15
15
|
})
|