@tap-payments/auth-jsconnect 2.6.10-test → 2.6.13-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 +2 -1
- package/build/@types/app.js +1 -0
- package/build/api/country.d.ts +1 -0
- package/build/api/country.js +8 -1
- package/build/api/index.d.ts +1 -0
- package/build/app/settings.js +2 -5
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.js +11 -5
- package/build/constants/dummy.d.ts +45 -0
- package/build/constants/dummy.js +330 -0
- package/build/features/app/brand/brandStore.d.ts +2 -0
- package/build/features/app/brand/brandStore.js +19 -12
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +107 -72
- package/build/features/app/connectExpress/connectExpressStore.js +27 -13
- package/build/features/app/entity/entityStore.d.ts +2 -0
- package/build/features/app/entity/entityStore.js +23 -16
- package/build/features/app/individual/individualStore.d.ts +2 -0
- package/build/features/app/individual/individualStore.js +19 -12
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -5
- package/build/features/business/screens/BusinessType/EntityName.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseNumber.js +9 -8
- package/build/features/business/screens/BusinessType/validation.d.ts +10 -0
- package/build/features/business/screens/BusinessType/validation.js +16 -0
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -3
- package/build/features/connect/Connect.js +3 -3
- package/build/features/connect/screens/Mobile/Mobile.js +7 -6
- package/build/features/connect/screens/Mobile/MobileNumber.js +9 -6
- package/build/features/connectExpress/ConnectExpress.js +3 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +12 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -6
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +8 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +13 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +67 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +4 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +1 -1
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +1 -1
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -6
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -6
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -6
- package/build/features/entity/screens/EntityName/EntityName.js +11 -4
- package/build/features/entity/screens/EntityName/LicenseNumber.js +5 -4
- package/build/features/entity/screens/EntityName/validation.d.ts +28 -0
- package/build/features/entity/screens/EntityName/validation.js +38 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
- package/build/hooks/useCountry.d.ts +1 -0
- package/build/hooks/useCountry.js +4 -3
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +3 -0
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
|
@@ -321,7 +321,8 @@ export declare type FlowInfo = {
|
|
|
321
321
|
export declare enum AuthForType {
|
|
322
322
|
MOBILE = "mobile",
|
|
323
323
|
EMAIL = "email",
|
|
324
|
-
NATIONAL_ID = "national_id"
|
|
324
|
+
NATIONAL_ID = "national_id",
|
|
325
|
+
NATIONAL_ID_MISSED = "national_id_missed"
|
|
325
326
|
}
|
|
326
327
|
export declare enum AddressFormateType {
|
|
327
328
|
SELECT = "select",
|
package/build/@types/app.js
CHANGED
|
@@ -39,6 +39,7 @@ export var AuthForType;
|
|
|
39
39
|
AuthForType["MOBILE"] = "mobile";
|
|
40
40
|
AuthForType["EMAIL"] = "email";
|
|
41
41
|
AuthForType["NATIONAL_ID"] = "national_id";
|
|
42
|
+
AuthForType["NATIONAL_ID_MISSED"] = "national_id_missed";
|
|
42
43
|
})(AuthForType || (AuthForType = {}));
|
|
43
44
|
export var AddressFormateType;
|
|
44
45
|
(function (AddressFormateType) {
|
package/build/api/country.d.ts
CHANGED
package/build/api/country.js
CHANGED
|
@@ -15,8 +15,15 @@ var getCities = function (data) {
|
|
|
15
15
|
data: data
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
+
var getCurrency = function (countryCode) {
|
|
19
|
+
return httpClient({
|
|
20
|
+
method: 'get',
|
|
21
|
+
url: "".concat(ENDPOINT_PATHS.CURRENCY, "/").concat(countryCode)
|
|
22
|
+
});
|
|
23
|
+
};
|
|
18
24
|
var countryService = {
|
|
19
25
|
getCountries: getCountries,
|
|
20
|
-
getCities: getCities
|
|
26
|
+
getCities: getCities,
|
|
27
|
+
getCurrency: getCurrency
|
|
21
28
|
};
|
|
22
29
|
export { countryService };
|
package/build/api/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ declare const API: {
|
|
|
27
27
|
list: never[];
|
|
28
28
|
};
|
|
29
29
|
getCities: (data: import("./country").GetCitiesBody) => Promise<any>;
|
|
30
|
+
getCurrency: (countryCode: string) => Promise<any>;
|
|
30
31
|
};
|
|
31
32
|
authService: {
|
|
32
33
|
createAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
package/build/app/settings.js
CHANGED
|
@@ -47,13 +47,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage,
|
|
50
|
+
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, getParameterByName, setBaseUrl } from '../utils';
|
|
51
51
|
import { DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
|
|
52
52
|
import i18n from '../i18n';
|
|
53
53
|
import { updateLocale } from '../utils/locale';
|
|
54
54
|
import API, { getAxiosHeaders, setAxiosGlobalHeaders } from '../api';
|
|
55
55
|
export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, domain, language_1, country, scope, public_key, maturity_1, board_maturity, post, platform_redirect_url, data, deviceInfo, isValidOperator, countries, countryCode,
|
|
56
|
+
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, domain, language_1, country, scope, public_key, maturity_1, board_maturity, post, platform_redirect_url, data, deviceInfo, isValidOperator, countries, countryCode, businessCountry;
|
|
57
57
|
return __generator(this, function (_f) {
|
|
58
58
|
switch (_f.label) {
|
|
59
59
|
case 0:
|
|
@@ -135,9 +135,6 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
135
135
|
isValidOperator = operator === 'valid';
|
|
136
136
|
countries = sortCountries(list);
|
|
137
137
|
countryCode = configInfo.businessCountryCode;
|
|
138
|
-
isKWOrSA = isKW(countryCode) || isSA(countryCode);
|
|
139
|
-
if (!isKWOrSA)
|
|
140
|
-
countryCode = 'KW';
|
|
141
138
|
businessCountry = findCountryByIso2(countries, countryCode);
|
|
142
139
|
if (!businessCountry)
|
|
143
140
|
throw new Error('Business country not found, you have to pass a valid business country code in the lib config');
|
package/build/constants/api.d.ts
CHANGED
package/build/constants/api.js
CHANGED
|
@@ -3,6 +3,7 @@ var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
|
|
|
3
3
|
var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
|
|
4
4
|
var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
|
|
5
5
|
var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
|
|
6
|
+
var CURRENCY_PATH = 'https://utilities.tap.company/api/v1/currency/iso';
|
|
6
7
|
var CITIES_PATH = '/country/state/city/list';
|
|
7
8
|
var IP_PATH = '/ip';
|
|
8
9
|
var OPERATOR_PATH = '/operator';
|
|
@@ -110,5 +111,6 @@ export var ENDPOINT_PATHS = {
|
|
|
110
111
|
SEGMENT_PROFIT: SEGMENT_PROFIT_PATH,
|
|
111
112
|
SEGMENT_TECH: SEGMENT_TECH_PATH,
|
|
112
113
|
MERCHANT: MERCHANT_PATH,
|
|
113
|
-
TERMINAL: TERMINAL_PATH
|
|
114
|
+
TERMINAL: TERMINAL_PATH,
|
|
115
|
+
CURRENCY: CURRENCY_PATH
|
|
114
116
|
};
|
package/build/constants/app.js
CHANGED
|
@@ -122,7 +122,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
name: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
125
|
-
next: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
|
|
125
|
+
next: ['CONNECT_EXPRESS_OTP_IDENTITY_STEP', 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP'],
|
|
126
126
|
prev: 'CONNECT_EXPRESS_MOBILE_STEP',
|
|
127
127
|
order: 3
|
|
128
128
|
},
|
|
@@ -134,20 +134,26 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
|
|
137
|
-
next: ['
|
|
137
|
+
next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
138
138
|
prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
|
|
139
139
|
order: 4
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
name: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
|
|
143
|
-
next: ['
|
|
143
|
+
next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
144
144
|
prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
145
145
|
order: 4
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
name: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
|
|
149
149
|
next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
150
|
-
prev: [
|
|
150
|
+
prev: [
|
|
151
|
+
'CONNECT_EXPRESS_MOBILE_STEP',
|
|
152
|
+
'CONNECT_EXPRESS_NID_STEP',
|
|
153
|
+
'CONNECT_EXPRESS_CIVIL_ID_STEP',
|
|
154
|
+
'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
|
|
155
|
+
'CONNECT_EXPRESS_NID_MISSED_STEP'
|
|
156
|
+
],
|
|
151
157
|
order: 5
|
|
152
158
|
},
|
|
153
159
|
{
|
|
@@ -199,7 +205,7 @@ export var BUSINESS_SCREENS_NAVIGATION = [
|
|
|
199
205
|
},
|
|
200
206
|
{
|
|
201
207
|
name: 'BUSINESS_IDBOD_STEP',
|
|
202
|
-
next: 'BUSINESS_OTP_STEP',
|
|
208
|
+
next: ['BUSINESS_OTP_STEP', 'BUSINESS_BUSINESS_TYPE_STEP'],
|
|
203
209
|
prev: '',
|
|
204
210
|
order: 2
|
|
205
211
|
},
|
|
@@ -6,6 +6,51 @@ export declare const OTHER_BRAND: {
|
|
|
6
6
|
en: string;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
+
export declare const EXPECTED_SALES_LIST: ({
|
|
10
|
+
id: string;
|
|
11
|
+
name: {
|
|
12
|
+
ar: string;
|
|
13
|
+
en: string;
|
|
14
|
+
};
|
|
15
|
+
range: {
|
|
16
|
+
from: number;
|
|
17
|
+
to: number;
|
|
18
|
+
};
|
|
19
|
+
sub: {
|
|
20
|
+
name: {
|
|
21
|
+
ar: string;
|
|
22
|
+
en: string;
|
|
23
|
+
};
|
|
24
|
+
range: {
|
|
25
|
+
from: number;
|
|
26
|
+
to: number;
|
|
27
|
+
};
|
|
28
|
+
id: string;
|
|
29
|
+
}[];
|
|
30
|
+
country_code: string[];
|
|
31
|
+
is_main: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
id: string;
|
|
34
|
+
name: {
|
|
35
|
+
ar: string;
|
|
36
|
+
en: string;
|
|
37
|
+
};
|
|
38
|
+
range: {
|
|
39
|
+
from: number;
|
|
40
|
+
to: number;
|
|
41
|
+
};
|
|
42
|
+
country_code: string[];
|
|
43
|
+
is_main: boolean;
|
|
44
|
+
sub?: undefined;
|
|
45
|
+
})[];
|
|
46
|
+
export declare const MONTHLY_INCOME_LIST: {
|
|
47
|
+
id: string;
|
|
48
|
+
range: {
|
|
49
|
+
ar: string;
|
|
50
|
+
en: string;
|
|
51
|
+
};
|
|
52
|
+
country_code: string[];
|
|
53
|
+
}[];
|
|
9
54
|
export declare const defaultCountry: {
|
|
10
55
|
created: number;
|
|
11
56
|
updated: number;
|
package/build/constants/dummy.js
CHANGED
|
@@ -6,6 +6,336 @@ export var OTHER_BRAND = {
|
|
|
6
6
|
en: 'other'
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
+
export var EXPECTED_SALES_LIST = [
|
|
10
|
+
{
|
|
11
|
+
id: 'sales_rng_L3me8221219f4rQ28dX9v337',
|
|
12
|
+
name: {
|
|
13
|
+
ar: 'اقل من 100 ألف',
|
|
14
|
+
en: 'Less than 100,000'
|
|
15
|
+
},
|
|
16
|
+
range: {
|
|
17
|
+
from: 0,
|
|
18
|
+
to: 100000
|
|
19
|
+
},
|
|
20
|
+
sub: [
|
|
21
|
+
{
|
|
22
|
+
name: {
|
|
23
|
+
ar: 'أقل من 2.5 ألف',
|
|
24
|
+
en: 'less than 2,500'
|
|
25
|
+
},
|
|
26
|
+
range: {
|
|
27
|
+
from: 0,
|
|
28
|
+
to: 2500
|
|
29
|
+
},
|
|
30
|
+
id: 'sub_range_92EQ572212459P5u28Ol99756'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: {
|
|
34
|
+
ar: '2,500 الي 5,000',
|
|
35
|
+
en: '2,500 to 5,000'
|
|
36
|
+
},
|
|
37
|
+
range: {
|
|
38
|
+
from: 2500,
|
|
39
|
+
to: 5000
|
|
40
|
+
},
|
|
41
|
+
id: 'sub_range_BfZM41221246Lknj28AN9x782'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: {
|
|
45
|
+
ar: '5,000 الي 10,000',
|
|
46
|
+
en: '5,000 to 10,000'
|
|
47
|
+
},
|
|
48
|
+
range: {
|
|
49
|
+
from: 5000,
|
|
50
|
+
to: 10000
|
|
51
|
+
},
|
|
52
|
+
id: 'sub_range_DxZt2221248umu328AT9X147'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: {
|
|
56
|
+
ar: '10,000 الي 25,000',
|
|
57
|
+
en: '10,000 to 25,000'
|
|
58
|
+
},
|
|
59
|
+
range: {
|
|
60
|
+
from: 10000,
|
|
61
|
+
to: 25000
|
|
62
|
+
},
|
|
63
|
+
id: 'sub_range_D14U47221248zltv28Vp9i333'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: {
|
|
67
|
+
ar: '25,000 الي 50,000',
|
|
68
|
+
en: '25,000 to 50,000'
|
|
69
|
+
},
|
|
70
|
+
range: {
|
|
71
|
+
from: 25000,
|
|
72
|
+
to: 50000
|
|
73
|
+
},
|
|
74
|
+
id: 'sub_range_HTdQ8221249MIBQ28xq9e20'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: {
|
|
78
|
+
ar: '50,000 الي 100,000',
|
|
79
|
+
en: '50,000 to 100,000'
|
|
80
|
+
},
|
|
81
|
+
range: {
|
|
82
|
+
from: 50000,
|
|
83
|
+
to: 100000
|
|
84
|
+
},
|
|
85
|
+
id: 'sub_range_E8nu37221249JDPW28bL9S357'
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
country_code: ['SA'],
|
|
89
|
+
is_main: true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'sales_rng_DDx234221224TxGH28xI9F82',
|
|
93
|
+
name: {
|
|
94
|
+
ar: 'اقل من 1 مليون',
|
|
95
|
+
en: 'Less than 1,000,000'
|
|
96
|
+
},
|
|
97
|
+
range: {
|
|
98
|
+
from: 100000,
|
|
99
|
+
to: 1000000
|
|
100
|
+
},
|
|
101
|
+
sub: [
|
|
102
|
+
{
|
|
103
|
+
name: {
|
|
104
|
+
ar: '100,000 الي 250,000',
|
|
105
|
+
en: '100,000 to 250,000'
|
|
106
|
+
},
|
|
107
|
+
range: {
|
|
108
|
+
from: 100000,
|
|
109
|
+
to: 250000
|
|
110
|
+
},
|
|
111
|
+
id: 'sub_range_2bo738221420YDgJ28is9W124'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: {
|
|
115
|
+
ar: '250,000 الي 500,000',
|
|
116
|
+
en: '250,000 to 500,000'
|
|
117
|
+
},
|
|
118
|
+
range: {
|
|
119
|
+
from: 250000,
|
|
120
|
+
to: 500000
|
|
121
|
+
},
|
|
122
|
+
id: 'sub_range_vKLl37221421vpb428uV95330'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: {
|
|
126
|
+
ar: '500,000 الي 1,000,000',
|
|
127
|
+
en: '500,000 to 1,000,000'
|
|
128
|
+
},
|
|
129
|
+
range: {
|
|
130
|
+
from: 500000,
|
|
131
|
+
to: 1000000
|
|
132
|
+
},
|
|
133
|
+
id: 'sub_range_PrIJ12221422kNgD28sk9E692'
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
country_code: ['SA'],
|
|
137
|
+
is_main: true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'sales_rng_5FXo34221229Obhb284h9F958',
|
|
141
|
+
name: {
|
|
142
|
+
ar: 'اقل من 10 مليون',
|
|
143
|
+
en: 'Less than 10,000,000'
|
|
144
|
+
},
|
|
145
|
+
range: {
|
|
146
|
+
from: 100000,
|
|
147
|
+
to: 10000000
|
|
148
|
+
},
|
|
149
|
+
sub: [
|
|
150
|
+
{
|
|
151
|
+
name: {
|
|
152
|
+
ar: '1,000,000 الي 2,500,000',
|
|
153
|
+
en: '1,000,000 to 2,500,000'
|
|
154
|
+
},
|
|
155
|
+
range: {
|
|
156
|
+
from: 1000000,
|
|
157
|
+
to: 2500000
|
|
158
|
+
},
|
|
159
|
+
id: 'sub_range_O6v519221431ZSAI28FI9V16'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: {
|
|
163
|
+
ar: '2,500,000 الي 5,000,000',
|
|
164
|
+
en: '2,500,000 to 5,000,000'
|
|
165
|
+
},
|
|
166
|
+
range: {
|
|
167
|
+
from: 2500000,
|
|
168
|
+
to: 5000000
|
|
169
|
+
},
|
|
170
|
+
id: 'sub_range_azyv7221432ADPP28zN9r620'
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: {
|
|
174
|
+
ar: '5,000,000 الي 10,000,000',
|
|
175
|
+
en: '5,000,000 to 10,000,0000'
|
|
176
|
+
},
|
|
177
|
+
range: {
|
|
178
|
+
from: 5000000,
|
|
179
|
+
to: 10000000
|
|
180
|
+
},
|
|
181
|
+
id: 'sub_range_V74129221433Nqj328AT9C430'
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
country_code: ['SA'],
|
|
185
|
+
is_main: true
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'sales_rng_9FX13121229Obhb284h9F723',
|
|
189
|
+
name: {
|
|
190
|
+
ar: 'اقل من 100 مليون',
|
|
191
|
+
en: 'Less than 100,000,000'
|
|
192
|
+
},
|
|
193
|
+
range: {
|
|
194
|
+
from: 1000000,
|
|
195
|
+
to: 100000000
|
|
196
|
+
},
|
|
197
|
+
sub: [
|
|
198
|
+
{
|
|
199
|
+
name: {
|
|
200
|
+
ar: '10,000,000 الي 25,000,000',
|
|
201
|
+
en: '10,000,000 to 25,000,000'
|
|
202
|
+
},
|
|
203
|
+
range: {
|
|
204
|
+
from: 10000000,
|
|
205
|
+
to: 25000000
|
|
206
|
+
},
|
|
207
|
+
id: 'sub_range_vhGd55221438A0qH28Yl9Y76'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: {
|
|
211
|
+
ar: '25,000,000 الي 50,000,000',
|
|
212
|
+
en: '25,000,000 to 50,000,000'
|
|
213
|
+
},
|
|
214
|
+
range: {
|
|
215
|
+
from: 25000000,
|
|
216
|
+
to: 50000000
|
|
217
|
+
},
|
|
218
|
+
id: 'sub_range_aqfz19221440yCIX283O96244'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: {
|
|
222
|
+
ar: '50,000,000 الي 100,000,000',
|
|
223
|
+
en: '50,000,000 to 100,000,000'
|
|
224
|
+
},
|
|
225
|
+
range: {
|
|
226
|
+
from: 50000000,
|
|
227
|
+
to: 100000000
|
|
228
|
+
},
|
|
229
|
+
id: 'sub_range_PbOi46221440he6Z28Fv9i98'
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
country_code: ['SA'],
|
|
233
|
+
is_main: true
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: 'sales_rng_htNM37221234DVUJ28qj9x672',
|
|
237
|
+
name: {
|
|
238
|
+
ar: 'اكثر من 100 مليون ',
|
|
239
|
+
en: 'greater than 100,000,000'
|
|
240
|
+
},
|
|
241
|
+
range: {
|
|
242
|
+
from: 100000000,
|
|
243
|
+
to: 100000000000
|
|
244
|
+
},
|
|
245
|
+
country_code: ['SA'],
|
|
246
|
+
is_main: true
|
|
247
|
+
}
|
|
248
|
+
];
|
|
249
|
+
export var MONTHLY_INCOME_LIST = [
|
|
250
|
+
{
|
|
251
|
+
id: 'monthly_income_TvD850221616i3c730mc9Z323',
|
|
252
|
+
range: {
|
|
253
|
+
ar: 'أقل من 2500',
|
|
254
|
+
en: 'Below 2500'
|
|
255
|
+
},
|
|
256
|
+
country_code: ['SA']
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: 'monthly_income_7rkp53221617iYdX30rr9e753',
|
|
260
|
+
range: {
|
|
261
|
+
ar: '2,501 إلى 5,000',
|
|
262
|
+
en: '2,501 to 5,000'
|
|
263
|
+
},
|
|
264
|
+
country_code: ['SA']
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: 'monthly_income_HFDf11221618v3Qn30gQ9x874',
|
|
268
|
+
range: {
|
|
269
|
+
ar: '5,001 إلى 7,500',
|
|
270
|
+
en: '5,001 to 7,500'
|
|
271
|
+
},
|
|
272
|
+
country_code: ['SA']
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
id: 'monthly_income_LXg031221618APLf306B9Y622',
|
|
276
|
+
range: {
|
|
277
|
+
ar: '7,501 إلى 10,000',
|
|
278
|
+
en: '7,501 to 10,000'
|
|
279
|
+
},
|
|
280
|
+
country_code: ['SA']
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: 'monthly_income_6SSj52221618CUC230rI9Z881',
|
|
284
|
+
range: {
|
|
285
|
+
ar: '10,001 إلى 12,500',
|
|
286
|
+
en: '10,001 to 12,500'
|
|
287
|
+
},
|
|
288
|
+
country_code: ['SA']
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: 'monthly_income_JKp013221619M0PC301L9C230',
|
|
292
|
+
range: {
|
|
293
|
+
ar: '12,501 إلى 15,000',
|
|
294
|
+
en: '12,501 to 15,000'
|
|
295
|
+
},
|
|
296
|
+
country_code: ['SA']
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: 'monthly_income_CXXd36221619O7Ep30qD9M191',
|
|
300
|
+
range: {
|
|
301
|
+
ar: '15,001 إلى 20,000',
|
|
302
|
+
en: '15,001 to 20,000'
|
|
303
|
+
},
|
|
304
|
+
country_code: ['SA']
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: 'monthly_income_96EN57221619f35z30Vv9e791',
|
|
308
|
+
range: {
|
|
309
|
+
ar: '20,001 إلى 25,000',
|
|
310
|
+
en: '20,001 to 25,000'
|
|
311
|
+
},
|
|
312
|
+
country_code: ['SA']
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: 'monthly_income_PGCc17221620CemL30P69S583',
|
|
316
|
+
range: {
|
|
317
|
+
ar: '25,001 إلى 30,000',
|
|
318
|
+
en: '25,001 to 30,000'
|
|
319
|
+
},
|
|
320
|
+
country_code: ['SA']
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: 'monthly_income_saQe37221620niuh30oZ9i528',
|
|
324
|
+
range: {
|
|
325
|
+
ar: '30,001 إلى 40,000',
|
|
326
|
+
en: '30,001 to 40,000'
|
|
327
|
+
},
|
|
328
|
+
country_code: ['SA']
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: 'monthly_income_pNZP8221621NBrW30G791572',
|
|
332
|
+
range: {
|
|
333
|
+
ar: 'اكثر من 40,001',
|
|
334
|
+
en: '40,001 or above'
|
|
335
|
+
},
|
|
336
|
+
country_code: ['SA']
|
|
337
|
+
}
|
|
338
|
+
];
|
|
9
339
|
export var defaultCountry = {
|
|
10
340
|
created: 1577690965000,
|
|
11
341
|
updated: 1577691209000,
|
|
@@ -76,6 +76,7 @@ export declare const updateBrand: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
76
76
|
export declare const updateSegmentBrand: import("@reduxjs/toolkit").AsyncThunk<{
|
|
77
77
|
data: any;
|
|
78
78
|
formData: BrandSegmentFormValues;
|
|
79
|
+
currencyData: any;
|
|
79
80
|
}, AsyncThunkParams<BrandSegmentFormValues>, {}>;
|
|
80
81
|
export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<any, {
|
|
81
82
|
leadId: string;
|
|
@@ -105,6 +106,7 @@ export interface BrandData {
|
|
|
105
106
|
brandSegmentData: BrandSegmentFormValues & ResponseData;
|
|
106
107
|
brandActivities: BrandActivitiesFormValues & ResponseData;
|
|
107
108
|
flowName: FlowsTypes;
|
|
109
|
+
currency: string;
|
|
108
110
|
}
|
|
109
111
|
export interface BrandState extends SharedState<BrandData> {
|
|
110
112
|
customLoading?: boolean;
|
|
@@ -61,7 +61,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { FlowsTypes } from '../../../@types';
|
|
63
63
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
|
-
import { BRAND_STEP_NAMES } from '../../../constants';
|
|
64
|
+
import { BRAND_STEP_NAMES, EXPECTED_SALES_LIST } from '../../../constants';
|
|
65
65
|
import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sleep } from '../../../utils';
|
|
66
66
|
export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (_a, thunkApi) {
|
|
67
67
|
var token = _a.token, isInternally = _a.isInternally;
|
|
@@ -375,7 +375,7 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
|
|
|
375
375
|
export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', function (_a, thunkApi) {
|
|
376
376
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
377
377
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
378
|
-
var _b, settings, brand, brandRes, _c, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, brandData, activities, activityList;
|
|
378
|
+
var _b, settings, brand, brandRes, _c, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, brandData, currencyData, activities, activityList;
|
|
379
379
|
var _d, _e, _f;
|
|
380
380
|
return __generator(this, function (_g) {
|
|
381
381
|
switch (_g.label) {
|
|
@@ -399,23 +399,26 @@ export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', func
|
|
|
399
399
|
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
400
400
|
case 1:
|
|
401
401
|
brandData = (_g.sent()).brand;
|
|
402
|
+
return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
|
|
403
|
+
case 2:
|
|
404
|
+
currencyData = _g.sent();
|
|
402
405
|
activities = (((_d = brand.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}).activities;
|
|
403
406
|
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
404
|
-
case
|
|
407
|
+
case 3:
|
|
405
408
|
_g.sent();
|
|
406
409
|
if (activities) {
|
|
407
410
|
brandData = __assign(__assign({}, brandData), { entity_activities: activities || {} });
|
|
408
411
|
}
|
|
409
|
-
if (!!activities) return [3,
|
|
412
|
+
if (!!activities) return [3, 5];
|
|
410
413
|
return [4, API.dataService.getActivities()];
|
|
411
|
-
case
|
|
414
|
+
case 4:
|
|
412
415
|
activityList = (_g.sent()).list;
|
|
413
416
|
brandData = __assign(__assign({}, brandData), { entity_activities: activityList || {} });
|
|
414
|
-
_g.label =
|
|
415
|
-
case
|
|
417
|
+
_g.label = 5;
|
|
418
|
+
case 5:
|
|
416
419
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
417
420
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
418
|
-
return [2, { data: __assign({}, brandData), formData: originalFormData }];
|
|
421
|
+
return [2, { data: __assign({}, brandData), formData: originalFormData, currencyData: currencyData }];
|
|
419
422
|
}
|
|
420
423
|
});
|
|
421
424
|
});
|
|
@@ -511,7 +514,7 @@ export var retrieveDataList = createAsyncThunk('brandRetrieveDataList', function
|
|
|
511
514
|
_a = _b.sent(), customerBases = _a[0].list, expectedSales = _a[1].list, expectedCustomerSales = _a[2].list;
|
|
512
515
|
return [2, {
|
|
513
516
|
customerBases: customerBases,
|
|
514
|
-
expectedSales: expectedSales,
|
|
517
|
+
expectedSales: (expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) ? expectedSales : EXPECTED_SALES_LIST,
|
|
515
518
|
expectedCustomerSales: expectedCustomerSales,
|
|
516
519
|
countryISO2: countryISO2
|
|
517
520
|
}];
|
|
@@ -572,6 +575,7 @@ var initialState = {
|
|
|
572
575
|
uploadingBrandLogo: false,
|
|
573
576
|
data: {
|
|
574
577
|
flowName: FlowsTypes.BRAND,
|
|
578
|
+
currency: '',
|
|
575
579
|
verify: {
|
|
576
580
|
token: ''
|
|
577
581
|
},
|
|
@@ -742,17 +746,20 @@ export var brandSlice = createSlice({
|
|
|
742
746
|
state.error = null;
|
|
743
747
|
})
|
|
744
748
|
.addCase(updateSegmentBrand.fulfilled, function (state, action) {
|
|
749
|
+
var _a;
|
|
745
750
|
state.loading = false;
|
|
746
751
|
state.error = null;
|
|
747
|
-
var
|
|
752
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
|
|
748
753
|
var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations, terms = data.terms;
|
|
749
754
|
var selectedActivity = entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
750
755
|
return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
|
|
751
756
|
});
|
|
752
757
|
state.data.brandSegmentData = formData;
|
|
758
|
+
if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
|
|
759
|
+
state.data.currency = currencyData.code.english;
|
|
753
760
|
state.data.brandActivities.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
754
|
-
var
|
|
755
|
-
var
|
|
761
|
+
var _c = operations || {}, customer_base = _c.customer_base, sales = _c.sales;
|
|
762
|
+
var _d = customer_base || {}, locations = _d.locations, customerBase = __rest(_d, ["locations"]);
|
|
756
763
|
if (locations && locations.length)
|
|
757
764
|
state.data.brandActivities.customerLocations = locations;
|
|
758
765
|
if (!!sales)
|