@tap-payments/auth-jsconnect 2.10.13-development → 2.10.14-development

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.
@@ -47,9 +47,9 @@ export declare type UpdateLeadBody = {
47
47
  id: string;
48
48
  encryption_contract?: Array<string>;
49
49
  entity?: {
50
- id?: string;
51
- unified_number?: string;
50
+ id: string;
52
51
  };
52
+ unified_number?: string;
53
53
  name?: Name;
54
54
  contact?: Contact;
55
55
  send_invite?: boolean;
@@ -672,6 +672,10 @@
672
672
  "yes": "نعم",
673
673
  "your_brand_details": "تفاصيل علامتك التجارية",
674
674
  "يرجى التحقق من اسم تطبيق ابل": "",
675
+ "v1_company_unified_number_label": "Company unified number",
676
+ "v1_company_unified_number_hint": "700xxxxxxx",
677
+ "v1_add_unified_number": "Add a Unified Number",
678
+ "v1_company_unified_number_description": "You can find your Company Unified Number in the top-left corner of your Company Registration Certificate.",
675
679
  "passcode_title": "الرجاء إدخال رمز المرور الخاص بك",
676
680
  "sign_in_with_otp": "تسجيل الدخول باستخدام رمز التحقق (OTP)",
677
681
  "passcode_required": "الرجاء إدخال رمز المرور المطلوب",
@@ -701,6 +701,7 @@
701
701
  "your_brand_details": "Your brand details",
702
702
  "v1_company_unified_number_label": "Company unified number",
703
703
  "v1_company_unified_number_hint": "700xxxxxxx",
704
+ "v1_add_unified_number": "Add a Unified Number",
704
705
  "v1_company_unified_number_description": "You can find your Company Unified Number in the top-left corner of your Company Registration Certificate.",
705
706
  "passcode_title": "Please enter your passcode",
706
707
  "sign_in_with_otp": "Sign in with OTP",
@@ -663,9 +663,8 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
663
663
  _b = business.data.verify.responseBody || {}, lead_id = _b.lead_id, brand = _b.brand;
664
664
  stepName = 'BUSINESS_ACTIVITIES_STEP';
665
665
  payload = __assign(__assign(__assign(__assign({ id: lead_id || '', entity: {
666
- id: (selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && (isKWCountry ? !isFL : true) ? selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id : '',
667
- unified_number: unifiedNumber
668
- } }, (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
666
+ id: (selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && (isKWCountry ? !isFL : true) ? selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id : ''
667
+ }, unified_number: unifiedNumber }, (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
669
668
  license_number: isKWCountry && isFL ? '' : licenseNumber,
670
669
  license_type: isFL ? LicenseType.FL : LicenseType.CR,
671
670
  business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type
@@ -1154,9 +1154,7 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
1154
1154
  license_type: (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) ? (isFL ? LicenseType.FL : LicenseType.CR) : undefined,
1155
1155
  business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type,
1156
1156
  is_acknowledged: true,
1157
- entity: {
1158
- unified_number: unifiedNumber
1159
- },
1157
+ unified_number: unifiedNumber,
1160
1158
  terms_conditions_accepted: !isLeadIdPassed ? termAndConditionChecked : undefined,
1161
1159
  step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_BRAND_BUSINESS,
1162
1160
  encryption_contract: []
@@ -36,7 +36,7 @@ import { businessSelector, clearError } from '../../../app/business/businessStor
36
36
  import Text from '../../../../components/Text';
37
37
  import ExpandIcon from '../../../../components/ExpandIcon';
38
38
  import Collapse from '../../../../components/Collapse';
39
- import { isKW, isOtherLicense } from '../../../../utils';
39
+ import { isKW, isOtherLicense, isSA } from '../../../../utils';
40
40
  import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
41
41
  import { settingsSelector } from '../../../../app/settings';
42
42
  var InputStyled = styled(InputSelect)(function (_a) {
@@ -104,6 +104,8 @@ var LicenseList = function (_a) {
104
104
  };
105
105
  var getLicenseName = function (item) {
106
106
  var _a, _b;
107
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isOtherLicense(item) && isSA(country_code))
108
+ return t('v1_add_unified_number');
107
109
  if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
108
110
  return t('future_work');
109
111
  return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
@@ -116,6 +118,7 @@ var LicenseList = function (_a) {
116
118
  setValue('licenseNumber', '', { shouldValidate: true });
117
119
  else
118
120
  setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
121
+ setValue('unifiedNumber', '', { shouldValidate: true });
119
122
  onCloseLicenseList();
120
123
  };
121
124
  var getLicenseFullName = function (item) {
@@ -110,6 +110,8 @@ var LicenseList = function (_a) {
110
110
  };
111
111
  var getLicenseName = function (item) {
112
112
  var _a, _b;
113
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isOtherLicense(item) && isSACountry)
114
+ return t('v1_add_unified_number');
113
115
  if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
114
116
  return t('future_work');
115
117
  return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
@@ -122,6 +124,7 @@ var LicenseList = function (_a) {
122
124
  setValue('licenseNumber', '', { shouldValidate: true });
123
125
  else
124
126
  setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
127
+ setValue('unifiedNumber', '', { shouldValidate: true });
125
128
  onCloseLicenseList();
126
129
  };
127
130
  var getLicenseFullName = function (item) {
@@ -155,7 +155,7 @@ export var BusinessDataSchema = function (isLeadIdPassed) {
155
155
  if (length === 0)
156
156
  return true;
157
157
  if (isCR) {
158
- return length >= 2 ? true : this.createError({ message: '' });
158
+ return length >= UNIFIED_NUMBER_MIN_LENGTH ? true : this.createError({ message: 'unified_number_required' });
159
159
  }
160
160
  return true;
161
161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.13-development",
3
+ "version": "2.10.14-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",