@tap-payments/auth-jsconnect 2.3.78-test → 2.3.83-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 +8 -0
- package/build/@types/form.d.ts +2 -1
- package/build/api/index.d.ts +1 -0
- package/build/api/individual.d.ts +1 -0
- package/build/api/individual.js +15 -1
- package/build/api/lead.d.ts +1 -0
- package/build/assets/locales/ar.json +5 -1
- package/build/assets/locales/en.json +5 -1
- package/build/constants/dummy.d.ts +8 -0
- package/build/constants/dummy.js +8 -0
- package/build/features/app/brand/brandStore.d.ts +3 -3
- package/build/features/app/brand/brandStore.js +133 -114
- package/build/features/app/connect/connectStore.js +66 -35
- package/build/features/app/entity/entityStore.d.ts +3 -3
- package/build/features/app/entity/entityStore.js +130 -120
- package/build/features/app/tax/taxStore.d.ts +2 -2
- package/build/features/app/tax/taxStore.js +59 -55
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -2
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +3 -11
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +7 -6
- package/build/features/connect/screens/Merchant/BusinessList.d.ts +10 -0
- package/build/features/connect/screens/Merchant/BusinessList.js +82 -0
- package/build/features/connect/screens/Merchant/Merchant.js +11 -6
- package/build/features/connect/screens/Merchant/validation.d.ts +7 -1
- package/build/features/connect/screens/Merchant/validation.js +6 -2
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +3 -2
- package/build/features/entity/screens/EntityName/EntityName.js +3 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -3
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
|
@@ -271,6 +271,14 @@ 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
|
+
};
|
|
274
282
|
export declare enum FlowsTypes {
|
|
275
283
|
CONNECT_EXPRESS = "connect_express",
|
|
276
284
|
CONNECT = "connect",
|
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 } from './app';
|
|
1
|
+
import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, License, MonthlyIncome, Occupation, SaleChannel, Segment, SourceOfIncome, TeamSize, City, EntityLicense, BusinessInfo } from './app';
|
|
2
2
|
export declare type MobileFormValues = {
|
|
3
3
|
mobile: string;
|
|
4
4
|
countryCode: CountryCode;
|
|
@@ -36,6 +36,7 @@ export declare type BrandFormValues = {
|
|
|
36
36
|
salesChannels: Array<SaleChannel>;
|
|
37
37
|
termAndConditionChecked?: boolean;
|
|
38
38
|
selectedBrandItem: BrandInfo;
|
|
39
|
+
business?: BusinessInfo | undefined;
|
|
39
40
|
};
|
|
40
41
|
export declare type BrandActivitiesFormValues = {
|
|
41
42
|
activities: Array<Activity>;
|
package/build/api/index.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ declare const API: {
|
|
|
113
113
|
retrieveIndividual: (id: string, type: string) => Promise<any>;
|
|
114
114
|
updateIndividual: ({ id, type, ...data }: UpdateIndividualBody) => Promise<any>;
|
|
115
115
|
getIndividualList: (data: GetIndividualListBody) => Promise<any>;
|
|
116
|
+
getBusinessList: (id: string) => Promise<any>;
|
|
116
117
|
};
|
|
117
118
|
boardService: {
|
|
118
119
|
retrieveBoard: (id: string) => Promise<any>;
|
|
@@ -141,5 +141,6 @@ 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>;
|
|
144
145
|
};
|
|
145
146
|
export { individualService };
|
package/build/api/individual.js
CHANGED
|
@@ -38,10 +38,24 @@ 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
|
+
};
|
|
41
54
|
var individualService = {
|
|
42
55
|
retrieveIndividualInfo: retrieveIndividualInfo,
|
|
43
56
|
retrieveIndividual: retrieveIndividual,
|
|
44
57
|
updateIndividual: updateIndividual,
|
|
45
|
-
getIndividualList: getIndividualList
|
|
58
|
+
getIndividualList: getIndividualList,
|
|
59
|
+
getBusinessList: getBusinessList
|
|
46
60
|
};
|
|
47
61
|
export { individualService };
|
package/build/api/lead.d.ts
CHANGED
|
@@ -396,5 +396,9 @@
|
|
|
396
396
|
"powered_by": "بواسطة",
|
|
397
397
|
"add_other": "أخرى",
|
|
398
398
|
"choose_entity_license": "اختر ترخيص المنشأة",
|
|
399
|
-
"choose_license_entity": "- الرجاء الاختيار -"
|
|
399
|
+
"choose_license_entity": "- الرجاء الاختيار -",
|
|
400
|
+
"select_business_label": "اختر الشركة",
|
|
401
|
+
"Choose_business": "الرجاء تحديد شركة",
|
|
402
|
+
"alert_choose_business": "يُرجى اختيار الشركة",
|
|
403
|
+
"other": "اخرى"
|
|
400
404
|
}
|
|
@@ -426,5 +426,9 @@
|
|
|
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 -"
|
|
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"
|
|
430
434
|
}
|
|
@@ -6,6 +6,14 @@ 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
|
+
};
|
|
9
17
|
export declare const defaultCountry: {
|
|
10
18
|
created: number;
|
|
11
19
|
updated: number;
|
package/build/constants/dummy.js
CHANGED
|
@@ -6,6 +6,14 @@ 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
|
+
};
|
|
9
17
|
export var defaultCountry = {
|
|
10
18
|
created: 1577690965000,
|
|
11
19
|
updated: 1577691209000,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActionState, BrandActivitiesFormValues, BrandFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
2
|
+
import { ActionState, AsyncThunkParams, BrandActivitiesFormValues, BrandFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
3
|
import { CancelToken } from 'axios';
|
|
4
4
|
interface VerifyLeadTokenProps {
|
|
5
5
|
token: string;
|
|
@@ -63,14 +63,14 @@ export declare const checkBrandNameAvailability: import("@reduxjs/toolkit").Asyn
|
|
|
63
63
|
export declare const updateBrand: import("@reduxjs/toolkit").AsyncThunk<{
|
|
64
64
|
data: any;
|
|
65
65
|
formData: Omit<BrandFormValues, "termAndConditionChecked" | "selectedBrandItem">;
|
|
66
|
-
}, Omit<BrandFormValues, "termAndConditionChecked" | "selectedBrandItem"
|
|
66
|
+
}, AsyncThunkParams<Omit<BrandFormValues, "termAndConditionChecked" | "selectedBrandItem">>, {}>;
|
|
67
67
|
export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<any, {
|
|
68
68
|
leadId: string;
|
|
69
69
|
}, {}>;
|
|
70
70
|
export declare const updateBrandActivities: import("@reduxjs/toolkit").AsyncThunk<{
|
|
71
71
|
data: any;
|
|
72
72
|
formData: BrandActivitiesFormValues;
|
|
73
|
-
}, BrandActivitiesFormValues
|
|
73
|
+
}, AsyncThunkParams<BrandActivitiesFormValues>, {}>;
|
|
74
74
|
export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
|
|
75
75
|
customerBases: any;
|
|
76
76
|
expectedSales: any;
|
|
@@ -263,70 +263,73 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
|
|
|
263
263
|
});
|
|
264
264
|
});
|
|
265
265
|
});
|
|
266
|
-
export var updateBrand = createAsyncThunk('brandUpdateBrand', function (
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
266
|
+
export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thunkApi) {
|
|
267
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
268
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
269
|
+
var _b, settings, brand, _c, id, data_status, isNameNonEditable, isChannelServicesNonEditable, isSegmentTypeNonEditable, isSegmentTeamsNonEditable, salesChannels, brandName, segment, teamSize, brandLogoId, segmentId, teamSizeId, getAddress, channel_services, requestBody, brandData, activities, activityList;
|
|
270
|
+
var _d, _e, _f, _g;
|
|
271
|
+
return __generator(this, function (_h) {
|
|
272
|
+
switch (_h.label) {
|
|
273
|
+
case 0:
|
|
274
|
+
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
275
|
+
_c = ((_d = brand.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.brand) || {}, id = _c.id, data_status = _c.data_status;
|
|
276
|
+
isNameNonEditable = hasNoneEditableValue(data_status, 'name');
|
|
277
|
+
isChannelServicesNonEditable = hasNoneEditableValue(data_status, 'channel_services');
|
|
278
|
+
isSegmentTypeNonEditable = hasNoneEditableValue(data_status, 'segment.type');
|
|
279
|
+
isSegmentTeamsNonEditable = hasNoneEditableValue(data_status, 'segment.teams');
|
|
280
|
+
salesChannels = formData.salesChannels, brandName = formData.brandName, segment = formData.segment, teamSize = formData.teamSize, brandLogoId = formData.brandLogoId;
|
|
281
|
+
segmentId = isSegmentTypeNonEditable ? undefined : segment && { id: segment.id };
|
|
282
|
+
teamSizeId = isSegmentTeamsNonEditable ? undefined : teamSize && { id: teamSize.id };
|
|
283
|
+
getAddress = function (value, isTwitter, isWeb) {
|
|
284
|
+
if (isTwitter)
|
|
285
|
+
return '@' + value.replaceAll('@', '');
|
|
286
|
+
if (isWeb)
|
|
287
|
+
return 'https://www.' + value.replaceAll('https://www.', '');
|
|
288
|
+
return value;
|
|
289
|
+
};
|
|
290
|
+
channel_services = isChannelServicesNonEditable
|
|
291
|
+
? undefined
|
|
292
|
+
: salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.map(function (channel) {
|
|
293
|
+
var _a;
|
|
294
|
+
return {
|
|
295
|
+
id: channel.id,
|
|
296
|
+
address: getAddress(channel.address || '', isTwitter(channel.code), isWebsite(channel.code)),
|
|
297
|
+
sub: (_a = channel.sub) === null || _a === void 0 ? void 0 : _a.map(function (sub) {
|
|
298
|
+
return { id: sub.id, address: getAddress(sub.address || '', isTwitter(sub.code), isWebsite(sub.code)) };
|
|
299
|
+
})
|
|
300
|
+
};
|
|
301
|
+
});
|
|
302
|
+
requestBody = {
|
|
303
|
+
id: id,
|
|
304
|
+
name: isNameNonEditable || !brandName ? undefined : { en: brandName, ar: brandName },
|
|
305
|
+
logo: brandLogoId,
|
|
306
|
+
segment: !segmentId && !teamSizeId ? undefined : { type: segmentId, team: teamSizeId },
|
|
307
|
+
channel_services: channel_services
|
|
308
|
+
};
|
|
309
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
310
|
+
case 1:
|
|
311
|
+
brandData = (_h.sent()).brand;
|
|
312
|
+
activities = (((_e = brand.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.entity) || {}).activities;
|
|
313
|
+
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
314
|
+
case 2:
|
|
315
|
+
_h.sent();
|
|
316
|
+
if (activities) {
|
|
317
|
+
brandData = __assign(__assign({}, brandData), { entity_activities: activities || {} });
|
|
318
|
+
}
|
|
319
|
+
if (!!activities) return [3, 4];
|
|
320
|
+
return [4, API.dataService.getActivities()];
|
|
321
|
+
case 3:
|
|
322
|
+
activityList = (_h.sent()).list;
|
|
323
|
+
brandData = __assign(__assign({}, brandData), { entity_activities: activityList || {} });
|
|
324
|
+
_h.label = 4;
|
|
325
|
+
case 4:
|
|
326
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
327
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, id);
|
|
328
|
+
return [2, { data: __assign({}, brandData), formData: originalFormData }];
|
|
329
|
+
}
|
|
330
|
+
});
|
|
328
331
|
});
|
|
329
|
-
});
|
|
332
|
+
});
|
|
330
333
|
export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
331
334
|
var data;
|
|
332
335
|
return __generator(this, function (_a) {
|
|
@@ -338,57 +341,62 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
|
|
|
338
341
|
}
|
|
339
342
|
});
|
|
340
343
|
}); });
|
|
341
|
-
export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities', function (
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
344
|
+
export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities', function (_a, thunkApi) {
|
|
345
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
346
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
347
|
+
var _b, settings, brand, _c, data_status, id, brandActivities, isActivitiesNonEditable, isCustomerBaseLocationNonEditable, isCustomerBaseNonEditable, isTermsNonEditable, isSalesRangeNonEditable, activities, customerLocations, expectedCustomer, expectedSale, termAndConditionChecked, refundPolicy, transactionPolicy, isTermsUndefined, removedActivities, payload, requestBody, customerLocation, customerBaseId, salesId, customerBase, brandData;
|
|
348
|
+
var _d, _e, _f;
|
|
349
|
+
return __generator(this, function (_g) {
|
|
350
|
+
switch (_g.label) {
|
|
351
|
+
case 0:
|
|
352
|
+
_b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
|
|
353
|
+
_c = ((_d = brand.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.brand) || {}, data_status = _c.data_status, id = _c.id, brandActivities = _c.activities;
|
|
354
|
+
isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
|
|
355
|
+
isCustomerBaseLocationNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base_location');
|
|
356
|
+
isCustomerBaseNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base');
|
|
357
|
+
isTermsNonEditable = hasNoneEditableValue(data_status, 'terms');
|
|
358
|
+
isSalesRangeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'sales_range');
|
|
359
|
+
activities = formData.activities, customerLocations = formData.customerLocations, expectedCustomer = formData.expectedCustomer, expectedSale = formData.expectedSale, termAndConditionChecked = formData.termAndConditionChecked, refundPolicy = formData.refundPolicy, transactionPolicy = formData.transactionPolicy;
|
|
360
|
+
isTermsUndefined = termAndConditionChecked === undefined && refundPolicy === undefined && transactionPolicy === undefined;
|
|
361
|
+
removedActivities = (activities === null || activities === void 0 ? void 0 : activities.length) > 0 &&
|
|
362
|
+
(brandActivities || []).filter(function (brandActivity) { return !(activities || []).some(function (activity) { return activity.id === brandActivity.id; }); });
|
|
363
|
+
if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0)) return [3, 2];
|
|
364
|
+
payload = {
|
|
365
|
+
id: id,
|
|
366
|
+
activities: removedActivities
|
|
367
|
+
};
|
|
368
|
+
return [4, API.brandService.removeBrandActivity(payload)];
|
|
369
|
+
case 1:
|
|
370
|
+
_g.sent();
|
|
371
|
+
_g.label = 2;
|
|
372
|
+
case 2:
|
|
373
|
+
requestBody = {
|
|
374
|
+
id: id,
|
|
375
|
+
activities: isActivitiesNonEditable ? undefined : activities,
|
|
376
|
+
term: isTermsNonEditable || isTermsUndefined ? undefined : ['general', 'refund', 'chargeback'],
|
|
377
|
+
step_name: BRAND_STEP_NAMES.BRAND_ACTIVITIES
|
|
378
|
+
};
|
|
379
|
+
customerLocation = (customerLocations || []).map(function (location) { return ({
|
|
380
|
+
id: location.id
|
|
381
|
+
}); });
|
|
382
|
+
customerBaseId = (expectedCustomer === null || expectedCustomer === void 0 ? void 0 : expectedCustomer.id) && { id: expectedCustomer.id, period: 'monthly' };
|
|
383
|
+
salesId = (expectedSale === null || expectedSale === void 0 ? void 0 : expectedSale.id) && { id: expectedSale.id, period: 'monthly' };
|
|
384
|
+
customerBase = (customerBaseId || customerLocation.length) && __assign(__assign({}, (customerBaseId && !isCustomerBaseNonEditable && { id: expectedCustomer.id, period: 'monthly' })), (customerLocation.length && !isCustomerBaseLocationNonEditable && { locations: customerLocation }));
|
|
385
|
+
if (customerBase && !(isCustomerBaseNonEditable && isCustomerBaseLocationNonEditable))
|
|
386
|
+
requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { customer_base: customerBase }) });
|
|
387
|
+
if (salesId && !isSalesRangeNonEditable) {
|
|
388
|
+
requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { sales: salesId }) });
|
|
389
|
+
}
|
|
390
|
+
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
391
|
+
case 3:
|
|
392
|
+
brandData = (_g.sent()).data;
|
|
393
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
394
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
395
|
+
return [2, { data: __assign({}, brandData), formData: originalFormData }];
|
|
396
|
+
}
|
|
397
|
+
});
|
|
390
398
|
});
|
|
391
|
-
});
|
|
399
|
+
});
|
|
392
400
|
export var retrieveDataList = createAsyncThunk('brandRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
393
401
|
var settings, countryISO2, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
|
|
394
402
|
return __generator(this, function (_b) {
|
|
@@ -617,7 +625,7 @@ export var brandSlice = createSlice({
|
|
|
617
625
|
state.loading = false;
|
|
618
626
|
state.error = null;
|
|
619
627
|
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
620
|
-
var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations;
|
|
628
|
+
var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations, terms = data.terms;
|
|
621
629
|
var selectedActivity = entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
|
|
622
630
|
return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
|
|
623
631
|
});
|
|
@@ -631,6 +639,17 @@ export var brandSlice = createSlice({
|
|
|
631
639
|
state.data.brandActivities.expectedSale = sales;
|
|
632
640
|
if (!!customerBase)
|
|
633
641
|
state.data.brandActivities.expectedCustomer = customerBase;
|
|
642
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
643
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
644
|
+
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
645
|
+
}
|
|
646
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'chargeback') {
|
|
647
|
+
state.data.brandActivities.transactionPolicy = element.agree;
|
|
648
|
+
}
|
|
649
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'refund') {
|
|
650
|
+
state.data.brandActivities.refundPolicy = element.agree;
|
|
651
|
+
}
|
|
652
|
+
});
|
|
634
653
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { activities: entity_activities });
|
|
635
654
|
})
|
|
636
655
|
.addCase(updateBrandActivities.rejected, function (state, action) {
|