@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.
Files changed (33) hide show
  1. package/build/api/entity.d.ts +5 -5
  2. package/build/features/app/bank/bankStore.js +26 -30
  3. package/build/features/app/brand/brandStore.js +38 -37
  4. package/build/features/app/entity/entityStore.js +58 -68
  5. package/build/features/app/individual/individualStore.js +59 -65
  6. package/build/features/app/tax/taxStore.js +23 -22
  7. package/build/features/bank/screens/BankDetails/BankDetails.js +4 -3
  8. package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
  9. package/build/features/bank/screens/BankDetails/validation.js +16 -21
  10. package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -2
  11. package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
  12. package/build/features/brand/screens/BrandActivities/validation.js +10 -19
  13. package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -9
  14. package/build/features/brand/screens/BrandInfo/validation.js +31 -38
  15. package/build/features/entity/screens/EntityCapital/EntityCapital.js +1 -1
  16. package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
  17. package/build/features/entity/screens/EntityCapital/validation.js +4 -10
  18. package/build/features/entity/screens/EntityName/EntityName.js +1 -1
  19. package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
  20. package/build/features/entity/screens/EntityName/validation.js +68 -93
  21. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  22. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
  23. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
  24. package/build/features/tax/screens/TaxDetails/TaxDetails.js +1 -1
  25. package/build/features/tax/screens/TaxDetails/VATId.js +1 -1
  26. package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
  27. package/build/features/tax/screens/TaxDetails/validation.js +2 -5
  28. package/build/hooks/index.d.ts +1 -0
  29. package/build/hooks/index.js +1 -0
  30. package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
  31. package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
  32. package/build/hooks/useFormReadOnly.js +4 -2
  33. 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, isNameEditable, isEmailEditable, isMobileNumberEditable, isMobileCountryEditable, isNidEditable, isIssuedCountryEditable, isExpiryEditable, isIdTypeEditable, isNationalityEditable, hasContact, hasPhone, hasIdentification, hasBirth, names, contact, requestBody, data;
542
- var _d, _e, _f, _g;
543
- return __generator(this, function (_h) {
544
- switch (_h.label) {
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
- isNameEditable = true;
555
- isEmailEditable = true;
556
- isMobileNumberEditable = true;
557
- isMobileCountryEditable = true;
558
- isNidEditable = true;
559
- isIssuedCountryEditable = true;
560
- isExpiryEditable = true;
561
- isIdTypeEditable = true;
562
- isNationalityEditable = true;
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
- names = isNameEditable
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
- : undefined;
573
- contact = hasContact
574
- ? {
575
- email: isEmailEditable ? email : undefined,
576
- phone: hasPhone
577
- ? {
578
- country_code: isMobileCountryEditable ? (_d = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _d === void 0 ? void 0 : _d.toString() : undefined,
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
- : undefined;
584
- requestBody = {
585
- id: id,
586
- type: type,
587
- names: names,
588
- gender: gender || undefined,
589
- contact: contact,
590
- identification: hasIdentification
591
- ? {
592
- id: isNidEditable ? nid : undefined,
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 = _h.sent();
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
- _h.sent();
627
- _h.label = 3;
619
+ _k.sent();
620
+ _k.label = 3;
628
621
  case 3:
629
622
  thunkApi.dispatch(handleNextScreenStep());
630
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
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, isOccupationEditable, isSourceIncomeEditable, isPEPEditable, isInfluencerEditable, 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;
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
- isOccupationEditable = true;
646
- isSourceIncomeEditable = true;
647
- isPEPEditable = true;
648
- isInfluencerEditable = true;
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 = isPEPEditable ? isPEP : undefined;
651
- influencerInfo = isInfluencerEditable ? isInfluencer : undefined;
652
- occupationInfo = isOccupationEditable ? (occupation === null || occupation === void 0 ? void 0 : occupation.id) && { id: occupation.id } : undefined;
653
- sourceIncomeInfo = isSourceIncomeEditable ? (sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) && [{ id: sourceIncome.id }] : undefined;
654
- monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) && { id: 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, entity, entityId, isTaxNumberEditable, document, requestBody, data, documentBody, _b, documentBody, _c;
173
- var _d, _e, _f;
174
- return __generator(this, function (_g) {
175
- switch (_g.label) {
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
- entity = (tax.data.verify.responseBody || {}).entity;
179
- entityId = entity === null || entity === void 0 ? void 0 : entity.id;
180
- isTaxNumberEditable = true;
181
- document = getRecentDocumentBasedOnPurpose(entity === null || entity === void 0 ? void 0 : entity.documents, DocumentPurpose.TAX_DOCUMENT);
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: entityId,
184
- vat_id: isTaxNumberEditable ? params.vatId : undefined,
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 = (_g.sent()).data;
191
- if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
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
- _b = data;
200
+ _c = data;
200
201
  return [4, API.documentService.addFilesToExistingDocument(documentBody)];
201
202
  case 2:
202
- _b.documentData = _g.sent();
203
+ _c.documentData = _j.sent();
203
204
  return [3, 5];
204
205
  case 3:
205
206
  documentBody = {
206
- entity_id: entityId || '',
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
- _c = data;
215
+ _d = data;
215
216
  return [4, API.documentService.updateDocumentInfo(documentBody)];
216
217
  case 4:
217
- _c.documentData = _g.sent();
218
- _g.label = 5;
218
+ _d.documentData = _j.sent();
219
+ _j.label = 5;
219
220
  case 5:
220
221
  thunkApi.dispatch(handleNextScreenStep());
221
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
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(bank_account) : BankValidation(bank_account)),
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 readOnly = useFormReadOnly(methods, { bankStatementId: defaultBankFiles });
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: (bankAccount: any) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- iban: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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: (bankAccount: any) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
22
- iban: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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 (bankAccount) {
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: isIBANOptional
10
- ? yup.string().optional()
11
- : yup.string().matches(REGEX_IBAN, 'invalid_iban_format').min(15, 'invalid_iban_format').max(34, 'invalid_iban_format').required('alert_iban'),
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: isBeneficiaryNameOptional
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 (bankAccount) {
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: isIBANOptional
26
- ? yup.string().optional()
27
- : yup.string().matches(REGEX_IBAN, 'invalid_iban_format').min(15, 'invalid_iban_format').max(34, 'invalid_iban_format').required('alert_iban'),
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: isBeneficiaryNameOptional
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(brand)),
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: (brand: any) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- activities: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
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: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
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.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
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: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
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.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
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: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
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 (brand) {
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: isActivitiesOptional
17
- ? yup.array().optional()
18
- : yup
19
- .array()
20
- .min(1, 'activities_list_alert')
21
- .of(yup.object().shape({
22
- ar: yup.string(),
23
- en: yup.string()
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: isExpectedSalesRangeOptional ? yup.object().optional() : yup.object().shape(objectElements).required('select_expected_sales'),
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
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.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
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: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
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>;