@defra/fcp-sfd-frontend-engine 0.33.0 → 0.34.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 +47 -0
- package/dist/index.js +47 -0
- package/package.json +1 -1
- package/src/constants/change-links.js +42 -0
- package/src/constants/index.js +18 -0
package/dist/index.cjs
CHANGED
|
@@ -232,6 +232,43 @@ var COMPANY_REGISTRATION_LEGAL_STATUS_CODES = [
|
|
|
232
232
|
BUSINESS_LEGAL_STATUS2.unlimitedCompany.code
|
|
233
233
|
];
|
|
234
234
|
|
|
235
|
+
// src/constants/change-links.js
|
|
236
|
+
var INTERNAL_BUSINESS_CHANGE_LINKS = {
|
|
237
|
+
businessName: (sbi) => `/business/${sbi}/name-change`,
|
|
238
|
+
businessAddress: (sbi) => `/business/${sbi}/address-change`,
|
|
239
|
+
businessPhone: (sbi) => `/business/${sbi}/phone-numbers-change`,
|
|
240
|
+
businessEmail: (sbi) => `/business/${sbi}/email-change`,
|
|
241
|
+
businessVat: (sbi) => `/business/${sbi}/vat-registration-number-change`,
|
|
242
|
+
businessVatRemove: (sbi) => `/business/${sbi}/vat-registration-remove`,
|
|
243
|
+
businessLegalStatus: (sbi) => `/business/${sbi}/legal-status-change`,
|
|
244
|
+
businessLegalStatusRegistrationNumber: (sbi) => `/business/${sbi}/legal-status-enter`
|
|
245
|
+
};
|
|
246
|
+
var INTERNAL_PERSONAL_CHANGE_LINKS = {
|
|
247
|
+
personalName: (crn) => `/customer/${crn}/account-name-change`,
|
|
248
|
+
personalAddress: (crn) => `/customer/${crn}/account-address-change`,
|
|
249
|
+
personalPhone: (crn) => `/customer/${crn}/account-phone-numbers-change`,
|
|
250
|
+
personalEmail: (crn) => `/customer/${crn}/account-email-change`,
|
|
251
|
+
personalDateOfBirth: (crn) => `/customer/${crn}/account-date-of-birth-change`
|
|
252
|
+
};
|
|
253
|
+
var EXTERNAL_BUSINESS_CHANGE_LINKS = {
|
|
254
|
+
businessName: "/business-name-change",
|
|
255
|
+
businessAddress: "/business-address-change",
|
|
256
|
+
businessPhone: "/business-phone-numbers-change",
|
|
257
|
+
businessEmail: "/business-email-change",
|
|
258
|
+
businessVat: "/business-vat-registration-number-change",
|
|
259
|
+
businessVatRemove: "/business-vat-registration-remove",
|
|
260
|
+
businessLegalStatus: "/business-legal-status-change",
|
|
261
|
+
businessType: "/business-type-change",
|
|
262
|
+
businessFixNameNoPermission: "/business-fix-name-no-permission"
|
|
263
|
+
};
|
|
264
|
+
var EXTERNAL_PERSONAL_CHANGE_LINKS = {
|
|
265
|
+
personalName: "/account-name-change",
|
|
266
|
+
personalAddress: "/account-address-change",
|
|
267
|
+
personalPhone: "/account-phone-numbers-change",
|
|
268
|
+
personalEmail: "/account-email-change",
|
|
269
|
+
personalDateOfBirth: "/account-date-of-birth-change"
|
|
270
|
+
};
|
|
271
|
+
|
|
235
272
|
// src/constants/index.js
|
|
236
273
|
var constants = {
|
|
237
274
|
statusCodes: {
|
|
@@ -296,6 +333,16 @@ var constants = {
|
|
|
296
333
|
LEGAL_STATUS_CODES: BUSINESS_LEGAL_STATUS_CODES,
|
|
297
334
|
CHARITY_REGISTRATION_LEGAL_STATUS_CODES,
|
|
298
335
|
COMPANY_REGISTRATION_LEGAL_STATUS_CODES
|
|
336
|
+
},
|
|
337
|
+
changeLinks: {
|
|
338
|
+
internal: {
|
|
339
|
+
BUSINESS: INTERNAL_BUSINESS_CHANGE_LINKS,
|
|
340
|
+
PERSONAL: INTERNAL_PERSONAL_CHANGE_LINKS
|
|
341
|
+
},
|
|
342
|
+
external: {
|
|
343
|
+
BUSINESS: EXTERNAL_BUSINESS_CHANGE_LINKS,
|
|
344
|
+
PERSONAL: EXTERNAL_PERSONAL_CHANGE_LINKS
|
|
345
|
+
}
|
|
299
346
|
}
|
|
300
347
|
};
|
|
301
348
|
|
package/dist/index.js
CHANGED
|
@@ -191,6 +191,43 @@ var COMPANY_REGISTRATION_LEGAL_STATUS_CODES = [
|
|
|
191
191
|
BUSINESS_LEGAL_STATUS2.unlimitedCompany.code
|
|
192
192
|
];
|
|
193
193
|
|
|
194
|
+
// src/constants/change-links.js
|
|
195
|
+
var INTERNAL_BUSINESS_CHANGE_LINKS = {
|
|
196
|
+
businessName: (sbi) => `/business/${sbi}/name-change`,
|
|
197
|
+
businessAddress: (sbi) => `/business/${sbi}/address-change`,
|
|
198
|
+
businessPhone: (sbi) => `/business/${sbi}/phone-numbers-change`,
|
|
199
|
+
businessEmail: (sbi) => `/business/${sbi}/email-change`,
|
|
200
|
+
businessVat: (sbi) => `/business/${sbi}/vat-registration-number-change`,
|
|
201
|
+
businessVatRemove: (sbi) => `/business/${sbi}/vat-registration-remove`,
|
|
202
|
+
businessLegalStatus: (sbi) => `/business/${sbi}/legal-status-change`,
|
|
203
|
+
businessLegalStatusRegistrationNumber: (sbi) => `/business/${sbi}/legal-status-enter`
|
|
204
|
+
};
|
|
205
|
+
var INTERNAL_PERSONAL_CHANGE_LINKS = {
|
|
206
|
+
personalName: (crn) => `/customer/${crn}/account-name-change`,
|
|
207
|
+
personalAddress: (crn) => `/customer/${crn}/account-address-change`,
|
|
208
|
+
personalPhone: (crn) => `/customer/${crn}/account-phone-numbers-change`,
|
|
209
|
+
personalEmail: (crn) => `/customer/${crn}/account-email-change`,
|
|
210
|
+
personalDateOfBirth: (crn) => `/customer/${crn}/account-date-of-birth-change`
|
|
211
|
+
};
|
|
212
|
+
var EXTERNAL_BUSINESS_CHANGE_LINKS = {
|
|
213
|
+
businessName: "/business-name-change",
|
|
214
|
+
businessAddress: "/business-address-change",
|
|
215
|
+
businessPhone: "/business-phone-numbers-change",
|
|
216
|
+
businessEmail: "/business-email-change",
|
|
217
|
+
businessVat: "/business-vat-registration-number-change",
|
|
218
|
+
businessVatRemove: "/business-vat-registration-remove",
|
|
219
|
+
businessLegalStatus: "/business-legal-status-change",
|
|
220
|
+
businessType: "/business-type-change",
|
|
221
|
+
businessFixNameNoPermission: "/business-fix-name-no-permission"
|
|
222
|
+
};
|
|
223
|
+
var EXTERNAL_PERSONAL_CHANGE_LINKS = {
|
|
224
|
+
personalName: "/account-name-change",
|
|
225
|
+
personalAddress: "/account-address-change",
|
|
226
|
+
personalPhone: "/account-phone-numbers-change",
|
|
227
|
+
personalEmail: "/account-email-change",
|
|
228
|
+
personalDateOfBirth: "/account-date-of-birth-change"
|
|
229
|
+
};
|
|
230
|
+
|
|
194
231
|
// src/constants/index.js
|
|
195
232
|
var constants = {
|
|
196
233
|
statusCodes: {
|
|
@@ -255,6 +292,16 @@ var constants = {
|
|
|
255
292
|
LEGAL_STATUS_CODES: BUSINESS_LEGAL_STATUS_CODES,
|
|
256
293
|
CHARITY_REGISTRATION_LEGAL_STATUS_CODES,
|
|
257
294
|
COMPANY_REGISTRATION_LEGAL_STATUS_CODES
|
|
295
|
+
},
|
|
296
|
+
changeLinks: {
|
|
297
|
+
internal: {
|
|
298
|
+
BUSINESS: INTERNAL_BUSINESS_CHANGE_LINKS,
|
|
299
|
+
PERSONAL: INTERNAL_PERSONAL_CHANGE_LINKS
|
|
300
|
+
},
|
|
301
|
+
external: {
|
|
302
|
+
BUSINESS: EXTERNAL_BUSINESS_CHANGE_LINKS,
|
|
303
|
+
PERSONAL: EXTERNAL_PERSONAL_CHANGE_LINKS
|
|
304
|
+
}
|
|
258
305
|
}
|
|
259
306
|
};
|
|
260
307
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// The internal service reaches records by SBI/CRN search, so its paths are parameterised functions.
|
|
2
|
+
// The external service works from the signed-in user's own records, so its paths are static strings.
|
|
3
|
+
// The two sets are not interchangeable — use the one matching the consuming service.
|
|
4
|
+
|
|
5
|
+
export const INTERNAL_BUSINESS_CHANGE_LINKS = {
|
|
6
|
+
businessName: (sbi) => `/business/${sbi}/name-change`,
|
|
7
|
+
businessAddress: (sbi) => `/business/${sbi}/address-change`,
|
|
8
|
+
businessPhone: (sbi) => `/business/${sbi}/phone-numbers-change`,
|
|
9
|
+
businessEmail: (sbi) => `/business/${sbi}/email-change`,
|
|
10
|
+
businessVat: (sbi) => `/business/${sbi}/vat-registration-number-change`,
|
|
11
|
+
businessVatRemove: (sbi) => `/business/${sbi}/vat-registration-remove`,
|
|
12
|
+
businessLegalStatus: (sbi) => `/business/${sbi}/legal-status-change`,
|
|
13
|
+
businessLegalStatusRegistrationNumber: (sbi) => `/business/${sbi}/legal-status-enter`
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const INTERNAL_PERSONAL_CHANGE_LINKS = {
|
|
17
|
+
personalName: (crn) => `/customer/${crn}/account-name-change`,
|
|
18
|
+
personalAddress: (crn) => `/customer/${crn}/account-address-change`,
|
|
19
|
+
personalPhone: (crn) => `/customer/${crn}/account-phone-numbers-change`,
|
|
20
|
+
personalEmail: (crn) => `/customer/${crn}/account-email-change`,
|
|
21
|
+
personalDateOfBirth: (crn) => `/customer/${crn}/account-date-of-birth-change`
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const EXTERNAL_BUSINESS_CHANGE_LINKS = {
|
|
25
|
+
businessName: '/business-name-change',
|
|
26
|
+
businessAddress: '/business-address-change',
|
|
27
|
+
businessPhone: '/business-phone-numbers-change',
|
|
28
|
+
businessEmail: '/business-email-change',
|
|
29
|
+
businessVat: '/business-vat-registration-number-change',
|
|
30
|
+
businessVatRemove: '/business-vat-registration-remove',
|
|
31
|
+
businessLegalStatus: '/business-legal-status-change',
|
|
32
|
+
businessType: '/business-type-change',
|
|
33
|
+
businessFixNameNoPermission: '/business-fix-name-no-permission'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const EXTERNAL_PERSONAL_CHANGE_LINKS = {
|
|
37
|
+
personalName: '/account-name-change',
|
|
38
|
+
personalAddress: '/account-address-change',
|
|
39
|
+
personalPhone: '/account-phone-numbers-change',
|
|
40
|
+
personalEmail: '/account-email-change',
|
|
41
|
+
personalDateOfBirth: '/account-date-of-birth-change'
|
|
42
|
+
}
|
package/src/constants/index.js
CHANGED
|
@@ -69,6 +69,14 @@ import {
|
|
|
69
69
|
COMPANY_REGISTRATION_LEGAL_STATUS_CODES
|
|
70
70
|
} from './business-legal-status.js'
|
|
71
71
|
|
|
72
|
+
// Change links
|
|
73
|
+
import {
|
|
74
|
+
INTERNAL_BUSINESS_CHANGE_LINKS,
|
|
75
|
+
INTERNAL_PERSONAL_CHANGE_LINKS,
|
|
76
|
+
EXTERNAL_BUSINESS_CHANGE_LINKS,
|
|
77
|
+
EXTERNAL_PERSONAL_CHANGE_LINKS
|
|
78
|
+
} from './change-links.js'
|
|
79
|
+
|
|
72
80
|
export const constants = {
|
|
73
81
|
statusCodes: {
|
|
74
82
|
BAD_REQUEST,
|
|
@@ -132,5 +140,15 @@ export const constants = {
|
|
|
132
140
|
LEGAL_STATUS_CODES: BUSINESS_LEGAL_STATUS_CODES,
|
|
133
141
|
CHARITY_REGISTRATION_LEGAL_STATUS_CODES,
|
|
134
142
|
COMPANY_REGISTRATION_LEGAL_STATUS_CODES
|
|
143
|
+
},
|
|
144
|
+
changeLinks: {
|
|
145
|
+
internal: {
|
|
146
|
+
BUSINESS: INTERNAL_BUSINESS_CHANGE_LINKS,
|
|
147
|
+
PERSONAL: INTERNAL_PERSONAL_CHANGE_LINKS
|
|
148
|
+
},
|
|
149
|
+
external: {
|
|
150
|
+
BUSINESS: EXTERNAL_BUSINESS_CHANGE_LINKS,
|
|
151
|
+
PERSONAL: EXTERNAL_PERSONAL_CHANGE_LINKS
|
|
152
|
+
}
|
|
135
153
|
}
|
|
136
154
|
}
|