@zeniai/client-epic-state 5.0.90-betaAS6 → 5.0.90-betaAS7
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/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +8 -0
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +13 -24
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +5 -13
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.d.ts +3 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +9 -1
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.d.ts +1 -2
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +15 -26
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +3 -11
- package/package.json +1 -1
|
@@ -30,3 +30,11 @@ export const InternationalWireVerificationSubfieldNames = {
|
|
|
30
30
|
proofOfAddress: 'proof_of_address',
|
|
31
31
|
ssn: 'ssn',
|
|
32
32
|
};
|
|
33
|
+
export const InternationalWireVerificationReadonlyHideableFieldNames = [
|
|
34
|
+
InternationalWireVerificationFormFieldNames.stakeHolder,
|
|
35
|
+
InternationalWireVerificationFormFieldNames.controllingPerson,
|
|
36
|
+
InternationalWireVerificationFormFieldNames.businessOwnership,
|
|
37
|
+
InternationalWireVerificationFormFieldNames.companyProofOfAddress,
|
|
38
|
+
InternationalWireVerificationFormFieldNames.companyOfficerProofOfAddress,
|
|
39
|
+
];
|
|
40
|
+
export const InternationalWireVerificationReadonlyVisibilityGateFieldName = InternationalWireVerificationFormFieldNames.businessOwnership;
|
|
@@ -61,30 +61,6 @@ export const appendIntlWirePersonToLocalData = (localData, keyPrefix, person) =>
|
|
|
61
61
|
appendIntlWireFileOptionsToLocalData(localData, `${keyPrefix}_${InternationalWireVerificationSubfieldNames.proofOfAddress}`, toIntlWireFileOptionArray(person.proof_of_address));
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
const hasLocalDataValue = (value) => {
|
|
65
|
-
if (value == null) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
if (typeof value === 'string') {
|
|
69
|
-
return value !== '';
|
|
70
|
-
}
|
|
71
|
-
if (typeof value === 'number') {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
if (Array.isArray(value)) {
|
|
75
|
-
return value.length > 0;
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
};
|
|
79
|
-
export const hasBooleanWithSubfieldsFieldValueInLocalData = (fieldName, localData) => {
|
|
80
|
-
if (hasLocalDataValue(localData[fieldName])) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
if (fieldName === InternationalWireVerificationFormFieldNames.stakeHolder) {
|
|
84
|
-
return Object.entries(localData).some(([key, value]) => /^stake_holder_\d+_/.test(key) && hasLocalDataValue(value));
|
|
85
|
-
}
|
|
86
|
-
return Object.entries(localData).some(([key, value]) => key.startsWith(`${fieldName}_`) && hasLocalDataValue(value));
|
|
87
|
-
};
|
|
88
64
|
export const getStakeHolderOwnerIndicesFromLocalData = (localData) => {
|
|
89
65
|
const indices = new Set();
|
|
90
66
|
Object.keys(localData).forEach((key) => {
|
|
@@ -95,3 +71,16 @@ export const getStakeHolderOwnerIndicesFromLocalData = (localData) => {
|
|
|
95
71
|
});
|
|
96
72
|
return Array.from(indices).sort((a, b) => a - b);
|
|
97
73
|
};
|
|
74
|
+
export const hasBusinessOwnershipValueInLocalData = (localData) => {
|
|
75
|
+
const baseKey = InternationalWireVerificationFormFieldNames.businessOwnership;
|
|
76
|
+
const frontFileId = localData[baseKey];
|
|
77
|
+
if (typeof frontFileId === 'string' && frontFileId !== '') {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
const backFileId = localData[`${baseKey}${IntlWireVerificationLocalDataSuffix.documentBack}`];
|
|
81
|
+
if (typeof backFileId === 'string' && backFileId !== '') {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
const documentOption = localData[`${baseKey}${IntlWireVerificationLocalDataSuffix.documentOption}`];
|
|
85
|
+
return typeof documentOption === 'string' && documentOption !== '';
|
|
86
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InternationalWireVerificationFormFieldNames } from './internationalWireVerificationFieldConstants';
|
|
2
|
-
import {
|
|
1
|
+
import { InternationalWireVerificationReadonlyHideableFieldNames, InternationalWireVerificationFormFieldNames, } from './internationalWireVerificationFieldConstants';
|
|
2
|
+
import { hasBusinessOwnershipValueInLocalData } from './internationalWireVerificationLocalDataHelpers';
|
|
3
3
|
export const InternationalWireVerificationFormOrder = [
|
|
4
4
|
InternationalWireVerificationFormFieldNames.certificateOfGoodStanding,
|
|
5
5
|
InternationalWireVerificationFormFieldNames.businessOwnership,
|
|
@@ -41,20 +41,12 @@ export const toDynamicFormField = (key, payload) => ({
|
|
|
41
41
|
]))
|
|
42
42
|
: undefined,
|
|
43
43
|
});
|
|
44
|
-
const readonlyHideableVerificationFormFieldNames = new Set(
|
|
45
|
-
InternationalWireVerificationFormFieldNames.stakeHolder,
|
|
46
|
-
InternationalWireVerificationFormFieldNames.controllingPerson,
|
|
47
|
-
]);
|
|
44
|
+
const readonlyHideableVerificationFormFieldNames = new Set(InternationalWireVerificationReadonlyHideableFieldNames);
|
|
48
45
|
export const filterVerificationFormFieldsForReadonlyView = (fields, localData, isReadonly) => {
|
|
49
|
-
if (!isReadonly) {
|
|
46
|
+
if (!isReadonly || hasBusinessOwnershipValueInLocalData(localData)) {
|
|
50
47
|
return fields;
|
|
51
48
|
}
|
|
52
|
-
return fields.filter((field) =>
|
|
53
|
-
if (!readonlyHideableVerificationFormFieldNames.has(field.name)) {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
return hasBooleanWithSubfieldsFieldValueInLocalData(field.name, localData);
|
|
57
|
-
});
|
|
49
|
+
return fields.filter((field) => !readonlyHideableVerificationFormFieldNames.has(field.name));
|
|
58
50
|
};
|
|
59
51
|
export const sortVerificationFormFields = (fields) => {
|
|
60
52
|
const orderIndex = new Map(InternationalWireVerificationFormOrder.map((name, index) => [name, index]));
|
|
@@ -33,3 +33,6 @@ export declare const InternationalWireVerificationSubfieldNames: {
|
|
|
33
33
|
readonly ssn: "ssn";
|
|
34
34
|
};
|
|
35
35
|
export type InternationalWireVerificationSubfieldName = (typeof InternationalWireVerificationSubfieldNames)[keyof typeof InternationalWireVerificationSubfieldNames];
|
|
36
|
+
export declare const InternationalWireVerificationReadonlyHideableFieldNames: readonly ["stake_holder", "controlling_person", "business_ownership", "company_proof_of_address", "company_officer_proof_of_address"];
|
|
37
|
+
export type InternationalWireVerificationReadonlyHideableFieldName = (typeof InternationalWireVerificationReadonlyHideableFieldNames)[number];
|
|
38
|
+
export declare const InternationalWireVerificationReadonlyVisibilityGateFieldName: "business_ownership";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InternationalWireVerificationSubfieldNames = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNameList = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNames = exports.InternationalWireVerificationControllingPersonFieldName = exports.InternationalWireVerificationStakeHolderFieldName = exports.InternationalWireVerificationFormFieldNames = void 0;
|
|
3
|
+
exports.InternationalWireVerificationReadonlyVisibilityGateFieldName = exports.InternationalWireVerificationReadonlyHideableFieldNames = exports.InternationalWireVerificationSubfieldNames = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNameList = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNames = exports.InternationalWireVerificationControllingPersonFieldName = exports.InternationalWireVerificationStakeHolderFieldName = exports.InternationalWireVerificationFormFieldNames = void 0;
|
|
4
4
|
exports.InternationalWireVerificationFormFieldNames = {
|
|
5
5
|
certificateOfGoodStanding: 'certificate_of_good_standing',
|
|
6
6
|
businessOwnership: 'business_ownership',
|
|
@@ -33,3 +33,11 @@ exports.InternationalWireVerificationSubfieldNames = {
|
|
|
33
33
|
proofOfAddress: 'proof_of_address',
|
|
34
34
|
ssn: 'ssn',
|
|
35
35
|
};
|
|
36
|
+
exports.InternationalWireVerificationReadonlyHideableFieldNames = [
|
|
37
|
+
exports.InternationalWireVerificationFormFieldNames.stakeHolder,
|
|
38
|
+
exports.InternationalWireVerificationFormFieldNames.controllingPerson,
|
|
39
|
+
exports.InternationalWireVerificationFormFieldNames.businessOwnership,
|
|
40
|
+
exports.InternationalWireVerificationFormFieldNames.companyProofOfAddress,
|
|
41
|
+
exports.InternationalWireVerificationFormFieldNames.companyOfficerProofOfAddress,
|
|
42
|
+
];
|
|
43
|
+
exports.InternationalWireVerificationReadonlyVisibilityGateFieldName = exports.InternationalWireVerificationFormFieldNames.businessOwnership;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InternationalWireVerificationBooleanWithSubfieldsFieldName } from './internationalWireVerificationFieldConstants';
|
|
2
1
|
import { VerificationFormLocalData } from './internationalWireVerificationState';
|
|
3
2
|
export type IntlWireFileOptionLike = {
|
|
4
3
|
file_id: string;
|
|
@@ -24,5 +23,5 @@ export declare const isIntlWirePersonLike: (value: unknown) => value is IntlWire
|
|
|
24
23
|
export declare const toIntlWireFileOptionArray: (items: unknown[]) => IntlWireFileOptionLike[];
|
|
25
24
|
export declare const appendIntlWireFileOptionsToLocalData: (localData: VerificationFormLocalData, baseKey: string, fileOptions: IntlWireFileOptionLike[]) => void;
|
|
26
25
|
export declare const appendIntlWirePersonToLocalData: (localData: VerificationFormLocalData, keyPrefix: string, person: IntlWirePersonLike) => void;
|
|
27
|
-
export declare const hasBooleanWithSubfieldsFieldValueInLocalData: (fieldName: InternationalWireVerificationBooleanWithSubfieldsFieldName, localData: VerificationFormLocalData) => boolean;
|
|
28
26
|
export declare const getStakeHolderOwnerIndicesFromLocalData: (localData: VerificationFormLocalData) => number[];
|
|
27
|
+
export declare const hasBusinessOwnershipValueInLocalData: (localData: VerificationFormLocalData) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.hasBusinessOwnershipValueInLocalData = exports.getStakeHolderOwnerIndicesFromLocalData = exports.appendIntlWirePersonToLocalData = exports.appendIntlWireFileOptionsToLocalData = exports.toIntlWireFileOptionArray = exports.isIntlWirePersonLike = exports.isIntlWireFileOptionLike = void 0;
|
|
4
4
|
const internationalWireVerificationFieldConstants_1 = require("./internationalWireVerificationFieldConstants");
|
|
5
5
|
const internationalWireVerificationSubmitPayload_1 = require("./internationalWireVerificationSubmitPayload");
|
|
6
6
|
const isIntlWireFileOptionLike = (value) => typeof value === 'object' &&
|
|
@@ -69,31 +69,6 @@ const appendIntlWirePersonToLocalData = (localData, keyPrefix, person) => {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
exports.appendIntlWirePersonToLocalData = appendIntlWirePersonToLocalData;
|
|
72
|
-
const hasLocalDataValue = (value) => {
|
|
73
|
-
if (value == null) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
if (typeof value === 'string') {
|
|
77
|
-
return value !== '';
|
|
78
|
-
}
|
|
79
|
-
if (typeof value === 'number') {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
if (Array.isArray(value)) {
|
|
83
|
-
return value.length > 0;
|
|
84
|
-
}
|
|
85
|
-
return true;
|
|
86
|
-
};
|
|
87
|
-
const hasBooleanWithSubfieldsFieldValueInLocalData = (fieldName, localData) => {
|
|
88
|
-
if (hasLocalDataValue(localData[fieldName])) {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
if (fieldName === internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.stakeHolder) {
|
|
92
|
-
return Object.entries(localData).some(([key, value]) => /^stake_holder_\d+_/.test(key) && hasLocalDataValue(value));
|
|
93
|
-
}
|
|
94
|
-
return Object.entries(localData).some(([key, value]) => key.startsWith(`${fieldName}_`) && hasLocalDataValue(value));
|
|
95
|
-
};
|
|
96
|
-
exports.hasBooleanWithSubfieldsFieldValueInLocalData = hasBooleanWithSubfieldsFieldValueInLocalData;
|
|
97
72
|
const getStakeHolderOwnerIndicesFromLocalData = (localData) => {
|
|
98
73
|
const indices = new Set();
|
|
99
74
|
Object.keys(localData).forEach((key) => {
|
|
@@ -105,3 +80,17 @@ const getStakeHolderOwnerIndicesFromLocalData = (localData) => {
|
|
|
105
80
|
return Array.from(indices).sort((a, b) => a - b);
|
|
106
81
|
};
|
|
107
82
|
exports.getStakeHolderOwnerIndicesFromLocalData = getStakeHolderOwnerIndicesFromLocalData;
|
|
83
|
+
const hasBusinessOwnershipValueInLocalData = (localData) => {
|
|
84
|
+
const baseKey = internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.businessOwnership;
|
|
85
|
+
const frontFileId = localData[baseKey];
|
|
86
|
+
if (typeof frontFileId === 'string' && frontFileId !== '') {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
const backFileId = localData[`${baseKey}${internationalWireVerificationSubmitPayload_1.IntlWireVerificationLocalDataSuffix.documentBack}`];
|
|
90
|
+
if (typeof backFileId === 'string' && backFileId !== '') {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
const documentOption = localData[`${baseKey}${internationalWireVerificationSubmitPayload_1.IntlWireVerificationLocalDataSuffix.documentOption}`];
|
|
94
|
+
return typeof documentOption === 'string' && documentOption !== '';
|
|
95
|
+
};
|
|
96
|
+
exports.hasBusinessOwnershipValueInLocalData = hasBusinessOwnershipValueInLocalData;
|
|
@@ -45,20 +45,12 @@ const toDynamicFormField = (key, payload) => ({
|
|
|
45
45
|
: undefined,
|
|
46
46
|
});
|
|
47
47
|
exports.toDynamicFormField = toDynamicFormField;
|
|
48
|
-
const readonlyHideableVerificationFormFieldNames = new Set(
|
|
49
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.stakeHolder,
|
|
50
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.controllingPerson,
|
|
51
|
-
]);
|
|
48
|
+
const readonlyHideableVerificationFormFieldNames = new Set(internationalWireVerificationFieldConstants_1.InternationalWireVerificationReadonlyHideableFieldNames);
|
|
52
49
|
const filterVerificationFormFieldsForReadonlyView = (fields, localData, isReadonly) => {
|
|
53
|
-
if (!isReadonly) {
|
|
50
|
+
if (!isReadonly || (0, internationalWireVerificationLocalDataHelpers_1.hasBusinessOwnershipValueInLocalData)(localData)) {
|
|
54
51
|
return fields;
|
|
55
52
|
}
|
|
56
|
-
return fields.filter((field) =>
|
|
57
|
-
if (!readonlyHideableVerificationFormFieldNames.has(field.name)) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return (0, internationalWireVerificationLocalDataHelpers_1.hasBooleanWithSubfieldsFieldValueInLocalData)(field.name, localData);
|
|
61
|
-
});
|
|
53
|
+
return fields.filter((field) => !readonlyHideableVerificationFormFieldNames.has(field.name));
|
|
62
54
|
};
|
|
63
55
|
exports.filterVerificationFormFieldsForReadonlyView = filterVerificationFormFieldsForReadonlyView;
|
|
64
56
|
const sortVerificationFormFields = (fields) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.90-
|
|
3
|
+
"version": "5.0.90-betaAS7",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|