@tap-payments/auth-jsconnect 2.3.85-test → 2.3.87-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +33 -8
- package/build/@types/form.d.ts +2 -3
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +9 -1
- package/build/api/entity.d.ts +7 -0
- package/build/api/entity.js +10 -1
- package/build/api/index.d.ts +4 -3
- package/build/api/individual.d.ts +0 -1
- package/build/api/individual.js +1 -15
- package/build/api/lead.d.ts +0 -1
- package/build/assets/locales/ar.json +1 -5
- package/build/assets/locales/en.json +1 -5
- package/build/components/SimpleList/SimpleList.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.js +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/dummy.d.ts +0 -8
- package/build/constants/dummy.js +0 -8
- package/build/features/app/connect/connectStore.js +35 -66
- package/build/features/app/entity/entityStore.js +26 -17
- package/build/features/connect/screens/Merchant/Merchant.js +6 -10
- package/build/features/connect/screens/Merchant/validation.d.ts +1 -4
- package/build/features/connect/screens/Merchant/validation.js +1 -4
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +19 -54
- package/build/features/entity/screens/EntityCapital/ActivityList.js +165 -98
- package/build/features/entity/screens/EntityCapital/validation.d.ts +3 -48
- package/build/features/entity/screens/EntityCapital/validation.js +1 -7
- package/package.json +1 -1
- package/build/features/connect/screens/Merchant/BusinessList.d.ts +0 -10
- package/build/features/connect/screens/Merchant/BusinessList.js +0 -82
package/build/@types/app.d.ts
CHANGED
|
@@ -271,14 +271,6 @@ export declare type BrandInfo = {
|
|
|
271
271
|
};
|
|
272
272
|
channel_services: SaleChannel[];
|
|
273
273
|
};
|
|
274
|
-
export declare type BusinessInfo = {
|
|
275
|
-
id: string;
|
|
276
|
-
segment: string;
|
|
277
|
-
name: {
|
|
278
|
-
ar: string;
|
|
279
|
-
en: string;
|
|
280
|
-
};
|
|
281
|
-
};
|
|
282
274
|
export declare enum FlowsTypes {
|
|
283
275
|
CONNECT_EXPRESS = "connect_express",
|
|
284
276
|
CONNECT = "connect",
|
|
@@ -472,4 +464,37 @@ export interface MerchantInfo {
|
|
|
472
464
|
pci_dss: boolean;
|
|
473
465
|
};
|
|
474
466
|
}
|
|
467
|
+
export interface ActivityParams {
|
|
468
|
+
id: string;
|
|
469
|
+
code: string;
|
|
470
|
+
name: {
|
|
471
|
+
ar: string;
|
|
472
|
+
en: string;
|
|
473
|
+
};
|
|
474
|
+
created: string;
|
|
475
|
+
isic_code: string;
|
|
476
|
+
branch_code: string;
|
|
477
|
+
old_activity_id: string;
|
|
478
|
+
}
|
|
479
|
+
export interface ActivityDivision {
|
|
480
|
+
id: string;
|
|
481
|
+
code: string;
|
|
482
|
+
name: {
|
|
483
|
+
ar: string;
|
|
484
|
+
en: string;
|
|
485
|
+
};
|
|
486
|
+
created: string;
|
|
487
|
+
section_code: string;
|
|
488
|
+
activities?: Array<ActivityParams>;
|
|
489
|
+
}
|
|
490
|
+
export interface ActivitiesIsIc {
|
|
491
|
+
id: string;
|
|
492
|
+
code: string;
|
|
493
|
+
name: {
|
|
494
|
+
ar: string;
|
|
495
|
+
en: string;
|
|
496
|
+
};
|
|
497
|
+
created: string;
|
|
498
|
+
divisions?: Array<ActivityDivision>;
|
|
499
|
+
}
|
|
475
500
|
export {};
|
package/build/@types/form.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, License, MonthlyIncome, Occupation, SaleChannel, Segment, SourceOfIncome, TeamSize, City, EntityLicense
|
|
1
|
+
import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, License, MonthlyIncome, Occupation, SaleChannel, Segment, SourceOfIncome, TeamSize, City, EntityLicense } from './app';
|
|
2
2
|
export declare type MobileFormValues = {
|
|
3
3
|
mobile: string;
|
|
4
4
|
countryCode: CountryCode;
|
|
@@ -36,7 +36,6 @@ export declare type BrandFormValues = {
|
|
|
36
36
|
salesChannels: Array<SaleChannel>;
|
|
37
37
|
termAndConditionChecked?: boolean;
|
|
38
38
|
selectedBrandItem: BrandInfo;
|
|
39
|
-
business?: BusinessInfo | undefined;
|
|
40
39
|
};
|
|
41
40
|
export declare type BrandActivitiesFormValues = {
|
|
42
41
|
activities: Array<Activity>;
|
|
@@ -130,7 +129,7 @@ export declare type EntityNameFormValues = {
|
|
|
130
129
|
articleId?: string;
|
|
131
130
|
};
|
|
132
131
|
export declare type EntityCapitalFormValues = {
|
|
133
|
-
activities: Array<
|
|
132
|
+
activities: Array<string>;
|
|
134
133
|
capitalPaid: string;
|
|
135
134
|
capitalShareCount: string;
|
|
136
135
|
capitalShareValue: string;
|
package/build/api/data.d.ts
CHANGED
|
@@ -45,5 +45,6 @@ declare const dataService: {
|
|
|
45
45
|
getSegments: (data: GetSegmentsBody) => Promise<any>;
|
|
46
46
|
getTeamSize: (data: GetTeamSizeBody) => Promise<any>;
|
|
47
47
|
getActivities: (config?: AxiosRequestConfig) => Promise<any>;
|
|
48
|
+
getActivitiesIsIc: () => Promise<any>;
|
|
48
49
|
};
|
|
49
50
|
export { dataService };
|
package/build/api/data.js
CHANGED
|
@@ -63,6 +63,13 @@ var getOccupation = function (data) {
|
|
|
63
63
|
var getActivities = function (config) {
|
|
64
64
|
return httpClient(__assign({ method: 'post', url: "".concat(ENDPOINT_PATHS.RETRIEVE_ACTIVITIES_LIST_PATH) }, config));
|
|
65
65
|
};
|
|
66
|
+
var getActivitiesIsIc = function () {
|
|
67
|
+
return httpClient({
|
|
68
|
+
method: 'post',
|
|
69
|
+
url: "".concat(ENDPOINT_PATHS.RETRIEVE_ACTIVITIES_ISIC),
|
|
70
|
+
data: {}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
66
73
|
var getSegments = function (data) {
|
|
67
74
|
return httpClient({
|
|
68
75
|
method: 'post',
|
|
@@ -87,6 +94,7 @@ var dataService = {
|
|
|
87
94
|
getOccupation: getOccupation,
|
|
88
95
|
getSegments: getSegments,
|
|
89
96
|
getTeamSize: getTeamSize,
|
|
90
|
-
getActivities: getActivities
|
|
97
|
+
getActivities: getActivities,
|
|
98
|
+
getActivitiesIsIc: getActivitiesIsIc
|
|
91
99
|
};
|
|
92
100
|
export { dataService };
|
package/build/api/entity.d.ts
CHANGED
|
@@ -106,6 +106,12 @@ export declare type UpdateEntityAOAFileBody = {
|
|
|
106
106
|
id: string;
|
|
107
107
|
AOA_file_id: string;
|
|
108
108
|
};
|
|
109
|
+
export declare type RemoveEntityActivity = {
|
|
110
|
+
id: string;
|
|
111
|
+
activities?: Array<{
|
|
112
|
+
id: string;
|
|
113
|
+
}>;
|
|
114
|
+
};
|
|
109
115
|
declare const entityService: {
|
|
110
116
|
createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
111
117
|
updateEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -120,5 +126,6 @@ declare const entityService: {
|
|
|
120
126
|
updateEntityCapital: ({ id, ...data }: UpdateEntityCapitalBody) => Promise<any>;
|
|
121
127
|
updateEntityAOAFile: ({ id, ...data }: UpdateEntityAOAFileBody) => Promise<any>;
|
|
122
128
|
retrieveAllEntities: (id: string) => Promise<any>;
|
|
129
|
+
removeEntityActivities: ({ id, ...data }: RemoveEntityActivity) => Promise<any>;
|
|
123
130
|
};
|
|
124
131
|
export { entityService };
|
package/build/api/entity.js
CHANGED
|
@@ -89,6 +89,14 @@ var retrieveAllEntities = function (id) {
|
|
|
89
89
|
url: "".concat(ENDPOINT_PATHS.BUSINESS, "/").concat(id)
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
|
+
var removeEntityActivities = function (_a) {
|
|
93
|
+
var id = _a.id, data = __rest(_a, ["id"]);
|
|
94
|
+
return httpClient({
|
|
95
|
+
method: 'put',
|
|
96
|
+
url: "".concat(ENDPOINT_PATHS.ENTITY, "/").concat(id, "/activities/remove"),
|
|
97
|
+
data: data
|
|
98
|
+
});
|
|
99
|
+
};
|
|
92
100
|
var entityService = {
|
|
93
101
|
createEntityInfo: createEntityInfo,
|
|
94
102
|
updateEntityInfo: updateEntityInfo,
|
|
@@ -102,6 +110,7 @@ var entityService = {
|
|
|
102
110
|
retrieveEntityType: retrieveEntityType,
|
|
103
111
|
updateEntityCapital: updateEntityCapital,
|
|
104
112
|
updateEntityAOAFile: updateEntityAOAFile,
|
|
105
|
-
retrieveAllEntities: retrieveAllEntities
|
|
113
|
+
retrieveAllEntities: retrieveAllEntities,
|
|
114
|
+
removeEntityActivities: removeEntityActivities
|
|
106
115
|
};
|
|
107
116
|
export { entityService };
|
package/build/api/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ValidateOperatorBody } from './operator';
|
|
|
3
3
|
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody } from './auth';
|
|
4
4
|
import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
|
|
5
5
|
import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
|
|
6
|
-
import { EntityInfoBody, EntityBankUpdateBody, BankDocumentInfo, UpdateEntityBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, UpdateEntityAOAFileBody } from './entity';
|
|
6
|
+
import { EntityInfoBody, EntityBankUpdateBody, BankDocumentInfo, UpdateEntityBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, UpdateEntityAOAFileBody, RemoveEntityActivity } from './entity';
|
|
7
7
|
import { CreateAccountBody, ExpressCreateAccountBody } from './account';
|
|
8
8
|
import { DataElementBody } from './data';
|
|
9
9
|
import { BrandListBody, UpdateBrandBody, UpdateIndividualBody, GetIndividualListBody } from './individual';
|
|
@@ -64,6 +64,7 @@ declare const API: {
|
|
|
64
64
|
updateEntityCapital: ({ id, ...data }: UpdateEntityCapitalBody) => Promise<any>;
|
|
65
65
|
updateEntityAOAFile: ({ id, ...data }: UpdateEntityAOAFileBody) => Promise<any>;
|
|
66
66
|
retrieveAllEntities: (id: string) => Promise<any>;
|
|
67
|
+
removeEntityActivities: ({ id, ...data }: RemoveEntityActivity) => Promise<any>;
|
|
67
68
|
};
|
|
68
69
|
availabilityServices: {
|
|
69
70
|
checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -107,13 +108,13 @@ declare const API: {
|
|
|
107
108
|
page: number;
|
|
108
109
|
}) => Promise<any>;
|
|
109
110
|
getActivities: (config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
111
|
+
getActivitiesIsIc: () => Promise<any>;
|
|
110
112
|
};
|
|
111
113
|
individualService: {
|
|
112
114
|
retrieveIndividualInfo: (id: string) => Promise<any>;
|
|
113
115
|
retrieveIndividual: (id: string, type: string) => Promise<any>;
|
|
114
116
|
updateIndividual: ({ id, type, ...data }: UpdateIndividualBody) => Promise<any>;
|
|
115
117
|
getIndividualList: (data: GetIndividualListBody) => Promise<any>;
|
|
116
|
-
getBusinessList: (id: string) => Promise<any>;
|
|
117
118
|
};
|
|
118
119
|
boardService: {
|
|
119
120
|
retrieveBoard: (id: string) => Promise<any>;
|
|
@@ -150,6 +151,6 @@ declare const API: {
|
|
|
150
151
|
getInitialData: (body: InitBody) => Promise<any>;
|
|
151
152
|
};
|
|
152
153
|
};
|
|
153
|
-
export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity };
|
|
154
|
+
export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity };
|
|
154
155
|
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
155
156
|
export default API;
|
|
@@ -141,6 +141,5 @@ declare const individualService: {
|
|
|
141
141
|
retrieveIndividual: (id: string, type: string) => Promise<any>;
|
|
142
142
|
updateIndividual: ({ id, type, ...data }: UpdateIndividualBody) => Promise<any>;
|
|
143
143
|
getIndividualList: (data: GetIndividualListBody) => Promise<any>;
|
|
144
|
-
getBusinessList: (id: string) => Promise<any>;
|
|
145
144
|
};
|
|
146
145
|
export { individualService };
|
package/build/api/individual.js
CHANGED
|
@@ -38,24 +38,10 @@ var getIndividualList = function (data) {
|
|
|
38
38
|
data: data
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
-
var getBusinessList = function (id) {
|
|
42
|
-
return httpClient({
|
|
43
|
-
method: 'post',
|
|
44
|
-
url: "".concat(ENDPOINT_PATHS.BUSINESS, "/list"),
|
|
45
|
-
data: {
|
|
46
|
-
individual_id: id,
|
|
47
|
-
list: {
|
|
48
|
-
limit: 10,
|
|
49
|
-
page: 1
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
41
|
var individualService = {
|
|
55
42
|
retrieveIndividualInfo: retrieveIndividualInfo,
|
|
56
43
|
retrieveIndividual: retrieveIndividual,
|
|
57
44
|
updateIndividual: updateIndividual,
|
|
58
|
-
getIndividualList: getIndividualList
|
|
59
|
-
getBusinessList: getBusinessList
|
|
45
|
+
getIndividualList: getIndividualList
|
|
60
46
|
};
|
|
61
47
|
export { individualService };
|
package/build/api/lead.d.ts
CHANGED
|
@@ -396,9 +396,5 @@
|
|
|
396
396
|
"powered_by": "بواسطة",
|
|
397
397
|
"add_other": "أخرى",
|
|
398
398
|
"choose_entity_license": "اختر ترخيص المنشأة",
|
|
399
|
-
"choose_license_entity": "- الرجاء الاختيار -"
|
|
400
|
-
"select_business_label": "اختر الشركة",
|
|
401
|
-
"Choose_business": "الرجاء تحديد شركة",
|
|
402
|
-
"alert_choose_business": "يُرجى اختيار الشركة",
|
|
403
|
-
"other": "اخرى"
|
|
399
|
+
"choose_license_entity": "- الرجاء الاختيار -"
|
|
404
400
|
}
|
|
@@ -426,9 +426,5 @@
|
|
|
426
426
|
"powered_by": "Powered by",
|
|
427
427
|
"add_other": "Other",
|
|
428
428
|
"choose_entity_license": "Choose Entity License",
|
|
429
|
-
"choose_license_entity": "- Please select -"
|
|
430
|
-
"select_business_label": "Business",
|
|
431
|
-
"choose_business": "Please select a business",
|
|
432
|
-
"alert_choose_business": "Please select business",
|
|
433
|
-
"other": "other"
|
|
429
|
+
"choose_license_entity": "- Please select -"
|
|
434
430
|
}
|
|
@@ -6,7 +6,7 @@ export interface SimpleListProps<T> extends ListProps {
|
|
|
6
6
|
list: Array<T>;
|
|
7
7
|
selectedItems?: Array<T>;
|
|
8
8
|
listItemProps?: ListItemProps;
|
|
9
|
-
onSelectItem: (item: T) => void;
|
|
9
|
+
onSelectItem: (item: T, e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
10
10
|
renderItem: (item: T, idx: number) => React.ReactElement;
|
|
11
11
|
searchKeyPath?: string;
|
|
12
12
|
searchValuePath?: string[];
|
|
@@ -121,8 +121,8 @@ function SimpleList(_a) {
|
|
|
121
121
|
};
|
|
122
122
|
return (_jsxs(_Fragment, { children: [(searchValuePath === null || searchValuePath === void 0 ? void 0 : searchValuePath.length) && _jsx(Search, { onSearchValue: onSearch }), _jsx(ListStyled, __assign({}, rest, { children: children ||
|
|
123
123
|
mapSelectedItemBeginning.map(function (item, idx) {
|
|
124
|
-
return (_createElement(ListItemStyled, __assign({}, listItemProps, { onClick: function () {
|
|
125
|
-
onSelectItem(item);
|
|
124
|
+
return (_createElement(ListItemStyled, __assign({}, listItemProps, { onClick: function (e) {
|
|
125
|
+
onSelectItem(item, e);
|
|
126
126
|
}, disableGutters: true, key: idx }), renderItem(item, idx)));
|
|
127
127
|
}) }))] }));
|
|
128
128
|
}
|
package/build/constants/api.d.ts
CHANGED
package/build/constants/api.js
CHANGED
|
@@ -10,6 +10,7 @@ var AUTH_PATH = '/auth';
|
|
|
10
10
|
var LEAD_PATH = '/lead';
|
|
11
11
|
var RETRIEVE_ENTITY_LIST_PATH = '/lead/entity/list';
|
|
12
12
|
var RETRIEVE_ACTIVITIES_LIST_PATH = '/entity/activities/list';
|
|
13
|
+
var RETRIEVE_ACTIVITIES_ISIC_PATH = '/isic/list';
|
|
13
14
|
var ENTITY_PATH = '/entity';
|
|
14
15
|
var INDIVIDUAL_PATH = '/individual';
|
|
15
16
|
var USER_PATH = '/user';
|
|
@@ -97,5 +98,6 @@ export var ENDPOINT_PATHS = {
|
|
|
97
98
|
TEAM_SIZE_PATH: TEAM_SIZE_PATH,
|
|
98
99
|
CITIES: CITIES_PATH,
|
|
99
100
|
INIT: INIT_PATH,
|
|
100
|
-
BUSINESS: BUSINESS_PATH
|
|
101
|
+
BUSINESS: BUSINESS_PATH,
|
|
102
|
+
RETRIEVE_ACTIVITIES_ISIC: RETRIEVE_ACTIVITIES_ISIC_PATH
|
|
101
103
|
};
|
|
@@ -6,14 +6,6 @@ export declare const OTHER_BRAND: {
|
|
|
6
6
|
en: string;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
export declare const OTHER_BUSINESS: {
|
|
10
|
-
id: string;
|
|
11
|
-
segment: string;
|
|
12
|
-
name: {
|
|
13
|
-
ar: string;
|
|
14
|
-
en: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
9
|
export declare const defaultCountry: {
|
|
18
10
|
created: number;
|
|
19
11
|
updated: number;
|
package/build/constants/dummy.js
CHANGED
|
@@ -6,14 +6,6 @@ export var OTHER_BRAND = {
|
|
|
6
6
|
en: 'other'
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
-
export var OTHER_BUSINESS = {
|
|
10
|
-
id: 'other',
|
|
11
|
-
segment: 'other',
|
|
12
|
-
name: {
|
|
13
|
-
ar: 'other',
|
|
14
|
-
en: 'other'
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
9
|
export var defaultCountry = {
|
|
18
10
|
created: 1577690965000,
|
|
19
11
|
updated: 1577691209000,
|
|
@@ -68,7 +68,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
68
68
|
var _a;
|
|
69
69
|
import API from '../../../api';
|
|
70
70
|
import { handleNextScreenStep } from '../../../app/settings';
|
|
71
|
-
import { CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_BRAND
|
|
71
|
+
import { CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_BRAND } from '../../../constants';
|
|
72
72
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
73
73
|
import { AuthForType, FlowsTypes } from '../../../@types';
|
|
74
74
|
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep } from '../../../utils';
|
|
@@ -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,
|
|
231
|
+
var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, leadResponse, channels, brands, err_1, countryCode, phone;
|
|
232
232
|
var _c, _d, _e, _f;
|
|
233
233
|
return __generator(this, function (_g) {
|
|
234
234
|
switch (_g.label) {
|
|
@@ -269,25 +269,15 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
269
269
|
_g.label = 4;
|
|
270
270
|
case 4:
|
|
271
271
|
_g.trys.push([4, 6, , 7]);
|
|
272
|
-
return [4, API.
|
|
272
|
+
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
273
273
|
case 5:
|
|
274
|
-
|
|
275
|
-
leadResponse.
|
|
274
|
+
brands = (_g.sent()).brands;
|
|
275
|
+
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
276
276
|
return [3, 7];
|
|
277
277
|
case 6:
|
|
278
278
|
err_1 = _g.sent();
|
|
279
279
|
return [3, 7];
|
|
280
280
|
case 7:
|
|
281
|
-
_g.trys.push([7, 9, , 10]);
|
|
282
|
-
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
283
|
-
case 8:
|
|
284
|
-
brands = (_g.sent()).brands;
|
|
285
|
-
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
286
|
-
return [3, 10];
|
|
287
|
-
case 9:
|
|
288
|
-
err_2 = _g.sent();
|
|
289
|
-
return [3, 10];
|
|
290
|
-
case 10:
|
|
291
281
|
countryCode = settings.data.businessCountry;
|
|
292
282
|
phone = (leadResponse.contact || {}).phone;
|
|
293
283
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
@@ -299,7 +289,7 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
299
289
|
});
|
|
300
290
|
}); });
|
|
301
291
|
export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
302
|
-
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels,
|
|
292
|
+
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels, brands, err_2, phone;
|
|
303
293
|
var _b, _c, _d, _e, _f;
|
|
304
294
|
return __generator(this, function (_g) {
|
|
305
295
|
switch (_g.label) {
|
|
@@ -312,15 +302,15 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
312
302
|
count = 1;
|
|
313
303
|
_g.label = 1;
|
|
314
304
|
case 1:
|
|
315
|
-
if (!(count <= maxCalls)) return [3,
|
|
305
|
+
if (!(count <= maxCalls)) return [3, 13];
|
|
316
306
|
if (thunkApi.signal.aborted) {
|
|
317
|
-
return [3,
|
|
307
|
+
return [3, 13];
|
|
318
308
|
}
|
|
319
309
|
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
|
|
320
310
|
case 2:
|
|
321
311
|
authResponse = _g.sent();
|
|
322
312
|
isSuccess = ((_b = authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
323
|
-
if (!isSuccess) return [3,
|
|
313
|
+
if (!isSuccess) return [3, 10];
|
|
324
314
|
lead_id = authResponse.lead_id;
|
|
325
315
|
if (!lead_id)
|
|
326
316
|
throw new Error('Lead id is missing');
|
|
@@ -337,28 +327,18 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
337
327
|
_g.label = 5;
|
|
338
328
|
case 5:
|
|
339
329
|
_g.trys.push([5, 7, , 8]);
|
|
340
|
-
return [4, API.
|
|
330
|
+
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
341
331
|
case 6:
|
|
342
|
-
|
|
343
|
-
leadResponse.
|
|
332
|
+
brands = (_g.sent()).brands;
|
|
333
|
+
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
344
334
|
return [3, 8];
|
|
345
335
|
case 7:
|
|
346
|
-
|
|
336
|
+
err_2 = _g.sent();
|
|
347
337
|
return [3, 8];
|
|
348
338
|
case 8:
|
|
349
|
-
_g.trys.push([8, 10, , 11]);
|
|
350
|
-
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
351
|
-
case 9:
|
|
352
|
-
brands = (_g.sent()).brands;
|
|
353
|
-
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
354
|
-
return [3, 11];
|
|
355
|
-
case 10:
|
|
356
|
-
err_4 = _g.sent();
|
|
357
|
-
return [3, 11];
|
|
358
|
-
case 11:
|
|
359
339
|
(_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
360
340
|
return [4, sleep(3000)];
|
|
361
|
-
case
|
|
341
|
+
case 9:
|
|
362
342
|
_g.sent();
|
|
363
343
|
phone = (leadResponse.contact || {}).phone;
|
|
364
344
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
@@ -366,19 +346,19 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
366
346
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
367
347
|
thunkApi.dispatch(handleNextScreenStep());
|
|
368
348
|
return [2, { authResponse: authResponse, leadResponse: leadResponse, countryCode: countryCode }];
|
|
369
|
-
case
|
|
370
|
-
case
|
|
349
|
+
case 10: return [4, sleep(interval * 1000)];
|
|
350
|
+
case 11:
|
|
371
351
|
_g.sent();
|
|
372
|
-
_g.label =
|
|
373
|
-
case
|
|
352
|
+
_g.label = 12;
|
|
353
|
+
case 12:
|
|
374
354
|
count++;
|
|
375
355
|
return [3, 1];
|
|
376
|
-
case
|
|
356
|
+
case 13: throw new Error('paci_verification_failed');
|
|
377
357
|
}
|
|
378
358
|
});
|
|
379
359
|
}); });
|
|
380
360
|
export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
381
|
-
var _a, settings, connect, lead_id, phoneCountry, payload, leadResponse, segments,
|
|
361
|
+
var _a, settings, connect, lead_id, phoneCountry, payload, leadResponse, segments, err_3, teamSize, err_4, brand;
|
|
382
362
|
var _b, _c, _d, _e, _f;
|
|
383
363
|
return __generator(this, function (_g) {
|
|
384
364
|
switch (_g.label) {
|
|
@@ -406,7 +386,7 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
406
386
|
leadResponse.segments_list = segments.list;
|
|
407
387
|
return [3, 5];
|
|
408
388
|
case 4:
|
|
409
|
-
|
|
389
|
+
err_3 = _g.sent();
|
|
410
390
|
return [3, 5];
|
|
411
391
|
case 5:
|
|
412
392
|
_g.trys.push([5, 7, , 8]);
|
|
@@ -416,7 +396,7 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
416
396
|
leadResponse.team_size_list = teamSize.list;
|
|
417
397
|
return [3, 8];
|
|
418
398
|
case 7:
|
|
419
|
-
|
|
399
|
+
err_4 = _g.sent();
|
|
420
400
|
return [3, 8];
|
|
421
401
|
case 8:
|
|
422
402
|
if (!leadResponse.brand) return [3, 10];
|
|
@@ -433,7 +413,7 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
433
413
|
});
|
|
434
414
|
}); });
|
|
435
415
|
export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
436
|
-
var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem,
|
|
416
|
+
var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, brandNameBody, payload, lead, brandReqBody, brand;
|
|
437
417
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
438
418
|
return __generator(this, function (_l) {
|
|
439
419
|
switch (_l.label) {
|
|
@@ -441,7 +421,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
441
421
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
442
422
|
responseBody = connect.data.otpData.responseBody;
|
|
443
423
|
leadBrandId = responseBody === null || responseBody === void 0 ? void 0 : responseBody.brand_id;
|
|
444
|
-
isNewBrand = params.isNewBrand, brandName = params.brandName, salesChannels = params.salesChannels, selectedBrandItem = params.selectedBrandItem
|
|
424
|
+
isNewBrand = params.isNewBrand, brandName = params.brandName, salesChannels = params.salesChannels, selectedBrandItem = params.selectedBrandItem;
|
|
445
425
|
getAddress = function (value, isTwitter, isWeb) {
|
|
446
426
|
if (isTwitter)
|
|
447
427
|
return '@' + value;
|
|
@@ -495,10 +475,12 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
495
475
|
zh: brandName
|
|
496
476
|
}
|
|
497
477
|
};
|
|
498
|
-
payload =
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
478
|
+
payload = {
|
|
479
|
+
brand: brandNameBody,
|
|
480
|
+
id: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.lead_id) || '',
|
|
481
|
+
step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_BRAND,
|
|
482
|
+
encryption_contract: ['brand.name.en', 'brand.name.ar', 'brand.name.zh']
|
|
483
|
+
};
|
|
502
484
|
return [4, API.leadService.updateLead(payload)];
|
|
503
485
|
case 5:
|
|
504
486
|
lead = _l.sent();
|
|
@@ -633,8 +615,7 @@ var initialState = {
|
|
|
633
615
|
termAndConditionChecked: false,
|
|
634
616
|
selectedBrandItem: {},
|
|
635
617
|
responseBody: {
|
|
636
|
-
brand_list: []
|
|
637
|
-
business_list: []
|
|
618
|
+
brand_list: []
|
|
638
619
|
}
|
|
639
620
|
}
|
|
640
621
|
}
|
|
@@ -729,7 +710,7 @@ export var connectSlice = createSlice({
|
|
|
729
710
|
state.loading = false;
|
|
730
711
|
state.error = null;
|
|
731
712
|
var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, countryCode = _b.countryCode;
|
|
732
|
-
var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id
|
|
713
|
+
var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id;
|
|
733
714
|
var _c = contact || {}, email = _c.email, phone = _c.phone;
|
|
734
715
|
var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
|
|
735
716
|
if (!!fullName) {
|
|
@@ -744,11 +725,6 @@ export var connectSlice = createSlice({
|
|
|
744
725
|
state.data.individualData.countryCode = countryCode;
|
|
745
726
|
if ((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en)
|
|
746
727
|
state.data.brandData.brandName = brand.name.en;
|
|
747
|
-
var businessList = [];
|
|
748
|
-
if ((business_list === null || business_list === void 0 ? void 0 : business_list.length) > 0) {
|
|
749
|
-
businessList = __spreadArray(__spreadArray([], business_list, true), [OTHER_BUSINESS], false);
|
|
750
|
-
state.data.brandData.business = business_list.find(function (b) { return b.id === business_id; }) || business_list[0];
|
|
751
|
-
}
|
|
752
728
|
var brandList = [];
|
|
753
729
|
if ((brand_list === null || brand_list === void 0 ? void 0 : brand_list.length) > 0) {
|
|
754
730
|
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
@@ -760,8 +736,7 @@ export var connectSlice = createSlice({
|
|
|
760
736
|
}
|
|
761
737
|
state.data.brandData.responseBody = {
|
|
762
738
|
brand_list: brandList,
|
|
763
|
-
channel_list: channel_list
|
|
764
|
-
business_list: businessList
|
|
739
|
+
channel_list: channel_list
|
|
765
740
|
};
|
|
766
741
|
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 });
|
|
767
742
|
})
|
|
@@ -777,7 +752,7 @@ export var connectSlice = createSlice({
|
|
|
777
752
|
state.loading = false;
|
|
778
753
|
state.error = null;
|
|
779
754
|
var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, countryCode = _b.countryCode;
|
|
780
|
-
var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id
|
|
755
|
+
var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id;
|
|
781
756
|
var _c = contact || {}, email = _c.email, phone = _c.phone;
|
|
782
757
|
var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
|
|
783
758
|
if (!!fullName) {
|
|
@@ -792,11 +767,6 @@ export var connectSlice = createSlice({
|
|
|
792
767
|
state.data.individualData.countryCode = countryCode;
|
|
793
768
|
if ((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en)
|
|
794
769
|
state.data.brandData.brandName = brand.name.en;
|
|
795
|
-
var businessList = [];
|
|
796
|
-
if ((business_list === null || business_list === void 0 ? void 0 : business_list.length) > 0) {
|
|
797
|
-
businessList = __spreadArray(__spreadArray([], business_list, true), [OTHER_BUSINESS], false);
|
|
798
|
-
state.data.brandData.business = business_list.find(function (b) { return b.id === business_id; }) || business_list[0];
|
|
799
|
-
}
|
|
800
770
|
var brandList = [];
|
|
801
771
|
if ((brand_list === null || brand_list === void 0 ? void 0 : brand_list.length) > 0) {
|
|
802
772
|
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
@@ -808,8 +778,7 @@ export var connectSlice = createSlice({
|
|
|
808
778
|
}
|
|
809
779
|
state.data.brandData.responseBody = {
|
|
810
780
|
brand_list: brandList,
|
|
811
|
-
channel_list: channel_list
|
|
812
|
-
business_list: businessList
|
|
781
|
+
channel_list: channel_list
|
|
813
782
|
};
|
|
814
783
|
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 });
|
|
815
784
|
})
|