@tap-payments/auth-jsconnect 2.3.0 → 2.3.1

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 (37) hide show
  1. package/build/app/settings.d.ts +3 -1
  2. package/build/app/settings.js +10 -5
  3. package/build/assets/locales/ar.json +3 -1
  4. package/build/assets/locales/en.json +3 -1
  5. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +5 -2
  6. package/build/components/ArabicDatePicker/ArabicDatePicker.js +36 -19
  7. package/build/components/ArabicDatePicker/style.css +44 -5
  8. package/build/components/DatePicker/DatePicker.d.ts +2 -1
  9. package/build/components/DatePicker/DatePicker.js +12 -7
  10. package/build/constants/assets.d.ts +2 -0
  11. package/build/constants/assets.js +2 -0
  12. package/build/features/app/connect/connectStore.d.ts +13 -0
  13. package/build/features/app/connect/connectStore.js +114 -39
  14. package/build/features/app/connectExpress/connectExpressStore.js +1 -2
  15. package/build/features/app/entity/entityStore.js +1 -1
  16. package/build/features/brand/screens/BrandActivities/validation.d.ts +30 -30
  17. package/build/features/brand/screens/BrandActivities/validation.js +2 -2
  18. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  19. package/build/features/business/screens/Activities/validation.d.ts +90 -90
  20. package/build/features/business/screens/Activities/validation.js +2 -2
  21. package/build/features/business/screens/IDBOD/DOB.js +2 -2
  22. package/build/features/connect/Connect.js +55 -4
  23. package/build/features/connect/screens/NID/DOB.js +3 -3
  24. package/build/features/connectExpress/ConnectExpress.js +2 -5
  25. package/build/features/connectExpress/screens/NID/DOB.js +2 -2
  26. package/build/features/connectExpress/screens/NIDMissed/DOB.js +2 -2
  27. package/build/features/entity/screens/EntityCapital/validation.d.ts +90 -90
  28. package/build/features/entity/screens/EntityCapital/validation.js +2 -2
  29. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
  30. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
  31. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
  32. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +2 -2
  33. package/build/features/shared/Calender/Calender.d.ts +13 -0
  34. package/build/features/shared/Calender/Calender.js +56 -0
  35. package/build/features/shared/Calender/index.d.ts +2 -0
  36. package/build/features/shared/Calender/index.js +2 -0
  37. package/package.json +1 -1
@@ -228,7 +228,7 @@ export var createNIDAuth = createAsyncThunk('createNIDAuth', function (params, t
228
228
  });
229
229
  }); });
230
230
  export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
231
- var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, leadResponse, channels, brands, err_1, countryCode, phone;
231
+ var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, leadResponse, channels, brand, err_1, brands, err_2, countryCode, phone;
232
232
  var _c, _d, _e, _f;
233
233
  return __generator(this, function (_g) {
234
234
  switch (_g.label) {
@@ -274,15 +274,25 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
274
274
  _g.label = 4;
275
275
  case 4:
276
276
  _g.trys.push([4, 6, , 7]);
277
- return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
277
+ return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
278
278
  case 5:
279
- brands = (_g.sent()).brands;
280
- leadResponse.brand_list = fixBrandList(brands, channels);
279
+ brand = (_g.sent()).brand;
280
+ leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
281
281
  return [3, 7];
282
282
  case 6:
283
283
  err_1 = _g.sent();
284
284
  return [3, 7];
285
285
  case 7:
286
+ _g.trys.push([7, 9, , 10]);
287
+ return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
288
+ case 8:
289
+ brands = (_g.sent()).brands;
290
+ leadResponse.brand_list = fixBrandList(brands, channels);
291
+ return [3, 10];
292
+ case 9:
293
+ err_2 = _g.sent();
294
+ return [3, 10];
295
+ case 10:
286
296
  countryCode = settings.data.businessCountry;
287
297
  phone = (leadResponse.contact || {}).phone;
288
298
  if (phone === null || phone === void 0 ? void 0 : phone.country_code)
@@ -294,7 +304,7 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
294
304
  });
295
305
  }); });
296
306
  export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
297
- var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels, brands, err_2, phone;
307
+ var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
298
308
  var _b, _c, _d, _e, _f;
