@defra/fcp-sfd-frontend-engine 0.24.0 → 0.25.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 +30 -2
- package/dist/index.js +30 -2
- package/package.json +1 -1
- package/src/constants/index.js +4 -2
- package/src/constants/success-messages.js +1 -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,7 @@ 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";
|
|
104
105
|
|
|
105
106
|
// src/constants/interrupter-journey.js
|
|
106
107
|
var PERSONAL_SECTION_FIELD_ORDER = {
|
|
@@ -184,7 +185,8 @@ var constants = {
|
|
|
184
185
|
successMessages: {
|
|
185
186
|
BUSINESS_EMAIL_ADDRESS,
|
|
186
187
|
BUSINESS_NAME,
|
|
187
|
-
BUSINESS_PHONE_NUMBERS
|
|
188
|
+
BUSINESS_PHONE_NUMBERS,
|
|
189
|
+
BUSINESS_VAT
|
|
188
190
|
},
|
|
189
191
|
interrupterJourney: {
|
|
190
192
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -923,6 +925,20 @@ var updateBusinessAddressMutation = `
|
|
|
923
925
|
}
|
|
924
926
|
`;
|
|
925
927
|
|
|
928
|
+
// src/mutations/business/update-business-vat.js
|
|
929
|
+
var updateBusinessVatMutation = `
|
|
930
|
+
mutation UpdateBusinessVAT($input: UpdateBusinessVATInput!) {
|
|
931
|
+
updateBusinessVAT(input: $input) {
|
|
932
|
+
business {
|
|
933
|
+
info {
|
|
934
|
+
vat
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
success
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
`;
|
|
941
|
+
|
|
926
942
|
// src/mutations/personal/update-customer-details.js
|
|
927
943
|
var updateCustomerDetailsMutation = `
|
|
928
944
|
mutation UpdateCustomerAllFields($input: UpdateCustomerAllFieldsInput!) {
|
|
@@ -976,6 +992,7 @@ var mutations = {
|
|
|
976
992
|
updateCustomerPhone: updateCustomerPhoneMutation,
|
|
977
993
|
updateCustomerEmail: updateCustomerEmailMutation,
|
|
978
994
|
updateCustomerAddress: updateCustomerAddressMutation,
|
|
995
|
+
updateBusinessVat: updateBusinessVatMutation,
|
|
979
996
|
updateCustomerDetails: updateCustomerDetailsMutation
|
|
980
997
|
};
|
|
981
998
|
|
|
@@ -1276,13 +1293,24 @@ var buildUpdateBusinessPhoneNumbersVariables = (businessTelephone, businessMobil
|
|
|
1276
1293
|
};
|
|
1277
1294
|
};
|
|
1278
1295
|
|
|
1296
|
+
// src/utils/build-update-business-vat-variables.js
|
|
1297
|
+
var buildUpdateBusinessVatVariables = (vat, sbi) => {
|
|
1298
|
+
return {
|
|
1299
|
+
input: {
|
|
1300
|
+
vat,
|
|
1301
|
+
sbi
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1279
1306
|
// src/utils/utils.js
|
|
1280
1307
|
var utils = {
|
|
1281
1308
|
formatFullName,
|
|
1282
1309
|
formatValidationErrors,
|
|
1283
1310
|
buildUpdateBusinessEmailVariables,
|
|
1284
1311
|
buildUpdateBusinessNameVariables,
|
|
1285
|
-
buildUpdateBusinessPhoneNumbersVariables
|
|
1312
|
+
buildUpdateBusinessPhoneNumbersVariables,
|
|
1313
|
+
buildUpdateBusinessVatVariables
|
|
1286
1314
|
};
|
|
1287
1315
|
|
|
1288
1316
|
// src/services/os-places/address-lookup-service.js
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,7 @@ 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";
|
|
63
64
|
|
|
64
65
|
// src/constants/interrupter-journey.js
|
|
65
66
|
var PERSONAL_SECTION_FIELD_ORDER = {
|
|
@@ -143,7 +144,8 @@ var constants = {
|
|
|
143
144
|
successMessages: {
|
|
144
145
|
BUSINESS_EMAIL_ADDRESS,
|
|
145
146
|
BUSINESS_NAME,
|
|
146
|
-
BUSINESS_PHONE_NUMBERS
|
|
147
|
+
BUSINESS_PHONE_NUMBERS,
|
|
148
|
+
BUSINESS_VAT
|
|
147
149
|
},
|
|
148
150
|
interrupterJourney: {
|
|
149
151
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -882,6 +884,20 @@ var updateBusinessAddressMutation = `
|
|
|
882
884
|
}
|
|
883
885
|
`;
|
|
884
886
|
|
|
887
|
+
// src/mutations/business/update-business-vat.js
|
|
888
|
+
var updateBusinessVatMutation = `
|
|
889
|
+
mutation UpdateBusinessVAT($input: UpdateBusinessVATInput!) {
|
|
890
|
+
updateBusinessVAT(input: $input) {
|
|
891
|
+
business {
|
|
892
|
+
info {
|
|
893
|
+
vat
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
success
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
`;
|
|
900
|
+
|
|
885
901
|
// src/mutations/personal/update-customer-details.js
|
|
886
902
|
var updateCustomerDetailsMutation = `
|
|
887
903
|
mutation UpdateCustomerAllFields($input: UpdateCustomerAllFieldsInput!) {
|
|
@@ -935,6 +951,7 @@ var mutations = {
|
|
|
935
951
|
updateCustomerPhone: updateCustomerPhoneMutation,
|
|
936
952
|
updateCustomerEmail: updateCustomerEmailMutation,
|
|
937
953
|
updateCustomerAddress: updateCustomerAddressMutation,
|
|
954
|
+
updateBusinessVat: updateBusinessVatMutation,
|
|
938
955
|
updateCustomerDetails: updateCustomerDetailsMutation
|
|
939
956
|
};
|
|
940
957
|
|
|
@@ -1235,13 +1252,24 @@ var buildUpdateBusinessPhoneNumbersVariables = (businessTelephone, businessMobil
|
|
|
1235
1252
|
};
|
|
1236
1253
|
};
|
|
1237
1254
|
|
|
1255
|
+
// src/utils/build-update-business-vat-variables.js
|
|
1256
|
+
var buildUpdateBusinessVatVariables = (vat, sbi) => {
|
|
1257
|
+
return {
|
|
1258
|
+
input: {
|
|
1259
|
+
vat,
|
|
1260
|
+
sbi
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1238
1265
|
// src/utils/utils.js
|
|
1239
1266
|
var utils = {
|
|
1240
1267
|
formatFullName,
|
|
1241
1268
|
formatValidationErrors,
|
|
1242
1269
|
buildUpdateBusinessEmailVariables,
|
|
1243
1270
|
buildUpdateBusinessNameVariables,
|
|
1244
|
-
buildUpdateBusinessPhoneNumbersVariables
|
|
1271
|
+
buildUpdateBusinessPhoneNumbersVariables,
|
|
1272
|
+
buildUpdateBusinessVatVariables
|
|
1245
1273
|
};
|
|
1246
1274
|
|
|
1247
1275
|
// src/services/os-places/address-lookup-service.js
|
package/package.json
CHANGED
package/src/constants/index.js
CHANGED
|
@@ -36,7 +36,8 @@ 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
|
|
40
41
|
} from './success-messages.js'
|
|
41
42
|
|
|
42
43
|
// Interrupter journey constants
|
|
@@ -86,7 +87,8 @@ export const constants = {
|
|
|
86
87
|
successMessages: {
|
|
87
88
|
BUSINESS_EMAIL_ADDRESS,
|
|
88
89
|
BUSINESS_NAME,
|
|
89
|
-
BUSINESS_PHONE_NUMBERS
|
|
90
|
+
BUSINESS_PHONE_NUMBERS,
|
|
91
|
+
BUSINESS_VAT
|
|
90
92
|
},
|
|
91
93
|
interrupterJourney: {
|
|
92
94
|
PERSONAL_SECTION_FIELD_ORDER,
|
|
@@ -1,3 +1,4 @@
|
|
|
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'
|
|
@@ -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
|
}
|