@defra/fcp-sfd-frontend-engine 0.24.0 → 0.26.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 +32 -2
- package/dist/index.js +32 -2
- package/package.json +1 -1
- package/src/constants/index.js +6 -2
- package/src/constants/success-messages.js +2 -0
- package/src/mutations/business/update-business-vat.js +12 -0
- package/src/mutations/mutations.js +2 -0
- package/src/utils/build-update-business-vat-variables.js +16 -0
- package/src/utils/utils.js +3 -1
package/dist/index.cjs
CHANGED
|
@@ -101,6 +101,8 @@ var MONTH_MAP = {
|
|
|
101
101
|
var BUSINESS_EMAIL_ADDRESS = "You have updated your business email address";
|
|
102
102
|
var BUSINESS_NAME = "You have updated your business name";
|
|
103
103
|
var BUSINESS_PHONE_NUMBERS = "You have updated your business phone numbers";
|
|
104
|
+
var BUSINESS_VAT = "You have updated your VAT registration number";
|
|
105
|
+
var BUSINESS_VAT_REMOVE = "You have removed your VAT registration number";
|
|
104
106
|
|
|
105
107
|
// src/constants/interrupter-journey.js
|
|
106
108
|
var PERSONAL_SECTION_FIELD_ORDER = {
|
|
@@ -184,7 +186,9 @@ var constants = {
|
|
|
184
186
|
successMessages: {
|
|
185
187
|
BUSINESS_EMAIL_ADDRESS,
|
|
186
188
|
BUSINESS_NAME,
|
|
187
|
-
BUSINESS_PHONE_NUMBERS
|
|
189
|
+
BUSINESS_PHONE_NUMBERS,
|
|
190
|
+
BUSINESS_VAT,
|
|
191
|
+
BUSINESS_VAT_REMOVE
|
|
188
192
|
},
|
|
189
193
|
interrupterJourney: {
|
|
190
194
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -923,6 +927,20 @@ var updateBusinessAddressMutation = `
|
|
|
923
927
|
}
|
|
924
928
|
`;
|
|
925
929
|
|
|
930
|
+
// src/mutations/business/update-business-vat.js
|
|
931
|
+
var updateBusinessVatMutation = `
|
|
932
|
+
mutation UpdateBusinessVAT($input: UpdateBusinessVATInput!) {
|
|
933
|
+
updateBusinessVAT(input: $input) {
|
|
934
|
+
business {
|
|
935
|
+
info {
|
|
936
|
+
vat
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
success
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
`;
|
|
943
|
+
|
|
926
944
|
// src/mutations/personal/update-customer-details.js
|
|
927
945
|
var updateCustomerDetailsMutation = `
|
|
928
946
|
mutation UpdateCustomerAllFields($input: UpdateCustomerAllFieldsInput!) {
|
|
@@ -976,6 +994,7 @@ var mutations = {
|
|
|
976
994
|
updateCustomerPhone: updateCustomerPhoneMutation,
|
|
977
995
|
updateCustomerEmail: updateCustomerEmailMutation,
|
|
978
996
|
updateCustomerAddress: updateCustomerAddressMutation,
|
|
997
|
+
updateBusinessVat: updateBusinessVatMutation,
|
|
979
998
|
updateCustomerDetails: updateCustomerDetailsMutation
|
|
980
999
|
};
|
|
981
1000
|
|
|
@@ -1276,13 +1295,24 @@ var buildUpdateBusinessPhoneNumbersVariables = (businessTelephone, businessMobil
|
|
|
1276
1295
|
};
|
|
1277
1296
|
};
|
|
1278
1297
|
|
|
1298
|
+
// src/utils/build-update-business-vat-variables.js
|
|
1299
|
+
var buildUpdateBusinessVatVariables = (vat, sbi) => {
|
|
1300
|
+
return {
|
|
1301
|
+
input: {
|
|
1302
|
+
vat,
|
|
1303
|
+
sbi
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1279
1308
|
// src/utils/utils.js
|
|
1280
1309
|
var utils = {
|
|
1281
1310
|
formatFullName,
|
|
1282
1311
|
formatValidationErrors,
|
|
1283
1312
|
buildUpdateBusinessEmailVariables,
|
|
1284
1313
|
buildUpdateBusinessNameVariables,
|
|
1285
|
-
buildUpdateBusinessPhoneNumbersVariables
|
|
1314
|
+
buildUpdateBusinessPhoneNumbersVariables,
|
|
1315
|
+
buildUpdateBusinessVatVariables
|
|
1286
1316
|
};
|
|
1287
1317
|
|
|
1288
1318
|
// src/services/os-places/address-lookup-service.js
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,8 @@ var MONTH_MAP = {
|
|
|
60
60
|
var BUSINESS_EMAIL_ADDRESS = "You have updated your business email address";
|
|
61
61
|
var BUSINESS_NAME = "You have updated your business name";
|
|
62
62
|
var BUSINESS_PHONE_NUMBERS = "You have updated your business phone numbers";
|
|
63
|
+
var BUSINESS_VAT = "You have updated your VAT registration number";
|
|
64
|
+
var BUSINESS_VAT_REMOVE = "You have removed your VAT registration number";
|
|
63
65
|
|
|
64
66
|
// src/constants/interrupter-journey.js
|
|
65
67
|
var PERSONAL_SECTION_FIELD_ORDER = {
|
|
@@ -143,7 +145,9 @@ var constants = {
|
|
|
143
145
|
successMessages: {
|
|
144
146
|
BUSINESS_EMAIL_ADDRESS,
|
|
145
147
|
BUSINESS_NAME,
|
|
146
|
-
BUSINESS_PHONE_NUMBERS
|
|
148
|
+
BUSINESS_PHONE_NUMBERS,
|
|
149
|
+
BUSINESS_VAT,
|
|
150
|
+
BUSINESS_VAT_REMOVE
|
|
147
151
|
},
|
|
148
152
|
interrupterJourney: {
|
|
149
153
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -882,6 +886,20 @@ var updateBusinessAddressMutation = `
|
|
|
882
886
|
}
|
|
883
887
|
`;
|
|
884
888
|
|
|
889
|
+
// src/mutations/business/update-business-vat.js
|
|
890
|
+
var updateBusinessVatMutation = `
|
|
891
|
+
mutation UpdateBusinessVAT($input: UpdateBusinessVATInput!) {
|
|
892
|
+
updateBusinessVAT(input: $input) {
|
|
893
|
+
business {
|
|
894
|
+
info {
|
|
895
|
+
vat
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
success
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
`;
|
|
902
|
+
|
|
885
903
|
// src/mutations/personal/update-customer-details.js
|
|
886
904
|
var updateCustomerDetailsMutation = `
|
|
887
905
|
mutation UpdateCustomerAllFields($input: UpdateCustomerAllFieldsInput!) {
|
|
@@ -935,6 +953,7 @@ var mutations = {
|
|
|
935
953
|
updateCustomerPhone: updateCustomerPhoneMutation,
|
|
936
954
|
updateCustomerEmail: updateCustomerEmailMutation,
|
|
937
955
|
updateCustomerAddress: updateCustomerAddressMutation,
|
|
956
|
+
updateBusinessVat: updateBusinessVatMutation,
|
|
938
957
|
updateCustomerDetails: updateCustomerDetailsMutation
|
|
939
958
|
};
|
|
940
959
|
|
|
@@ -1235,13 +1254,24 @@ var buildUpdateBusinessPhoneNumbersVariables = (businessTelephone, businessMobil
|
|
|
1235
1254
|
};
|
|
1236
1255
|
};
|
|
1237
1256
|
|
|
1257
|
+
// src/utils/build-update-business-vat-variables.js
|
|
1258
|
+
var buildUpdateBusinessVatVariables = (vat, sbi) => {
|
|
1259
|
+
return {
|
|
1260
|
+
input: {
|
|
1261
|
+
vat,
|
|
1262
|
+
sbi
|
|
1263
|
+
}
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1238
1267
|
// src/utils/utils.js
|
|
1239
1268
|
var utils = {
|
|
1240
1269
|
formatFullName,
|
|
1241
1270
|
formatValidationErrors,
|
|
1242
1271
|
buildUpdateBusinessEmailVariables,
|
|
1243
1272
|
buildUpdateBusinessNameVariables,
|
|
1244
|
-
buildUpdateBusinessPhoneNumbersVariables
|
|
1273
|
+
buildUpdateBusinessPhoneNumbersVariables,
|
|
1274
|
+
buildUpdateBusinessVatVariables
|
|
1245
1275
|
};
|
|
1246
1276
|
|
|
1247
1277
|
// src/services/os-places/address-lookup-service.js
|
package/package.json
CHANGED
package/src/constants/index.js
CHANGED
|
@@ -36,7 +36,9 @@ import { MONTH_MAP } from './month-map.js'
|
|
|
36
36
|
import {
|
|
37
37
|
BUSINESS_EMAIL_ADDRESS,
|
|
38
38
|
BUSINESS_NAME,
|
|
39
|
-
BUSINESS_PHONE_NUMBERS
|
|
39
|
+
BUSINESS_PHONE_NUMBERS,
|
|
40
|
+
BUSINESS_VAT,
|
|
41
|
+
BUSINESS_VAT_REMOVE
|
|
40
42
|
} from './success-messages.js'
|
|
41
43
|
|
|
42
44
|
// Interrupter journey constants
|
|
@@ -86,7 +88,9 @@ export const constants = {
|
|
|
86
88
|
successMessages: {
|
|
87
89
|
BUSINESS_EMAIL_ADDRESS,
|
|
88
90
|
BUSINESS_NAME,
|
|
89
|
-
BUSINESS_PHONE_NUMBERS
|
|
91
|
+
BUSINESS_PHONE_NUMBERS,
|
|
92
|
+
BUSINESS_VAT,
|
|
93
|
+
BUSINESS_VAT_REMOVE
|
|
90
94
|
},
|
|
91
95
|
interrupterJourney: {
|
|
92
96
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export const BUSINESS_EMAIL_ADDRESS = 'You have updated your business email address'
|
|
2
2
|
export const BUSINESS_NAME = 'You have updated your business name'
|
|
3
3
|
export const BUSINESS_PHONE_NUMBERS = 'You have updated your business phone numbers'
|
|
4
|
+
export const BUSINESS_VAT = 'You have updated your VAT registration number'
|
|
5
|
+
export const BUSINESS_VAT_REMOVE = 'You have removed your VAT registration number'
|
|
@@ -7,6 +7,7 @@ import { updateCustomerPhoneMutation } from './personal/update-customer-phone.js
|
|
|
7
7
|
import { updateCustomerEmailMutation } from './personal/update-customer-email.js'
|
|
8
8
|
import { updateCustomerAddressMutation } from './personal/update-customer-address.js'
|
|
9
9
|
import { updateBusinessAddressMutation } from './business/update-business-address.js'
|
|
10
|
+
import { updateBusinessVatMutation } from './business/update-business-vat.js'
|
|
10
11
|
import { updateCustomerDetailsMutation } from './personal/update-customer-details.js'
|
|
11
12
|
|
|
12
13
|
export const mutations = {
|
|
@@ -19,5 +20,6 @@ export const mutations = {
|
|
|
19
20
|
updateCustomerPhone: updateCustomerPhoneMutation,
|
|
20
21
|
updateCustomerEmail: updateCustomerEmailMutation,
|
|
21
22
|
updateCustomerAddress: updateCustomerAddressMutation,
|
|
23
|
+
updateBusinessVat: updateBusinessVatMutation,
|
|
22
24
|
updateCustomerDetails: updateCustomerDetailsMutation
|
|
23
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the GraphQL variables for the `updateBusinessVAT` mutation.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} vat - The new business VAT registration number
|
|
5
|
+
* @param {string} sbi - The Single Business Identifier of the business being updated
|
|
6
|
+
* @returns {object} The mutation variables in the shape `{ input: { vat, sbi } }`
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const buildUpdateBusinessVatVariables = (vat, sbi) => {
|
|
10
|
+
return {
|
|
11
|
+
input: {
|
|
12
|
+
vat,
|
|
13
|
+
sbi
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/utils/utils.js
CHANGED
|
@@ -3,11 +3,13 @@ import { formatValidationErrors } from './format-validation-errors.js'
|
|
|
3
3
|
import { buildUpdateBusinessEmailVariables } from './build-update-business-email-variables.js'
|
|
4
4
|
import { buildUpdateBusinessNameVariables } from './build-update-business-name-variables.js'
|
|
5
5
|
import { buildUpdateBusinessPhoneNumbersVariables } from './build-update-business-phone-numbers-variables.js'
|
|
6
|
+
import { buildUpdateBusinessVatVariables } from './build-update-business-vat-variables.js'
|
|
6
7
|
|
|
7
8
|
export const utils = {
|
|
8
9
|
formatFullName,
|
|
9
10
|
formatValidationErrors,
|
|
10
11
|
buildUpdateBusinessEmailVariables,
|
|
11
12
|
buildUpdateBusinessNameVariables,
|
|
12
|
-
buildUpdateBusinessPhoneNumbersVariables
|
|
13
|
+
buildUpdateBusinessPhoneNumbersVariables,
|
|
14
|
+
buildUpdateBusinessVatVariables
|
|
13
15
|
}
|