@tap-payments/auth-jsconnect 1.0.45 → 1.0.48

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 (53) hide show
  1. package/build/@types/app.d.ts +8 -1
  2. package/build/@types/form.d.ts +2 -1
  3. package/build/@types/redux.d.ts +0 -1
  4. package/build/api/auth.d.ts +0 -2
  5. package/build/api/entity.d.ts +2 -1
  6. package/build/api/entity.js +5 -1
  7. package/build/api/index.d.ts +1 -0
  8. package/build/api/lead.d.ts +3 -2
  9. package/build/assets/locales/ar.json +3 -1
  10. package/build/assets/locales/en.json +3 -1
  11. package/build/components/Footer/Footer.js +5 -5
  12. package/build/constants/app.d.ts +2 -0
  13. package/build/constants/app.js +4 -2
  14. package/build/constants/dummy.d.ts +14 -0
  15. package/build/constants/dummy.js +29 -0
  16. package/build/constants/validation.d.ts +1 -0
  17. package/build/constants/validation.js +1 -0
  18. package/build/features/app/business/businessStore.d.ts +3 -3
  19. package/build/features/app/business/businessStore.js +52 -58
  20. package/build/features/app/connect/connectStore.d.ts +35 -13
  21. package/build/features/app/connect/connectStore.js +163 -186
  22. package/build/features/bank/Bank.js +1 -1
  23. package/build/features/business/Business.js +2 -15
  24. package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
  25. package/build/features/business/screens/Customers/ExpectedCustomers.js +2 -2
  26. package/build/features/business/screens/Customers/ExpectedSalesRange.js +1 -1
  27. package/build/features/connect/screens/Individual/Email.d.ts +3 -1
  28. package/build/features/connect/screens/Individual/Email.js +53 -5
  29. package/build/features/connect/screens/Individual/Individual.js +13 -9
  30. package/build/features/connect/screens/Individual/validation.d.ts +1 -1
  31. package/build/features/connect/screens/Individual/validation.js +7 -3
  32. package/build/features/connect/screens/Merchant/BrandList.d.ts +12 -0
  33. package/build/features/connect/screens/Merchant/BrandList.js +118 -0
  34. package/build/features/connect/screens/Merchant/BrandName.d.ts +4 -1
  35. package/build/features/connect/screens/Merchant/BrandName.js +56 -5
  36. package/build/features/connect/screens/Merchant/Merchant.js +14 -7
  37. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +4 -1
  38. package/build/features/connect/screens/Merchant/SocialMedia.js +4 -3
  39. package/build/features/connect/screens/Merchant/TAC.d.ts +2 -1
  40. package/build/features/connect/screens/Merchant/TAC.js +2 -1
  41. package/build/features/connect/screens/Merchant/validation.d.ts +4 -4
  42. package/build/features/connect/screens/Merchant/validation.js +60 -56
  43. package/build/features/connect/screens/Mobile/Mobile.js +6 -1
  44. package/build/features/connect/screens/Mobile/validation.d.ts +1 -1
  45. package/build/features/connect/screens/Mobile/validation.js +7 -2
  46. package/build/features/connect/screens/Password/Password.js +5 -3
  47. package/build/features/individual/Individual.js +1 -1
  48. package/build/features/password/Password.js +1 -1
  49. package/build/features/shared/Button/Button.js +1 -1
  50. package/build/features/tax/Tax.js +2 -2
  51. package/package.json +1 -1
  52. package/build/hooks/useElementSizeById.d.ts +0 -6
  53. package/build/hooks/useElementSizeById.js +0 -12
@@ -46,7 +46,7 @@ export declare enum SocialMediaTypes {
46
46
  TWITTER = "twitter"
47
47
  }
48
48
  export interface CustomerLocation {
49
- id: number;
49
+ id: string;
50
50
  value: string;
51
51
  titleAr: string;
52
52
  title: string;
@@ -153,4 +153,11 @@ export interface LocalProps {
153
153
  };
154
154
  };
155
155
  }
156
+ export declare type BrandInfo = {
157
+ id: string;
158
+ name: {
159
+ ar: string;
160
+ en: string;
161
+ };
162
+ };
156
163
  export {};
