@tap-payments/auth-jsconnect 2.3.27-test → 2.3.28-test
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/build/api/entity.d.ts +5 -5
- package/build/features/app/bank/bankStore.js +26 -30
- package/build/features/app/brand/brandStore.js +38 -37
- package/build/features/app/entity/entityStore.js +58 -68
- package/build/features/app/individual/individualStore.js +59 -65
- package/build/features/app/tax/taxStore.js +23 -22
- package/build/features/bank/screens/BankDetails/BankDetails.js +4 -3
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
- package/build/features/bank/screens/BankDetails/validation.js +16 -21
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -2
- package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +10 -19
- package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -9
- package/build/features/brand/screens/BrandInfo/validation.js +31 -38
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +1 -1
- package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
- package/build/features/entity/screens/EntityCapital/validation.js +4 -10
- package/build/features/entity/screens/EntityName/EntityName.js +1 -1
- package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
- package/build/features/entity/screens/EntityName/validation.js +68 -93
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +1 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +1 -1
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +2 -5
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
- package/build/hooks/useFormReadOnly.js +4 -2
- package/package.json +1 -1
|
@@ -71,7 +71,7 @@ import API from '../../../api';
|
|
|
71
71
|
import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
|
|
72
72
|
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
74
|
-
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
|
|
74
|
+
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
76
76
|
var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
|
|
77
77
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -538,10 +538,10 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
|
|
|
538
538
|
});
|
|
539
539
|
}); });
|
|
540
540
|
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
541
|
-
var _a, settings, individual, _b, notification, user, entity, _c, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type,
|
|
542
|
-
var _d, _e, _f, _g;
|
|
543
|
-
return __generator(this, function (
|
|
544
|
-
switch (
|
|
541
|
+
var _a, settings, individual, _b, notification, user, entity, _c, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isNameNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, contact, requestBody, data;
|
|
542
|
+
var _d, _e, _f, _g, _h, _j;
|
|
543
|
+
return __generator(this, function (_k) {
|
|
544
|
+
switch (_k.label) {
|
|
545
545
|
case 0:
|
|
546
546
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
547
547
|
_b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user, entity = _b.entity;
|
|
@@ -551,57 +551,52 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
551
551
|
data_status = (user || {}).data_status;
|
|
552
552
|
userName = getUserNameObject(name);
|
|
553
553
|
identification_id_type = nid && (nid === null || nid === void 0 ? void 0 : nid.startsWith('1')) ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
554
|
+
isNameNonEditable = hasNoneEditableValue(data_status, 'name');
|
|
555
|
+
isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
|
|
556
|
+
isMobileNumberNonEditable = hasNoneEditableValue((_d = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _d === void 0 ? void 0 : _d.phone, 'number');
|
|
557
|
+
isMobileCountryNonEditable = hasNoneEditableValue((_e = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _e === void 0 ? void 0 : _e.phone, 'country_code');
|
|
558
|
+
isNidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'id');
|
|
559
|
+
isIssuedCountryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'issuer_country');
|
|
560
|
+
isExpiryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'expiry');
|
|
561
|
+
isIdTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'type');
|
|
562
|
+
isNationalityNonEditable = hasNoneEditableValue(data_status, 'nationality');
|
|
563
|
+
isDOBNonEditable = hasNoneEditableValue(data_status, 'birth.date');
|
|
564
|
+
isBirthCityNonEditable = hasNoneEditableValue(data_status, 'birth.city');
|
|
565
|
+
isBirthCountryNonEditable = hasNoneEditableValue(data_status, 'birth.country');
|
|
563
566
|
hasContact = email || mobile || countryCode;
|
|
564
567
|
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
565
568
|
hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
|
|
566
569
|
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
567
|
-
|
|
568
|
-
? {
|
|
570
|
+
contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
|
|
571
|
+
? __assign({ email: isEmailNonEditable ? undefined : email }, (!((isMobileCountryNonEditable && isMobileNumberNonEditable) || !hasPhone) && {
|
|
572
|
+
phone: {
|
|
573
|
+
country_code: isMobileCountryNonEditable ? undefined : (_f = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _f === void 0 ? void 0 : _f.toString(),
|
|
574
|
+
number: isMobileNumberNonEditable || !mobile ? undefined : mobile
|
|
575
|
+
}
|
|
576
|
+
})) : undefined;
|
|
577
|
+
requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: id, type: type, gender: gender || undefined }, (!(isNameNonEditable || !userName.first) && {
|
|
578
|
+
names: {
|
|
569
579
|
en: userName,
|
|
570
580
|
ar: userName
|
|
571
581
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
number: isMobileNumberEditable ? mobile : undefined
|
|
580
|
-
}
|
|
581
|
-
: undefined
|
|
582
|
+
})), { contact: contact }), (hasIdentification &&
|
|
583
|
+
!(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
|
|
584
|
+
identification: {
|
|
585
|
+
id: isNidNonEditable || !nid ? undefined : nid,
|
|
586
|
+
issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
|
|
587
|
+
expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
|
|
588
|
+
type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
|
|
582
589
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
issued_country_code: isIssuedCountryEditable ? issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2 : undefined,
|
|
594
|
-
expiry: isExpiryEditable ? new Date(expiryDate).getTime() : undefined,
|
|
595
|
-
type: isIdTypeEditable ? identification_id_type : undefined
|
|
596
|
-
}
|
|
597
|
-
: undefined,
|
|
598
|
-
date_of_birth: dob,
|
|
599
|
-
birth: hasBirth && {
|
|
600
|
-
city: (_e = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _e === void 0 ? void 0 : _e.en,
|
|
601
|
-
country: placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
602
|
-
},
|
|
603
|
-
nationality: isNationalityEditable ? nationality === null || nationality === void 0 ? void 0 : nationality.iso2 : undefined,
|
|
604
|
-
encryption_contract: [
|
|
590
|
+
})), (!isDOBNonEditable && {
|
|
591
|
+
date_of_birth: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
|
|
592
|
+
})), (!((isBirthCityNonEditable && isBirthCountryNonEditable) || !hasBirth) && {
|
|
593
|
+
birth: {
|
|
594
|
+
city: isBirthCityNonEditable ? undefined : (_g = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _g === void 0 ? void 0 : _g.en,
|
|
595
|
+
country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
|
|
596
|
+
}
|
|
597
|
+
})), (!isNationalityNonEditable && {
|
|
598
|
+
nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
|
|
599
|
+
})), { encryption_contract: [
|
|
605
600
|
'gender',
|
|
606
601
|
'contact.email',
|
|
607
602
|
'contact.phone.country_code',
|
|
@@ -614,26 +609,24 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
614
609
|
'birth.country',
|
|
615
610
|
'date_of_birth',
|
|
616
611
|
'nationality'
|
|
617
|
-
],
|
|
618
|
-
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO
|
|
619
|
-
};
|
|
612
|
+
], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
|
|
620
613
|
return [4, API.individualService.updateIndividual(requestBody)];
|
|
621
614
|
case 1:
|
|
622
|
-
data =
|
|
615
|
+
data = _k.sent();
|
|
623
616
|
if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
|
|
624
617
|
return [4, thunkApi.dispatch(retrieveDataList(code))];
|
|
625
618
|
case 2:
|
|
626
|
-
|
|
627
|
-
|
|
619
|
+
_k.sent();
|
|
620
|
+
_k.label = 3;
|
|
628
621
|
case 3:
|
|
629
622
|
thunkApi.dispatch(handleNextScreenStep());
|
|
630
|
-
(
|
|
623
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
631
624
|
return [2, { data: data, formData: params }];
|
|
632
625
|
}
|
|
633
626
|
});
|
|
634
627
|
}); });
|
|
635
628
|
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
636
|
-
var _a, settings, individual, _b, notification, user, _c, id, type, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue,
|
|
629
|
+
var _a, settings, individual, _b, notification, user, _c, id, type, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data, civilID, signatureFileId, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody;
|
|
637
630
|
var _d, _e;
|
|
638
631
|
return __generator(this, function (_f) {
|
|
639
632
|
switch (_f.label) {
|
|
@@ -642,16 +635,17 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
642
635
|
_b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user;
|
|
643
636
|
_c = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
644
637
|
occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
638
|
+
isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
|
|
639
|
+
isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
|
|
640
|
+
isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
|
|
641
|
+
isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
|
|
642
|
+
isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
|
|
649
643
|
isSharesAvailable = shareCount || shareValue;
|
|
650
|
-
pepInfo =
|
|
651
|
-
influencerInfo =
|
|
652
|
-
occupationInfo =
|
|
653
|
-
sourceIncomeInfo =
|
|
654
|
-
monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id)
|
|
644
|
+
pepInfo = isPEPNonEditable ? undefined : isPEP;
|
|
645
|
+
influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
|
|
646
|
+
occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { id: occupation.id };
|
|
647
|
+
sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
|
|
648
|
+
monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
|
|
655
649
|
userPayload = {
|
|
656
650
|
occupation: occupationInfo,
|
|
657
651
|
source_income: sourceIncomeInfo,
|
|
@@ -51,7 +51,7 @@ import API from '../../../api';
|
|
|
51
51
|
import { DocumentPurpose, FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { TAX_STEP_NAMES } from '../../../constants';
|
|
54
|
-
import { getRecentDocumentBasedOnPurpose } from '../../../utils';
|
|
54
|
+
import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue } from '../../../utils';
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -169,41 +169,42 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
169
169
|
});
|
|
170
170
|
}); });
|
|
171
171
|
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
|
-
var _a, settings, tax,
|
|
173
|
-
var
|
|
174
|
-
return __generator(this, function (
|
|
175
|
-
switch (
|
|
172
|
+
var _a, settings, tax, _b, id, data_status, documents, isTaxNumberNonEditable, isConfirmPolicyNonEditable, isDocumentsNonEditable, document, requestBody, data, documentBody, _c, documentBody, _d;
|
|
173
|
+
var _e, _f, _g, _h;
|
|
174
|
+
return __generator(this, function (_j) {
|
|
175
|
+
switch (_j.label) {
|
|
176
176
|
case 0:
|
|
177
177
|
_a = thunkApi.getState(), settings = _a.settings, tax = _a.tax;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
_b = ((_e = tax.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.entity) || {}, id = _b.id, data_status = _b.data_status, documents = _b.documents;
|
|
179
|
+
isTaxNumberNonEditable = hasNoneEditableValue(data_status, 'tax_number');
|
|
180
|
+
isConfirmPolicyNonEditable = hasNoneEditableValue(data_status, 'is_vat_acknowledged');
|
|
181
|
+
isDocumentsNonEditable = hasNoneEditableValue(data_status, 'documents');
|
|
182
|
+
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.TAX_DOCUMENT);
|
|
182
183
|
requestBody = {
|
|
183
|
-
id:
|
|
184
|
-
vat_id:
|
|
184
|
+
id: id,
|
|
185
|
+
vat_id: isTaxNumberNonEditable ? undefined : params.vatId,
|
|
185
186
|
step_name: TAX_STEP_NAMES.TAX_INFO,
|
|
186
|
-
is_vat_acknowledged: params.confirmPolicy
|
|
187
|
+
is_vat_acknowledged: isConfirmPolicyNonEditable ? undefined : params.confirmPolicy
|
|
187
188
|
};
|
|
188
189
|
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
189
190
|
case 1:
|
|
190
|
-
data = (
|
|
191
|
-
if ((
|
|
191
|
+
data = (_j.sent()).data;
|
|
192
|
+
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
192
193
|
throw new Error(data.errors[0].description);
|
|
193
|
-
if (!((params.documentId || []).length > 0)) return [3, 5];
|
|
194
|
+
if (!(!isDocumentsNonEditable && (params.documentId || []).length > 0)) return [3, 5];
|
|
194
195
|
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 3];
|
|
195
196
|
documentBody = {
|
|
196
197
|
id: document === null || document === void 0 ? void 0 : document.id,
|
|
197
198
|
images: params.documentId
|
|
198
199
|
};
|
|
199
|
-
|
|
200
|
+
_c = data;
|
|
200
201
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
201
202
|
case 2:
|
|
202
|
-
|
|
203
|
+
_c.documentData = _j.sent();
|
|
203
204
|
return [3, 5];
|
|
204
205
|
case 3:
|
|
205
206
|
documentBody = {
|
|
206
|
-
entity_id:
|
|
207
|
+
entity_id: id || '',
|
|
207
208
|
documents: [
|
|
208
209
|
{
|
|
209
210
|
type: DocumentPurpose.TAX_DOCUMENT,
|
|
@@ -211,14 +212,14 @@ export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (params, t
|
|
|
211
212
|
}
|
|
212
213
|
]
|
|
213
214
|
};
|
|
214
|
-
|
|
215
|
+
_d = data;
|
|
215
216
|
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
216
217
|
case 4:
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
_d.documentData = _j.sent();
|
|
219
|
+
_j.label = 5;
|
|
219
220
|
case 5:
|
|
220
221
|
thunkApi.dispatch(handleNextScreenStep());
|
|
221
|
-
(
|
|
222
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, requestBody);
|
|
222
223
|
return [2, { data: data, formData: params }];
|
|
223
224
|
}
|
|
224
225
|
});
|
|
@@ -16,7 +16,7 @@ import Beneficiary from './Beneficiary';
|
|
|
16
16
|
import IBAN from './IBAN';
|
|
17
17
|
import BankName from './BankName';
|
|
18
18
|
import Button from '../../../shared/Button';
|
|
19
|
-
import { useAppDispatch, useAppSelector, useFormReadOnly, useSetFromDefaultValues, useDataNoneEditable } from '../../../../hooks';
|
|
19
|
+
import { useAppDispatch, useAppSelector, useFormReadOnly, useSetFromDefaultValues, useDataNoneEditable, useFormErrorAndUpdateReadOnly } from '../../../../hooks';
|
|
20
20
|
import { BankKWFLValidation, BankValidation } from './validation';
|
|
21
21
|
import { useTranslation } from 'react-i18next';
|
|
22
22
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -54,7 +54,7 @@ var BankDetails = function () {
|
|
|
54
54
|
var isFL = ((_a = entity === null || entity === void 0 ? void 0 : entity.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === BusinessType.FL ? true : false;
|
|
55
55
|
var bankHasDocument = ((_c = (_b = bank_account === null || bank_account === void 0 ? void 0 : bank_account.document) === null || _b === void 0 ? void 0 : _b.file_details) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
|
56
56
|
var methods = useForm({
|
|
57
|
-
resolver: yupResolver(isKWCountry && isFL && !bankHasDocument ? BankKWFLValidation(
|
|
57
|
+
resolver: yupResolver(isKWCountry && isFL && !bankHasDocument ? BankKWFLValidation() : BankValidation()),
|
|
58
58
|
defaultValues: {
|
|
59
59
|
iban: iban,
|
|
60
60
|
beneficiaryName: beneficiaryName,
|
|
@@ -84,7 +84,7 @@ var BankDetails = function () {
|
|
|
84
84
|
return [];
|
|
85
85
|
return getFileDetailsFromDocument([bank_account.document], DocumentPurpose.BANK_STATEMENT);
|
|
86
86
|
}, [bank_account === null || bank_account === void 0 ? void 0 : bank_account.document]);
|
|
87
|
-
var
|
|
87
|
+
var originalReadOnly = useFormReadOnly(methods, { bankStatementId: defaultBankFiles });
|
|
88
88
|
var noneEditable = useDataNoneEditable(bank_account === null || bank_account === void 0 ? void 0 : bank_account.data_status, [
|
|
89
89
|
'beneficiary_name',
|
|
90
90
|
'bank_name',
|
|
@@ -93,6 +93,7 @@ var BankDetails = function () {
|
|
|
93
93
|
'bank_statement_file_id',
|
|
94
94
|
'is_acknowledged'
|
|
95
95
|
]);
|
|
96
|
+
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
96
97
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, { readOnly: readOnly['beneficiaryName'] || noneEditable['beneficiary_name'] }), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking, readOnly: readOnly['iban'] || noneEditable['iban'] }), _jsx(BankName, { readOnly: readOnly['bankName'] || noneEditable['bank_name'] }), _jsx(BankStatement, { required: isKWCountry && isFL && !bankHasDocument, defaultFiles: defaultBankFiles, readOnly: readOnly['bankStatementId'] || noneEditable['bank_statement_file_id'] }), _jsx(ConfirmPolicy, { readOnly: readOnly['confirmPolicy'] || noneEditable['is_acknowledged'] }), _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, disableBack: true, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
97
98
|
};
|
|
98
99
|
export default BankDetails;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const BankValidation: (
|
|
3
|
-
iban: yup.
|
|
2
|
+
export declare const BankValidation: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
4
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
|
-
beneficiaryName: yup.
|
|
5
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
6
|
bankStatementId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
7
7
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
8
8
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
-
iban: yup.
|
|
9
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
10
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
11
|
-
beneficiaryName: yup.
|
|
11
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
12
|
bankStatementId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
13
13
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
14
14
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
|
-
iban: yup.
|
|
15
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
16
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
|
-
beneficiaryName: yup.
|
|
17
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
18
|
bankStatementId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
19
19
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
20
20
|
}>>>;
|
|
21
|
-
export declare const BankKWFLValidation: (
|
|
22
|
-
iban: yup.
|
|
21
|
+
export declare const BankKWFLValidation: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
23
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
24
|
-
beneficiaryName: yup.
|
|
24
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
25
25
|
bankStatementId: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
26
26
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
27
27
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
|
-
iban: yup.
|
|
28
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
29
29
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
|
-
beneficiaryName: yup.
|
|
30
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
31
31
|
bankStatementId: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
32
32
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
33
33
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
34
|
-
iban: yup.
|
|
34
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
35
35
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
36
|
-
beneficiaryName: yup.
|
|
36
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
37
|
bankStatementId: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
38
38
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
39
39
|
}>>>;
|
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { FieldType } from '../../../../@types';
|
|
3
2
|
import { REGEX_ALPHANUMERIC, REGEX_IBAN } from '../../../../constants';
|
|
4
|
-
export var BankValidation = function (
|
|
5
|
-
var _a = bankAccount || {}, iban = _a.iban, beneficiary_name = _a.beneficiary_name, data_status = _a.data_status;
|
|
6
|
-
var isIBANOptional = !iban && (data_status === null || data_status === void 0 ? void 0 : data_status.iban) === FieldType.NON_EDITABLE;
|
|
7
|
-
var isBeneficiaryNameOptional = !beneficiary_name && (data_status === null || data_status === void 0 ? void 0 : data_status.beneficiary_name) === FieldType.NON_EDITABLE;
|
|
3
|
+
export var BankValidation = function () {
|
|
8
4
|
return yup.object().shape({
|
|
9
|
-
iban:
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
iban: yup
|
|
6
|
+
.string()
|
|
7
|
+
.matches(REGEX_IBAN, 'invalid_iban_format')
|
|
8
|
+
.min(15, 'invalid_iban_format')
|
|
9
|
+
.max(34, 'invalid_iban_format')
|
|
10
|
+
.required('alert_iban'),
|
|
12
11
|
bankName: yup.string().optional(),
|
|
13
|
-
beneficiaryName:
|
|
14
|
-
? yup.string().optional()
|
|
15
|
-
: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
12
|
+
beneficiaryName: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
16
13
|
bankStatementId: yup.array().optional(),
|
|
17
14
|
confirmPolicy: yup.boolean().required('alert_bank_confirm').isTrue('alert_bank_confirm')
|
|
18
15
|
});
|
|
19
16
|
};
|
|
20
|
-
export var BankKWFLValidation = function (
|
|
21
|
-
var _a = bankAccount || {}, iban = _a.iban, beneficiary_name = _a.beneficiary_name, data_status = _a.data_status;
|
|
22
|
-
var isIBANOptional = !iban && (data_status === null || data_status === void 0 ? void 0 : data_status.iban) === FieldType.NON_EDITABLE;
|
|
23
|
-
var isBeneficiaryNameOptional = !beneficiary_name && (data_status === null || data_status === void 0 ? void 0 : data_status.beneficiary_name) === FieldType.NON_EDITABLE;
|
|
17
|
+
export var BankKWFLValidation = function () {
|
|
24
18
|
return yup.object().shape({
|
|
25
|
-
iban:
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
iban: yup
|
|
20
|
+
.string()
|
|
21
|
+
.matches(REGEX_IBAN, 'invalid_iban_format')
|
|
22
|
+
.min(15, 'invalid_iban_format')
|
|
23
|
+
.max(34, 'invalid_iban_format')
|
|
24
|
+
.required('alert_iban'),
|
|
28
25
|
bankName: yup.string().optional(),
|
|
29
|
-
beneficiaryName:
|
|
30
|
-
? yup.string().optional()
|
|
31
|
-
: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
26
|
+
beneficiaryName: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
32
27
|
bankStatementId: yup.array().min(1, 'bank_statement_required').required('bank_statement_required'),
|
|
33
28
|
confirmPolicy: yup.boolean().required('alert_bank_confirm').isTrue('alert_bank_confirm')
|
|
34
29
|
});
|
|
@@ -40,7 +40,6 @@ var BrandActivities = function (_a) {
|
|
|
40
40
|
var dispatch = useAppDispatch();
|
|
41
41
|
var settingData = useAppSelector(settingsSelector).data;
|
|
42
42
|
var _c = useAppSelector(brandSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
43
|
-
var brand = (data.verify.responseBody || {}).brand;
|
|
44
43
|
var _d = data.brandActivities, activities = _d.activities, customerLocations = _d.customerLocations, expectedCustomer = _d.expectedCustomer, expectedSale = _d.expectedSale, termAndConditionChecked = _d.termAndConditionChecked, refundPolicy = _d.refundPolicy, transactionPolicy = _d.transactionPolicy;
|
|
45
44
|
var ListType;
|
|
46
45
|
(function (ListType) {
|
|
@@ -50,7 +49,7 @@ var BrandActivities = function (_a) {
|
|
|
50
49
|
ListType["ExpectedSalesList"] = "ExpectedSalesList";
|
|
51
50
|
})(ListType || (ListType = {}));
|
|
52
51
|
var methods = useForm({
|
|
53
|
-
resolver: yupResolver(BrandActivitiesValidationSchema(
|
|
52
|
+
resolver: yupResolver(BrandActivitiesValidationSchema()),
|
|
54
53
|
defaultValues: {
|
|
55
54
|
activities: activities,
|
|
56
55
|
customerLocations: customerLocations,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const BrandActivitiesValidationSchema: (
|
|
3
|
-
activities: yup.ArraySchema<yup.
|
|
2
|
+
export declare const BrandActivitiesValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
4
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
5
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
6
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -16,14 +16,14 @@ export declare const BrandActivitiesValidationSchema: (brand: any) => yup.Object
|
|
|
16
16
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
17
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
18
|
}>>[] | undefined>;
|
|
19
|
-
customerLocations:
|
|
19
|
+
customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
20
20
|
expectedCustomers: any;
|
|
21
21
|
expectedSalesRange: any;
|
|
22
22
|
termAndConditionChecked: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
23
23
|
refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
24
24
|
transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
25
25
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
26
|
-
activities: yup.ArraySchema<yup.
|
|
26
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
27
27
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
28
28
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
29
29
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -39,14 +39,14 @@ export declare const BrandActivitiesValidationSchema: (brand: any) => yup.Object
|
|
|
39
39
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
40
40
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
41
41
|
}>>[] | undefined>;
|
|
42
|
-
customerLocations:
|
|
42
|
+
customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
43
43
|
expectedCustomers: any;
|
|
44
44
|
expectedSalesRange: any;
|
|
45
45
|
termAndConditionChecked: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
46
46
|
refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
47
47
|
transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
48
48
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
49
|
-
activities: yup.ArraySchema<yup.
|
|
49
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
50
50
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
51
51
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
52
52
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -62,7 +62,7 @@ export declare const BrandActivitiesValidationSchema: (brand: any) => yup.Object
|
|
|
62
62
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
63
63
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
64
64
|
}>>[] | undefined>;
|
|
65
|
-
customerLocations:
|
|
65
|
+
customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
66
66
|
expectedCustomers: any;
|
|
67
67
|
expectedSalesRange: any;
|
|
68
68
|
termAndConditionChecked: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { FieldType } from '../../../../@types';
|
|
3
2
|
var objectElements = {
|
|
4
3
|
id: yup.number(),
|
|
5
4
|
name_ar: yup.string(),
|
|
6
5
|
name_en: yup.string()
|
|
7
6
|
};
|
|
8
|
-
export var BrandActivitiesValidationSchema = function (
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
var _d = brand || {}, activities = _d.activities, operations = _d.operations, data_status = _d.data_status;
|
|
11
|
-
var _e = operations || {}, customer_base = _e.customer_base, sales = _e.sales;
|
|
12
|
-
var isActivitiesOptional = !((activities === null || activities === void 0 ? void 0 : activities.length) > 0) && (data_status === null || data_status === void 0 ? void 0 : data_status.activities) === FieldType.NON_EDITABLE;
|
|
13
|
-
var isCustomerLocationsOptional = !(((_a = customer_base === null || customer_base === void 0 ? void 0 : customer_base.locations) === null || _a === void 0 ? void 0 : _a.length) > 0) && ((_b = data_status === null || data_status === void 0 ? void 0 : data_status.customer_base) === null || _b === void 0 ? void 0 : _b.location) === FieldType.NON_EDITABLE;
|
|
14
|
-
var isExpectedSalesRangeOptional = !(sales === null || sales === void 0 ? void 0 : sales.id) && ((_c = data_status === null || data_status === void 0 ? void 0 : data_status.operations) === null || _c === void 0 ? void 0 : _c.sales_range) === FieldType.NON_EDITABLE;
|
|
7
|
+
export var BrandActivitiesValidationSchema = function () {
|
|
15
8
|
return yup.object().shape({
|
|
16
|
-
activities:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})),
|
|
25
|
-
customerLocations: isCustomerLocationsOptional ? yup.array().optional() : yup.array().required('please_choose_base'),
|
|
9
|
+
activities: yup
|
|
10
|
+
.array()
|
|
11
|
+
.min(1, 'activities_list_alert')
|
|
12
|
+
.of(yup.object().shape({
|
|
13
|
+
ar: yup.string(),
|
|
14
|
+
en: yup.string()
|
|
15
|
+
})),
|
|
16
|
+
customerLocations: yup.array().required('please_choose_base'),
|
|
26
17
|
expectedCustomers: yup.object().shape(objectElements).required('select_expected_customers_serve'),
|
|
27
|
-
expectedSalesRange:
|
|
18
|
+
expectedSalesRange: yup.object().shape(objectElements).required('select_expected_sales'),
|
|
28
19
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
29
20
|
refundPolicy: yup.boolean().required().isTrue('refund_policy_error'),
|
|
30
21
|
transactionPolicy: yup.boolean().required().isTrue('transaction_policy_error')
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
-
brandName: yup.
|
|
4
|
-
brandLogoId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
3
|
+
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
4
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
5
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
7
|
-
salesChannels:
|
|
6
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
7
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
8
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
9
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -14,11 +13,10 @@ export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/l
|
|
|
14
13
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
15
14
|
}>>[] | undefined>;
|
|
16
15
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
-
brandName: yup.
|
|
18
|
-
brandLogoId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
16
|
+
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
19
17
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
20
18
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
21
|
-
salesChannels:
|
|
19
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
20
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
21
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
22
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -28,11 +26,10 @@ export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/l
|
|
|
28
26
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
29
27
|
}>>[] | undefined>;
|
|
30
28
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
31
|
-
brandName: yup.
|
|
32
|
-
brandLogoId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
29
|
+
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
33
30
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
34
31
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
35
|
-
salesChannels:
|
|
32
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
36
33
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
34
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
38
35
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|