299
309
  return __generator(this, function (_g) {
300
310
  switch (_g.label) {
@@ -307,15 +317,15 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
307
317
  count = 1;
308
318
  _g.label = 1;
309
319
  case 1:
310
- if (!(count <= maxCalls)) return [3, 13];
320
+ if (!(count <= maxCalls)) return [3, 16];
311
321
  if (thunkApi.signal.aborted) {
312
- return [3, 13];
322
+ return [3, 16];
313
323
  }
314
324
  return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
315
325
  case 2:
316
326
  authResponse = _g.sent();
317
327
  isSuccess = ((_b = authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
318
- if (!isSuccess) return [3, 10];
328
+ if (!isSuccess) return [3, 13];
319
329
  lead_id = authResponse.lead_id;
320
330
  if (!lead_id)
321
331
  throw new Error('Lead id is missing');
@@ -332,18 +342,28 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
332
342
  _g.label = 5;
333
343
  case 5:
334
344
  _g.trys.push([5, 7, , 8]);
335
- return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
345
+ return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
336
346
  case 6:
337
- brands = (_g.sent()).brands;
338
- leadResponse.brand_list = fixBrandList(brands, channels);
347
+ brand = (_g.sent()).brand;
348
+ leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
339
349
  return [3, 8];
340
350
  case 7:
341
- err_2 = _g.sent();
351
+ err_3 = _g.sent();
342
352
  return [3, 8];
343
353
  case 8:
354
+ _g.trys.push([8, 10, , 11]);
355
+ return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
356
+ case 9:
357
+ brands = (_g.sent()).brands;
358
+ leadResponse.brand_list = fixBrandList(brands, channels);
359
+ return [3, 11];
360
+ case 10:
361
+ err_4 = _g.sent();
362
+ return [3, 11];
363
+ case 11:
344
364
  (_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
345
365
  return [4, sleep(3000)];
346
- case 9:
366
+ case 12:
347
367
  _g.sent();
348
368
  phone = (leadResponse.contact || {}).phone;
349
369
  if (phone === null || phone === void 0 ? void 0 : phone.country_code)
@@ -351,25 +371,26 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
351
371
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
352
372
  thunkApi.dispatch(handleNextScreenStep());
353
373
  return [2, { authResponse: authResponse, leadResponse: leadResponse, countryCode: countryCode }];
354
- case 10: return [4, sleep(interval * 1000)];
355
- case 11:
374
+ case 13: return [4, sleep(interval * 1000)];
375
+ case 14:
356
376
  _g.sent();
357
- _g.label = 12;
358
- case 12:
377
+ _g.label = 15;
378
+ case 15:
359
379
  count++;
360
380
  return [3, 1];
361
- case 13: throw new Error('paci_verification_failed');
381
+ case 16: throw new Error('paci_verification_failed');
362
382
  }
363
383
  });
364
384
  }); });
365
385
  export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
366
- var _a, settings, connect, lead_id, phoneCountry, payload, leadResponse, brand;
386
+ var _a, settings, connect, lead_id, brandData, phoneCountry, payload, leadResponse;
367
387
  var _b, _c, _d, _e, _f;
368
388
  return __generator(this, function (_g) {
369
389
  switch (_g.label) {
370
390
  case 0:
371
391
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
372
392
  lead_id = (connect.data.otpData.responseBody || {}).lead_id;
393
+ brandData = (connect.data.brandData.responseBody || {}).brandData;
373
394
  phoneCountry = (_c = (_b = params.countryCode) === null || _b === void 0 ? void 0 : _b.idd_prefix) === null || _c === void 0 ? void 0 : _c.toString();
374
395
  payload = {
375
396
  id: lead_id || '',
@@ -382,19 +403,33 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
382
403
  return [4, API.leadService.updateLead(payload)];
383
404
  case 1:
384
405
  leadResponse = _g.sent();
385
- if (!leadResponse.brand) return [3, 3];
386
- return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
387
- case 2:
388
- brand = (_g.sent()).brand;
389
- leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
390
- _g.label = 3;
391
- case 3:
406
+ leadResponse.brand = __assign(__assign({}, leadResponse.brand), brandData);
392
407
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
393
408
  thunkApi.dispatch(handleNextScreenStep());
394
409
  return [2, { leadResponse: leadResponse, formData: params }];
395
410
  }
396
411
  });
397
412
  }); });