@@ -1,4 +1,4 @@
1
- import { Activity, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, SalesChannel } from './app';
1
+ import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, SalesChannel } from './app';
2
2
  export declare type MobileFormValues = {
3
3
  mobile: string | null;
4
4
  countryCode: CountryCode;
@@ -27,6 +27,7 @@ export declare type BrandFormValues = {
27
27
  instagram: string;
28
28
  };
29
29
  termAndConditionChecked: boolean;
30
+ brandList?: Array<BrandInfo>;
30
31
  };
31
32
  export declare type BusinessTypeFormValues = {
32
33
  businessType: string;
@@ -2,7 +2,6 @@ export interface SharedState<T> {
2
2
  error: string | null;
3
3
  loading: boolean;
4
4
  data: T;
5
- searchActive?: boolean;
6
5
  }
7
6
  export interface ActionState<T> {
8
7
  type: string;
@@ -1,5 +1,4 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
- import { DeviceInfo } from '../@types';
3
2
  export declare type MobileCredential = {
4
3
  code: string;
5
4
  phone: string;
@@ -15,7 +14,6 @@ export declare type IDCredential = {
15
14
  };
16
15
  export declare type CreateAuthBody = {
17
16
  user_credentail: MobileCredential | EmailCredential | IDCredential;
18
- device_info: DeviceInfo;
19
17
  sign_in: boolean;
20
18
  step_name: string;
21
19
  encryption_contract: Array<string>;
@@ -5,7 +5,7 @@ export declare type EntityInfoUpdateBody = {
5
5
  channel_services?: Array<string>;
6
6
  physical_store_available?: boolean;
7
7
  yearly_sales_range?: string;
8
- customers_served_monthly?: string;
8
+ customers_served_monthly?: number;
9
9
  customers_base?: Array<string>;
10
10
  vat_id?: string;
11
11
  agree_chargeback?: boolean;
@@ -14,6 +14,7 @@ export declare type EntityInfoUpdateBody = {
14
14
  encryption_contract?: Array<string>;
15
15
  };
16
16
  declare const entityService: {
17
+ createEntityInfo: (data: EntityInfoUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
17
18
  updateEntityInfo: (data: EntityInfoUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
18
19
  };
19
20
  export { entityService };
@@ -1,9 +1,13 @@
1
1
  import { ENDPOINT_PATHS } from '../constants';
2
2
  import instance from './axios';
3
- var updateEntityInfo = function (data, config) {
3
+ var createEntityInfo = function (data, config) {
4
4
  return instance.post("".concat(ENDPOINT_PATHS.ENTITY), data, config);
5
5
  };
6
+ var updateEntityInfo = function (data, config) {
7
+ return instance.put("".concat(ENDPOINT_PATHS.ENTITY), data, config);
8
+ };
6
9
  var entityService = {
10
+ createEntityInfo: createEntityInfo,
7
11
  updateEntityInfo: updateEntityInfo
8
12
  };
9
13
  export { entityService };
@@ -30,6 +30,7 @@ declare const API: {
30
30
  retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
31
31
  };
32
32
  entityService: {
33
+ createEntityInfo: (data: EntityInfoUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
33
34
  updateEntityInfo: (data: EntityInfoUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
34
35
  };
35
36
  availabilityServices: {
@@ -35,6 +35,7 @@ declare type BrandInfo = {
35
35
  };
36
36
  export declare type UpdateLeadBody = {
37
37
  step_name?: string;
38
+ lead_id: string;
38
39
  encryption_contract?: Array<string>;
39
40
  name?: Name;
40
41
  contact?: Contact;
@@ -51,8 +52,8 @@ export declare type UpdateLeadBody = {
51
52
  business_id?: string;
52
53
  segment_id?: string;
53
54
  };
54
- freelancer_number?: string;
55
- cr_number?: string;
55
+ license_number?: string;
56
+ license_type?: string;
56
57
  is_acknowledged?: boolean;
57
58
  terms_conditions_accepted?: boolean;
58
59
  email_url?: string;
@@ -211,5 +211,7 @@
211
211
  "or": "أو",
212
212
  "next": "التالي",
213
213
  "open_mail_box": "افتح البريد الإلكتروني",
214
- "mobile_button_label": "المتابعة عن طريق رقم الجوال"
214
+ "mobile_button_label": "المتابعة عن طريق رقم الجوال",
215
+ "select_brand_label": "Brand List",
216
+ "choose_brand": "Choose Brand"
215
217
  }
@@ -225,5 +225,7 @@
225
225
  "mobile_button_label": "Continue with Mobile Number",
226
226
  "or": "Or",
227
227
  "next": "next",
228
- "open_mail_box": "Open Mailbox"
228
+ "open_mail_box": "Open Mailbox",
229
+ "select_brand_label": "Brand List",
230
+ "choose_brand": "Choose Brand"
229
231
  }
@@ -35,14 +35,14 @@ var FollowUsStyled = styled(Text)(function (_a) {
35
35
  var theme = _a.theme;
36
36
  return (__assign({}, theme.typography.caption));
37
37
  });
38
- var LanguageTextStyled = styled(Text)(function (_a) {
39
- var theme = _a.theme;
40
- return (__assign(__assign({}, theme.typography.caption), { paddingInlineStart: theme.spacing(0.625), cursor: 'pointer' }));
38
+ var LanguageTextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
39
+ var theme = _a.theme, isAr = _a.isAr;
40
+ return (__assign(__assign({}, theme.typography.caption), { paddingInlineStart: theme.spacing(0.625), cursor: 'pointer', paddingBlockStart: theme.spacing(isAr ? 0 : 0.25) }));
41
41
  });
42
42
  var TextStyled = styled(Text)(function (_a) {
43
43
  var theme = _a.theme;
44
44
  return ({
45
- marginInline: theme.spacing(0.2)
45
+ marginInline: theme.spacing(0.625)
46
46
  });
47
47
  });
48
48
  var IconStyled = styled(Icon)(function (_a) {
@@ -54,7 +54,7 @@ var IconStyled = styled(Icon)(function (_a) {
54
54
  var FooterComponent = function (_a) {
55
55
  var language = _a.language, countryName = _a.countryName, countryFlag = _a.countryFlag, onSwitchLanguage = _a.onSwitchLanguage, rest = __rest(_a, ["language", "countryName", "countryFlag", "onSwitchLanguage"]);
56
56
  var isAr = useLanguage().isAr;
57
- return (_jsxs(FooterStyled, __assign({}, rest, { children: [_jsx(IconStyled, { src: countryFlag }), _jsxs(TextStyled, { children: [" ", countryName, " "] }), _jsx(TextStyled, { children: " | " }), _jsxs(LanguageTextStyled, __assign({ onClick: onSwitchLanguage }, { children: [language, " "] }))] })));
57
+ return (_jsxs(FooterStyled, __assign({}, rest, { children: [_jsx(IconStyled, { src: countryFlag }), _jsxs(TextStyled, { children: [" ", countryName, " "] }), _jsx(TextStyled, { children: " | " }), _jsx(LanguageTextStyled, __assign({ isAr: isAr, onClick: onSwitchLanguage }, { children: language }))] })));
58
58
  };
59
59
  FooterComponent.defaultProps = {
60
60
  followUsTitle: 'follow_us',
@@ -92,3 +92,5 @@ export declare const BUSINESS_STEP_NAMES: {
92
92
  export declare const RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
93
93
  export declare const ENCRYPTION_FLAG = "encryption_contract";
94
94
  export declare const BACKEND_ENCRYPTION_FLAG = "backend_encryption_contract";
95
+ export declare const INSTAGRAM_URL = "https://www.instagram.com";
96
+ export declare const TWITTER_URL = "https://twitter.com";
@@ -26,7 +26,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
26
26
  },
27
27
  {
28
28
  name: 'CONNECT_OTP_STEP',
29
- next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_PASSWORD_STEP'],
29
+ next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_MERCHANT_INFO_STEP'],
30
30
  prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP'],
31
31
  order: 2
32
32
  },
@@ -45,7 +45,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
45
45
  {
46
46
  name: 'CONNECT_MERCHANT_INFO_STEP',
47
47
  next: 'CONNECT_THANK_YOU_STEP',
48
- prev: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_PASSWORD_STEP'],
48
+ prev: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_NID_STEP', 'CONNECT_MOBILE_STEP'],
49
49
  order: 4
50
50
  },
51
51
  {
@@ -241,3 +241,5 @@ export var BUSINESS_STEP_NAMES = {
241
241
  export var RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
242
242
  export var ENCRYPTION_FLAG = 'encryption_contract';
243
243
  export var BACKEND_ENCRYPTION_FLAG = 'backend_encryption_contract';
244
+ export var INSTAGRAM_URL = 'https://www.instagram.com';
245
+ export var TWITTER_URL = 'https://twitter.com';
@@ -7,6 +7,13 @@ export declare const OTHER_LICENSE: {
7
7
  number: string;
8
8
  };
9
9
  };
10
+ export declare const OTHER_BRAND: {
11
+ id: string;
12
+ name: {
13
+ ar: string;
14
+ en: string;
15
+ };
16
+ };
10
17
  export declare const defaultCountry: {
11
18
  created: number;
12
19
  updated: number;
@@ -319,3 +326,10 @@ export declare const SOURCE_OF_INCOME: {
319
326
  titleAr: string;
320
327
  title: string;
321
328
  }[];
329
+ export declare const BRAND_LIST: {
330
+ id: string;
331
+ name: {
332
+ ar: string;
333
+ en: string;
334
+ };
335
+ }[];
@@ -7,6 +7,13 @@ export var OTHER_LICENSE = {
7
7
  number: 'other'
8
8
  }
9
9
  };
10
+ export var OTHER_BRAND = {
11
+ id: 'other',
12
+ name: {
13
+ ar: 'other',
14
+ en: 'other'
15
+ }
16
+ };
10
17
  export var defaultCountry = {
11
18
  created: 1577690965000,
12
19
  updated: 1577691209000,
@@ -6408,3 +6415,25 @@ export var SOURCE_OF_INCOME = [
6408
6415
  { id: 5, titleAr: 'تجارة', title: 'Trading' },
6409
6416
  { id: 6, titleAr: 'غير ذلك', title: 'Other' }
6410
6417
  ];
6418
+ export var BRAND_LIST = [
6419
+ {
6420
+ id: '477222',
6421
+ name: { ar: 'brand test user1', en: 'brand test user1' }
6422
+ },
6423
+ {
6424
+ id: '477223',
6425
+ name: { ar: 'brand test user2', en: 'brand test user2' }
6426
+ },
6427
+ {
6428
+ id: '477224',
6429
+ name: { ar: 'brand test user3', en: 'brand test user' }
6430
+ },
6431
+ {
6432
+ id: '477225',
6433
+ name: { ar: 'brand test user4', en: 'brand test user4' }
6434
+ },
6435
+ {
6436
+ id: '477226',
6437
+ name: { ar: 'brand test user5', en: 'brand test user5' }
6438
+ }
6439
+ ];
@@ -7,3 +7,4 @@ export declare const CR_NUMBER_LENGTH = 10;
7
7
  export declare const SAUDI_NUMBER_LENGTH = 9;
8
8
  export declare const REGEX_FULL_NAME: RegExp;
9
9
  export declare const REGEX_WEBSITE: RegExp;
10
+ export declare const REGEX_SAUDI_NUMBER: RegExp;
@@ -7,3 +7,4 @@ export var CR_NUMBER_LENGTH = 10;
7
7
  export var SAUDI_NUMBER_LENGTH = 9;
8
8
  export var REGEX_FULL_NAME = /^([a-zA-Z]{2,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,})$/g;
9
9
  export var REGEX_WEBSITE = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,63}(:[0-9]{1,5})?(\/.*)?$/;
10
+ export var REGEX_SAUDI_NUMBER = /^(05|5)([0-9]{1,})$/g;
@@ -47,9 +47,9 @@ export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk
47
47
  };
48
48
  }, ActivitiesFormValues, {}>;
49
49
  export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
50
- customerBasesData: any;
51
- expectedSalesData: any;
52
- expectedCustomerSalesData: any;
50
+ customerBases: any;
51
+ expectedSales: any;
52
+ expectedCustomerSales: any;
53
53
  }, void, {}>;
54
54
  export declare const updateCustomersInfo: import("@reduxjs/toolkit").AsyncThunk<{
55
55
  data: any;
@@ -189,29 +189,26 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
189
189
  });
190
190
  }); });
191
191
  export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
192
- var _a, settings, business, headers, payload, data;
193
- var _b, _c, _d, _e, _f;
194
- return __generator(this, function (_g) {
195
- switch (_g.label) {
192
+ var _a, settings, business, payload, data;
193
+ var _b, _c, _d;
194
+ return __generator(this, function (_e) {
195
+ switch (_e.label) {
196
196
  case 0:
197
197
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
198
- headers = {
199
- lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
200
- device_identifier: (_d = (_c = settings.data.deviceInfo) === null || _c === void 0 ? void 0 : _c.browser) === null || _d === void 0 ? void 0 : _d.browser_id
201
- };
202
198
  payload = {
203
- freelancer_number: params.flNumber,
199
+ lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
200
+ license_number: params.businessType === BusinessType.FL ? params.flNumber : params.crNumber,
201
+ license_type: params.businessType === BusinessType.FL ? 'freelance' : 'commercial_registration',
204
202
  business_type: params.businessType,
205
- cr_number: params.crNumber,
206
203
  step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO,
207
- encryption_contract: ['freelancer_number', 'business_type', 'cr_number']
204
+ encryption_contract: ['license_number', 'business_type', 'license_type']
208
205
  };
209
- return [4, API.leadService.updateLead(payload, { headers: headers })];
206
+ return [4, API.leadService.updateLead(payload)];
210
207
  case 1:
211
- data = (_g.sent()).data;
208
+ data = (_e.sent()).data;
212
209
  if (!data.errors) {
213
210
  thunkApi.dispatch(handleNextScreenStep());
214
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
211
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
215
212
  }
216
213
  return [2, { data: data, formData: params }];
217
214
  }
@@ -271,7 +268,7 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
271
268
  step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES
272
269
  };
273
270
  headers = { entity_id: (_c = business.data.businessInfo.responseBody) === null || _c === void 0 ? void 0 : _c.entity_id };
274
- return [4, API.entityService.updateEntityInfo(requestBody, { headers: headers })];
271
+ return [4, API.entityService.createEntityInfo(requestBody, { headers: headers })];
275
272
  case 1:
276
273
  data = (_f.sent()).data;
277
274
  if (!data.errors) {
@@ -297,9 +294,9 @@ export var retrieveDataList = createAsyncThunk('retrieveDataList', function () {
297
294
  case 3:
298
295
  expectedCustomerSales = _a.sent();
299
296
  return [2, {
300
- customerBasesData: customerBases === null || customerBases === void 0 ? void 0 : customerBases.data,
301
- expectedSalesData: expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.data,
302
- expectedCustomerSalesData: expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.data
297
+ customerBases: customerBases === null || customerBases === void 0 ? void 0 : customerBases.data,
298
+ expectedSales: expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.data,
299
+ expectedCustomerSales: expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.data
303
300
  }];
304
301
  }
305
302
  });
@@ -312,18 +309,18 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
312
309
  case 0:
313
310
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
314
311
  customerBase = params.customerLocations.map(function (_a) {
315
- var value = _a.value;
316
- return value;
312
+ var title = _a.title;
313
+ return title;
317
314
  });
318
315
  requestBody = {
319
316
  customers_base: customerBase,
320
- customers_served_monthly: ((_b = params.expectedCustomers) === null || _b === void 0 ? void 0 : _b.value) || '',
321
- yearly_sales_range: ((_c = params.expectedCustomers) === null || _c === void 0 ? void 0 : _c.value) || '',
317
+ customers_served_monthly: parseInt(((_b = params.expectedCustomers) === null || _b === void 0 ? void 0 : _b.id) || '0'),
318
+ yearly_sales_range: ((_c = params.expectedSalesRange) === null || _c === void 0 ? void 0 : _c.title) || '',
322
319
  agree_refund: params.refundPolicy,
323
320
  agree_chargeback: params.transactionPolicy,
324
321
  step_name: BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS
325
322
  };
326
- headers = { entity_id: (_d = business.data.otpData.responseBody) === null || _d === void 0 ? void 0 : _d.id };
323
+ headers = { entity_id: (_d = business.data.activitiesData.responseBody) === null || _d === void 0 ? void 0 : _d.entity_id };
327
324
  return [4, API.entityService.updateEntityInfo(requestBody, { headers: headers })];
328
325
  case 1:
329
326
  data = (_g.sent()).data;
@@ -336,25 +333,22 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
336
333
  });
337
334
  }); });
338
335
  export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
339
- var _a, settings, business, headers, payload, data;
340
- var _b, _c, _d, _e, _f, _g, _h;
341
- return __generator(this, function (_j) {
342
- switch (_j.label) {
336
+ var _a, settings, business, payload, data;
337
+ var _b, _c, _d, _e, _f;
338
+ return __generator(this, function (_g) {
339
+ switch (_g.label) {
343
340
  case 0:
344
341
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
345
- headers = {
346
- lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
347
- device_identifier: (_d = (_c = settings.data.deviceInfo) === null || _c === void 0 ? void 0 : _c.browser) === null || _d === void 0 ? void 0 : _d.browser_id
348
- };
349
342
  payload = {
350
343
  step_name: BUSINESS_STEP_NAMES.BUSINESS_SUCCESS,
344
+ lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
351
345
  encryption_contract: []
352
346
  };
353
- return [4, API.leadService.updateLead(payload, { headers: headers })];
347
+ return [4, API.leadService.updateLead(payload)];
354
348
  case 1:
355
- data = (_j.sent()).data;
356
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
357
- (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
349
+ data = (_g.sent()).data;
350
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
351
+ (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
358
352
  return [2, { response: data, formData: params }];
359
353
  }
360
354
  });
@@ -378,7 +372,7 @@ var initialState = {
378
372
  type: ''
379
373
  },
380
374
  businessTypeData: {
381
- businessType: '',
375
+ businessType: BusinessType.FL,
382
376
  flNumber: '',
383
377
  crNumber: ''
384
378
  },
@@ -507,11 +501,12 @@ export var businessSlice = createSlice({
507
501
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
508
502
  if (!description) {
509
503
  var fl = data.fl, cr = data.cr;
510
- if (Array.isArray(cr)) {
504
+ if (Array.isArray(cr) && cr.length > 0) {
511
505
  state.data.crInfos = cr;
512
506
  state.data.businessTypeData.businessType = BusinessType.CR;
507
+ return;
513
508
  }
514
- if (Array.isArray(fl)) {
509
+ if (Array.isArray(fl) && fl.length > 0) {
515
510
  state.data.flInfos = fl;
516
511
  state.data.businessTypeData.businessType = BusinessType.FL;
517
512
  }
@@ -526,33 +521,35 @@ export var businessSlice = createSlice({
526
521
  state.error = null;
527
522
  })
528
523
  .addCase(updateLeadBusinessType.fulfilled, function (state, action) {
529
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
524
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
530
525
  state.loading = false;
531
526
  state.error = null;
532
- var _m = action.payload, data = _m.data, formData = _m.formData;
527
+ var _v = action.payload, data = _v.data, formData = _v.formData;
533
528
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
534
529
  if (description) {
535
530
  state.error = description;
536
531
  return;
537
532
  }
538
533
  state.data.businessTypeData = formData;
539
- state.data.businessInfo.brandName = i18n.dir() === 'rtl' ? (_c = (_b = data === null || data === void 0 ? void 0 : data.brand) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.ar : (_e = (_d = data === null || data === void 0 ? void 0 : data.brand) === null || _d === void 0 ? void 0 : _d.name) === null || _e === void 0 ? void 0 : _e.en;
540
- state.data.businessInfo.licenseNumber = data === null || data === void 0 ? void 0 : data.freelancer_number;
534
+ var isAr = i18n.dir() === 'rtl';
535
+ state.data.businessInfo.brandName = isAr ? (_c = (_b = data === null || data === void 0 ? void 0 : data.brand) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.ar : (_e = (_d = data === null || data === void 0 ? void 0 : data.brand) === null || _d === void 0 ? void 0 : _d.name) === null || _e === void 0 ? void 0 : _e.en;
536
+ state.data.businessInfo.licenseNumber = (_g = (_f = data === null || data === void 0 ? void 0 : data.entity) === null || _f === void 0 ? void 0 : _f.license) === null || _g === void 0 ? void 0 : _g.number;
537
+ state.data.businessInfo.legalName = isAr ? (_j = (_h = data === null || data === void 0 ? void 0 : data.entity) === null || _h === void 0 ? void 0 : _h.legal_name) === null || _j === void 0 ? void 0 : _j.ar : (_l = (_k = data === null || data === void 0 ? void 0 : data.entity) === null || _k === void 0 ? void 0 : _k.legal_name) === null || _l === void 0 ? void 0 : _l.en;
538
+ if (!!((_o = (_m = data === null || data === void 0 ? void 0 : data.entity) === null || _m === void 0 ? void 0 : _m.license) === null || _o === void 0 ? void 0 : _o.issuing_date)) {
539
+ state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_q = (_p = data === null || data === void 0 ? void 0 : data.entity) === null || _p === void 0 ? void 0 : _p.license) === null || _q === void 0 ? void 0 : _q.issuing_date).format('YYYY-MM-DD'));
540
+ }
541
541
  if (formData.businessType === BusinessType.CR) {
542
- state.data.businessInfo.licenseNumber = data === null || data === void 0 ? void 0 : data.cr_number;
543
- state.data.businessInfo.legalName = (_f = data === null || data === void 0 ? void 0 : data.license) === null || _f === void 0 ? void 0 : _f.crName;
544
- state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_g = data === null || data === void 0 ? void 0 : data.license) === null || _g === void 0 ? void 0 : _g.issueDate, 'iYYYY/iMM/iDD').format('YYYY-MM-DD'));
545
- var activities = (_j = (_h = data === null || data === void 0 ? void 0 : data.license) === null || _h === void 0 ? void 0 : _h.activities) === null || _j === void 0 ? void 0 : _j.isic;
542
+ var activities = ((_s = (_r = data === null || data === void 0 ? void 0 : data.license) === null || _r === void 0 ? void 0 : _r.activities) === null || _s === void 0 ? void 0 : _s.isic) || [];
546
543
  var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
547
544
  if (!!selectedActivity)
548
545
  state.data.activitiesData.activities = [selectedActivity];
549
- state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: activities || [] });
546
+ state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: activities });
550
547
  return;
551
548
  }
552
- var category = (_l = (_k = data === null || data === void 0 ? void 0 : data.license) === null || _k === void 0 ? void 0 : _k.License) === null || _l === void 0 ? void 0 : _l.Category;
549
+ var category = (_u = (_t = data === null || data === void 0 ? void 0 : data.license) === null || _t === void 0 ? void 0 : _t.License) === null || _u === void 0 ? void 0 : _u.Category;
553
550
  if (!!category)
554
551
  state.data.activitiesData.activities = [category];
555
- state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: [category] });
552
+ state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: !!category ? [category] : [] });
556
553
  })
557
554
  .addCase(updateLeadBusinessType.rejected, function (state, action) {
558
555
  state.loading = false;
@@ -614,24 +611,21 @@ export var businessSlice = createSlice({
614
611
  var _a, _b, _c;
615
612
  state.loading = false;
616
613
  state.error = null;
617
- var _d = action.payload, customerBasesData = _d.customerBasesData, expectedSalesData = _d.expectedSalesData, expectedCustomerSalesData = _d.expectedCustomerSalesData;
618
- var description = (((_a = customerBasesData === null || customerBasesData === void 0 ? void 0 : customerBasesData.errors) === null || _a === void 0 ? void 0 : _a[0]) ||
619
- ((_b = expectedSalesData === null || expectedSalesData === void 0 ? void 0 : expectedSalesData.errors) === null || _b === void 0 ? void 0 : _b[0]) ||
620
- ((_c = expectedCustomerSalesData === null || expectedCustomerSalesData === void 0 ? void 0 : expectedCustomerSalesData.errors) === null || _c === void 0 ? void 0 : _c[0]) ||
621
- {}).description;
614
+ var _d = action.payload, customerBases = _d.customerBases, expectedSales = _d.expectedSales, expectedCustomerSales = _d.expectedCustomerSales;
615
+ var description = (((_a = customerBases === null || customerBases === void 0 ? void 0 : customerBases.errors) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.errors) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.errors) === null || _c === void 0 ? void 0 : _c[0]) || {}).description;
622
616
  if (description) {
623
617
  state.error = description;
624
618
  return;
625
619
  }
626
620
  var data = state.data.activitiesData.responseBody;
627
- state.data.activitiesData.responseBody = __assign(__assign({}, data), { customerBases: customerBasesData || [], expectedSales: expectedSalesData.data || [], expectedCustomerSales: expectedCustomerSalesData.data || [] });
628
- var selectedCustomerBase = customerBasesData === null || customerBasesData === void 0 ? void 0 : customerBasesData[0];
621
+ state.data.activitiesData.responseBody = __assign(__assign({}, data), { customerBases: customerBases || [], expectedSales: expectedSales || [], expectedCustomerSales: expectedCustomerSales || [] });
622
+ var selectedCustomerBase = customerBases === null || customerBases === void 0 ? void 0 : customerBases[0];
629
623
  if (!!selectedCustomerBase)
630
624
  state.data.customersData.customerLocations = [selectedCustomerBase];
631
- var selectedExpectedSale = expectedSalesData === null || expectedSalesData === void 0 ? void 0 : expectedSalesData[(expectedSalesData === null || expectedSalesData === void 0 ? void 0 : expectedSalesData.length) - 1];
625
+ var selectedExpectedSale = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales[(expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) - 1];
632
626
  if (!!selectedExpectedSale)
633
627
  state.data.customersData.expectedSalesRange = selectedExpectedSale;
634
- var selectedExpectedCustomerSale = expectedCustomerSalesData === null || expectedCustomerSalesData === void 0 ? void 0 : expectedCustomerSalesData[(expectedCustomerSalesData === null || expectedCustomerSalesData === void 0 ? void 0 : expectedCustomerSalesData.length) - 1];
628
+ var selectedExpectedCustomerSale = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales[(expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.length) - 1];
635
629
  if (!!selectedExpectedCustomerSale)
636
630
  state.data.customersData.expectedCustomers = selectedExpectedCustomerSale;
637
631
  })
@@ -1,5 +1,6 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues, PasswordFormValues } from '../../../@types';
2
+ import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues } from '../../../@types';
3
+ import { CancelToken } from 'axios';
3
4
  export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
4
5
  businessCountry: undefined;
5
6
  countries: any;
@@ -25,15 +26,28 @@ export declare const createNIDAuth: import("@reduxjs/toolkit").AsyncThunk<{
25
26
  }, {}>;
26
27
  export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
27
28
  response: any;
28
- leadResponse: any;
29
29
  formData: OTPFormValues;
30
30
  }, OTPFormValues, {}>;
31
- export declare const createVerifyAuthPassword: import("@reduxjs/toolkit").AsyncThunk<{
31
+ export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<{
32
32
  response: any;
33
- createAuthResponse: any;
34
- leadResponse: any;
35
- formData: PasswordFormValues;
36
- }, PasswordFormValues, {}>;
33
+ formData: {
34
+ leadId: string;
35
+ stepName: string;
36
+ };
37
+ }, {
38
+ leadId: string;
39
+ stepName: string;
40
+ }, {}>;
41
+ export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
42
+ response: any;
43
+ formData: {
44
+ individualId: string;
45
+ stepName: string;
46
+ };
47
+ }, {
48
+ individualId: string;
49
+ stepName: string;
50
+ }, {}>;
37
51
  export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{
38
52
  response: any;
39
53
  formData: IndividualFormValues;
@@ -45,11 +59,21 @@ export declare const updateLeadBrand: import("@reduxjs/toolkit").AsyncThunk<{
45
59
  export declare const checkEmailAvailability: import("@reduxjs/toolkit").AsyncThunk<{
46
60
  response: any;
47
61
  formData: string;
48
- } | undefined, string, {}>;
62
+ } | undefined, {
63
+ email: string;
64
+ cancelToken: CancelToken;
65
+ onSuccess?: (() => void) | undefined;
66
+ }, {}>;
49
67
  export declare const checkBrandNameAvailability: import("@reduxjs/toolkit").AsyncThunk<{
50
68
  response: any;
51
- formData: string;
52
- } | undefined, string, {}>;
69
+ formData: {
70
+ name: string;
71
+ };
72
+ } | undefined, {
73
+ name: string;
74
+ cancelToken: CancelToken;
75
+ onSuccess?: (() => void) | undefined;
76
+ }, {}>;
53
77
  export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
54
78
  response: any;
55
79
  formData: void;
@@ -64,7 +88,6 @@ export interface ConnectData {
64
88
  otpData: OTPFormValues & ResponseData & {
65
89
  isAbsher: boolean;
66
90
  };
67
- passwordData: PasswordFormValues & ResponseData;
68
91
  individualData: IndividualFormValues & ResponseData;
69
92
  brandData: BrandFormValues & ResponseData;
70
93
  }
@@ -76,11 +99,10 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState
76
99
  resetMobileScreen: (state: ConnectState) => void;
77
100
  resetNIDScreen: (state: ConnectState) => void;
78
101
  resetOTPScreen: (state: ConnectState) => void;
79
- resetPasswordScreen: (state: ConnectState) => void;
80
102
  resetIndividualScreen: (state: ConnectState) => void;
81
103
  resetMerchantScreen: (state: ConnectState) => void;
82
104
  }, "connect/store">;
83
- export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetPasswordScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
105
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
84
106
  declare const _default: import("redux").Reducer<ConnectState, import("redux").AnyAction>;
85
107
  export default _default;
86
108
  export declare const connectSelector: (state: RootState) => ConnectState;