413
+ export var retrieveLead = createAsyncThunk('connect/retrieveLead', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
414
+ var settings, data, countryCode, phone;
415
+ var _a;
416
+ return __generator(this, function (_b) {
417
+ switch (_b.label) {
418
+ case 0:
419
+ settings = thunkApi.getState().settings;
420
+ return [4, API.leadService.retrieveLead(leadId)];
421
+ case 1:
422
+ data = (_b.sent()).data;
423
+ if ((_a = data.errors) === null || _a === void 0 ? void 0 : _a.length)
424
+ throw new Error(data.errors[0].description);
425
+ countryCode = settings.data.businessCountry;
426
+ phone = (data.contact || {}).phone;
427
+ if (phone === null || phone === void 0 ? void 0 : phone.country_code)
428
+ countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
429
+ return [2, { data: data, countryCode: countryCode }];
430
+ }
431
+ });
432
+ }); });
398
433
  export var retrieveSegmentDataList = createAsyncThunk('connectRetrieveSegmentDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
399
434
  var dataBody, _a, segmentLocation, segmentProfit, segmentTech;
400
435
  return __generator(this, function (_b) {
@@ -420,7 +455,7 @@ export var retrieveSegmentDataList = createAsyncThunk('connectRetrieveSegmentDat
420
455
  });
421
456
  }); });
422
457
  export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
423
- var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, brandLogoId, termAndConditionChecked, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, _b, segmentLocation, segmentProfit, segmentTech, err_3, teamSize, err_4, brandNameBody, payload, lead, brandReqBody, brand, _c, segmentLocation, segmentProfit, segmentTech, err_5, teamSize, err_6;
458
+ var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, brandLogoId, termAndConditionChecked, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, _b, segmentLocation, segmentProfit, segmentTech, err_5, teamSize, err_6, brandNameBody, payload, lead, brandReqBody, brand, _c, segmentLocation, segmentProfit, segmentTech, err_7, teamSize, err_8;
424
459
  var _d, _e, _f, _g, _h;
425
460
  return __generator(this, function (_j) {
426
461
  switch (_j.label) {
@@ -452,6 +487,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
452
487
  brand: {
453
488
  id: (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id) || ''
454
489
  },
490
+ terms_conditions_accepted: termAndConditionChecked,
455
491
  id: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.lead_id) || '',
456
492
  step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_BRAND
457
493
  };
@@ -480,7 +516,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
480
516
  brand_1.segment_tech_list = segmentTech;
481
517
  return [3, 7];
482
518
  case 6:
483
- err_3 = _j.sent();
519
+ err_5 = _j.sent();
484
520
  return [3, 7];
485
521
  case 7:
486
522
  _j.trys.push([7, 9, , 10]);
@@ -490,7 +526,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
490
526
  brand_1.team_size_list = teamSize.list;
491
527
  return [3, 10];
492
528
  case 9:
493
- err_4 = _j.sent();
529
+ err_6 = _j.sent();
494
530
  return [3, 10];
495
531
  case 10:
496
532
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
@@ -501,12 +537,12 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
501
537
  id: '',
502
538
  name: {
503
539
  en: brandName,
504
- ar: brandName,
505
- zh: brandName
540
+ ar: brandName
506
541
  }
507
542
  };
508
543
  payload = {
509
544
  brand: brandNameBody,
545
+ terms_conditions_accepted: termAndConditionChecked,
510
546
  id: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.lead_id) || '',
511
547
  step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_BRAND,
512
548
  encryption_contract: ['brand.name.en', 'brand.name.ar', 'brand.name.zh']
@@ -538,7 +574,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
538
574
  brand.segment_tech_list = segmentTech;
539
575
  return [3, 17];
540
576
  case 16:
541
- err_5 = _j.sent();
577
+ err_7 = _j.sent();
542
578
  return [3, 17];
543
579
  case 17:
544
580
  _j.trys.push([17, 19, , 20]);
@@ -548,7 +584,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
548
584
  brand.team_size_list = teamSize.list;
549
585
  return [3, 20];
550
586
  case 19:
551
- err_6 = _j.sent();
587
+ err_8 = _j.sent();
552
588
  return [3, 20];
553
589
  case 20:
554
590
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
@@ -811,13 +847,14 @@ export var connectSlice = createSlice({
811
847
  var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
812
848
  brandList = __spreadArray([], brand_list, true);
813
849
  if (!isBrandExist && brand)
814
- brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: [] })], false);
850
+ brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: (brand === null || brand === void 0 ? void 0 : brand.channel_services) || [] })], false);
815
851
  brandList = __spreadArray(__spreadArray([], brandList, true), [OTHER_BRAND], false);
816
852
  state.data.brandData.selectedBrandItem = brandList[0];
817
853
  }
818
854
  state.data.brandData.responseBody = {
819
855
  brand_list: brandList,
820
- channel_list: channel_list
856
+ channel_list: channel_list,
857
+ brandData: brand
821
858
  };
822
859
  state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, brand_id: brand === null || brand === void 0 ? void 0 : brand.id, name: name, contact: contact });
823
860
  })
@@ -853,13 +890,14 @@ export var connectSlice = createSlice({
853
890
  var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
854
891
  brandList = __spreadArray([], brand_list, true);
855
892
  if (!isBrandExist && brand)
856
- brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: [] })], false);
893
+ brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: (brand === null || brand === void 0 ? void 0 : brand.channel_services) || [] })], false);
857
894
  brandList = __spreadArray(__spreadArray([], brandList, true), [OTHER_BRAND], false);
858
895
  state.data.brandData.selectedBrandItem = brandList[0];
859
896
  }
860
897
  state.data.brandData.responseBody = {
861
898
  brand_list: brandList,
862
- channel_list: channel_list
899
+ channel_list: channel_list,
900
+ brandData: brand
863
901
  };
864
902
  state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, brand_id: brand === null || brand === void 0 ? void 0 : brand.id, name: name, contact: contact });
865
903
  })
@@ -904,7 +942,7 @@ export var connectSlice = createSlice({
904
942
  state.loading = false;
905
943
  state.error = null;
906
944
  var _d = action.payload, formData = _d.formData, leadResponse = _d.leadResponse;
907
- var brand = leadResponse.brand, rest = __rest(leadResponse, ["brand"]);
945
+ var brand = leadResponse.brand, terms_conditions_accepted = leadResponse.terms_conditions_accepted, rest = __rest(leadResponse, ["brand", "terms_conditions_accepted"]);
908
946
  if (brand) {
909
947
  var channel_services = brand.channel_services, terms = brand.terms;
910
948
  state.data.brandData.salesChannels = channel_services || [];
@@ -912,7 +950,7 @@ export var connectSlice = createSlice({
912
950
  var term = _a.term, agree = _a.agree;
913
951
  return term === 'general' && agree === true;
914
952
  });
915
- state.data.brandData.termAndConditionChecked = !!termAndCondition;
953
+ state.data.brandData.termAndConditionChecked = !!termAndCondition || terms_conditions_accepted;
916
954
  }
917
955
  var selectedBrand = ((_b = (_a = state.data.brandData) === null || _a === void 0 ? void 0 : _a.responseBody) === null || _b === void 0 ? void 0 : _b.brand_list[0]) || leadResponse.brand;
918
956
  state.data.brandData.brandName = (_c = selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.name) === null || _c === void 0 ? void 0 : _c.en;
@@ -1035,6 +1073,43 @@ export var connectSlice = createSlice({
1035
1073
  .addCase(updateLeadSuccess.rejected, function (state, action) {
1036
1074
  state.loading = false;
1037
1075
  state.error = action.error.message;
1076
+ })
1077
+ .addCase(retrieveLead.fulfilled, function (state, action) {
1078
+ var _a;
1079
+ state.customLoading = false;
1080
+ state.error = null;
1081
+ var _b = action.payload, data = _b.data, countryCode = _b.countryCode;
1082
+ var _c = data || {}, name = _c.name, contact = _c.contact, brand = _c.brand, identification = _c.identification, date_of_birth = _c.date_of_birth;
1083
+ var _d = contact || {}, email = _d.email, phone = _d.phone;
1084
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
1085
+ if (!!fullName) {
1086
+ var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
1087
+ state.data.individualData.name = capitalizedName;
1088
+ }
1089
+ if (email)
1090
+ state.data.individualData.email = email;
1091
+ if (phone === null || phone === void 0 ? void 0 : phone.number) {
1092
+ state.data.mobileData.mobile = phone.number;
1093
+ state.data.individualData.mobile = phone.number;
1094
+ }
1095
+ if (!!countryCode) {
1096
+ state.data.mobileData.countryCode = countryCode;
1097
+ state.data.individualData.countryCode = countryCode;
1098
+ }
1099
+ if ((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en)
1100
+ state.data.brandData.brandName = brand.name.en;
1101
+ if (identification === null || identification === void 0 ? void 0 : identification.id)
1102
+ state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
1103
+ if (date_of_birth)
1104
+ state.data.nidData.dob = date_of_birth;
1105
+ })
1106
+ .addCase(retrieveLead.pending, function (state) {
1107
+ state.customLoading = true;
1108
+ state.error = null;
1109
+ })
1110
+ .addCase(retrieveLead.rejected, function (state, action) {
1111
+ state.customLoading = false;
1112
+ state.error = action.error.message;
1038
1113
  });
1039
1114
  }
1040
1115
  });
@@ -699,8 +699,7 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
699
699
  brandNameBody = {
700
700
  name: {
701
701
  en: brandName,
702
- ar: brandName,
703
- zh: brandName
702
+ ar: brandName
704
703
  }
705
704
  };
706
705
  payload = {
@@ -396,7 +396,7 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
396
396
  return ({ id: id, action: 'add' });
397
397
  });
398
398
  payload = __assign({ id: id, activities: isActivitiesNonEditable || (activityIds === null || activityIds === void 0 ? void 0 : activityIds.length) === 0 ? undefined : activityIds }, (!isCapitalNonEditable && {
399
- capital: __assign({ paid: isCapitalPaidNonEditable ? undefined : removeAllCharsFromNumber(capitalPaid) }, (!((isCapitalShareCountNonEditable && isCapitalShareValueNonEditable) || !hasCapitalShares) && {
399
+ capital: __assign({ paid: isCapitalPaidNonEditable || !capitalPaid ? undefined : removeAllCharsFromNumber(capitalPaid) }, (!((isCapitalShareCountNonEditable && isCapitalShareValueNonEditable) || !hasCapitalShares) && {
400
400
  shares: {
401
401
  count: isCapitalShareCountNonEditable ? undefined : capitalShareCount,
402
402
  value: isCapitalShareValueNonEditable ? undefined : removeAllCharsFromNumber(capitalShareValue)
@@ -1,20 +1,20 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const BrandActivitiesValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
3
  activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
4
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
4
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
5
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
6
6
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
8
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
9
9
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
10
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
10
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
11
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
12
12
  }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
13
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
14
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
15
15
  }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
16
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
16
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
17
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
18
18
  }>>[] | undefined>;
19
19
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
20
20
  expectedCustomers: any;
@@ -24,20 +24,20 @@ export declare const BrandActivitiesValidationSchema: () => yup.ObjectSchema<imp
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
26
  activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
27
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
28
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
27
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
28
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
29
29
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
30
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
31
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
30
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
31
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
32
32
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
33
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
34
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
33
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
34
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
35
35
  }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
36
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
37
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
36
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
37
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
38
38
  }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
39
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
40
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
39
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
40
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
41
41
  }>>[] | undefined>;
42
42
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
43
43
  expectedCustomers: any;
@@ -47,20 +47,20 @@ export declare const BrandActivitiesValidationSchema: () => yup.ObjectSchema<imp
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
49
  activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
50
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
51
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
50
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
51
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
52
52
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
53
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
54
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
53
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
54
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
55
55
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
56
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
57
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
56
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
57
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
58
58
  }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
59
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
60
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
59
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
60
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
61
61
  }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
62
- ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
63
- en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
62
+ ar: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
63
+ en: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
64
64
  }>>[] | undefined>;
65
65
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
66
66
  expectedCustomers: any;
@@ -10,8 +10,8 @@ export var BrandActivitiesValidationSchema = function () {
10
10
  .array()
11
11
  .min(1, 'activities_list_alert')
12
12
  .of(yup.object().shape({
13
- ar: yup.string(),
14
- en: yup.string()
13
+ ar: yup.string().nullable(),
14
+ en: yup.string().nullable()
15
15
  })),
16
16
  customerLocations: yup.array().required('please_choose_base'),
17
17
  expectedCustomers: yup.object().shape(objectElements).required('select_expected_customers_serve'),
@@ -12,12 +12,12 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import { useController, useFormContext } from 'react-hook-form';
15
- import DatePicker from '../../../../components/DatePicker';
16
15
  import Text from '../../../../components/Text';
17
16
  import { ScreenContainer } from '../../../shared/Containers';
18
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
18
  import { businessSelector, clearError } from '../../../app/business/businessStore';
20
19
  import { alpha, styled } from '@mui/material/styles';
20
+ import Calender from '../../../shared/Calender';
21
21
  export var InputLabelStyled = styled(Text)(function (_a) {
22
22
  var theme = _a.theme;
23
23
  return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption));
@@ -40,6 +40,6 @@ var OperationStartDate = function (_a) {
40
40
  oDateControl.field.onChange(data);
41
41
  };
42
42
  var dateValue = (_b = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _b === void 0 ? void 0 : _b.value;
43
- return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('business_start_date'), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : undefined, dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleOperationStartDateChange })] }));
43
+ return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('business_start_date'), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Calender, { defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleOperationStartDateChange })] }));
44
44
  };
45
45
  export default OperationStartDate;