@redneckz/wildless-cms-uni-blocks 0.14.1040 → 0.14.1041
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/bundle/bundle.umd.js +49 -91
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/api/getTaskById.d.ts +1 -1
- package/bundle/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/retail/api/getTaskById.d.ts +1 -1
- package/dist/retail/api/getTaskById.js +4 -1
- package/dist/retail/api/getTaskById.js.map +1 -1
- package/dist/retail/components/DraftDialog/utils.js +20 -18
- package/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/dist/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/dist/retail/utils/productTypeToTaskType.js +13 -0
- package/dist/retail/utils/productTypeToTaskType.js.map +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/retail/api/getTaskById.d.ts +1 -1
- package/lib/retail/api/getTaskById.js +4 -1
- package/lib/retail/api/getTaskById.js.map +1 -1
- package/lib/retail/components/DraftDialog/utils.js +20 -18
- package/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/lib/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/lib/retail/utils/productTypeToTaskType.js +10 -0
- package/lib/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +49 -91
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/api/getTaskById.d.ts +1 -1
- package/mobile/bundle/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/retail/api/getTaskById.d.ts +1 -1
- package/mobile/dist/retail/api/getTaskById.js +4 -1
- package/mobile/dist/retail/api/getTaskById.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/utils.js +20 -18
- package/mobile/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/dist/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/dist/retail/utils/productTypeToTaskType.js +13 -0
- package/mobile/dist/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/retail/api/getTaskById.d.ts +1 -1
- package/mobile/lib/retail/api/getTaskById.js +4 -1
- package/mobile/lib/retail/api/getTaskById.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/utils.js +20 -18
- package/mobile/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/lib/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/lib/retail/utils/productTypeToTaskType.js +10 -0
- package/mobile/lib/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -24
- package/mobile/src/retail/api/getTaskById.ts +7 -2
- package/mobile/src/retail/components/DraftDialog/utils.ts +20 -18
- package/mobile/src/retail/utils/productTypeToTaskType.ts +13 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -24
- package/src/retail/api/getTaskById.ts +7 -2
- package/src/retail/components/DraftDialog/utils.ts +20 -18
- package/src/retail/utils/productTypeToTaskType.ts +13 -0
|
@@ -130,23 +130,25 @@ export const getSelectValue = (
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
export const getProductData = (taskType?: DraftTaskType) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
switch (taskType) {
|
|
134
|
+
case 'debit':
|
|
135
|
+
return {
|
|
136
|
+
nextStepLink: '/debit-card-lead',
|
|
137
|
+
newTaskLink: '/natural/debetcards',
|
|
138
|
+
description: 'На дебетовую карту',
|
|
139
|
+
};
|
|
140
|
+
case 'credit':
|
|
141
|
+
return {
|
|
142
|
+
nextStepLink: '/credit-lead',
|
|
143
|
+
newTaskLink: '/natural/loans/all-goals',
|
|
144
|
+
description: 'На получение кредита',
|
|
145
|
+
};
|
|
146
|
+
case 'card':
|
|
147
|
+
default:
|
|
148
|
+
return {
|
|
149
|
+
nextStepLink: '/credit-card-lead',
|
|
150
|
+
newTaskLink: '/natural/creditcards/svoya',
|
|
151
|
+
description: 'На получение кредитной карты',
|
|
152
|
+
};
|
|
145
153
|
}
|
|
146
|
-
|
|
147
|
-
return {
|
|
148
|
-
nextStepLink: '/credit-card-lead',
|
|
149
|
-
newTaskLink: '/natural/creditcards/svoya',
|
|
150
|
-
description: 'На получение кредитной карты',
|
|
151
|
-
};
|
|
152
154
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ProductType } from '../model/ApplicationLeadFormTypes';
|
|
2
|
+
import { type DraftTaskType } from '../model/DraftTaskType';
|
|
3
|
+
|
|
4
|
+
export const productTypeToTaskType = (productType: ProductType): DraftTaskType => {
|
|
5
|
+
if (productType === 'debitCard') {
|
|
6
|
+
return 'debit';
|
|
7
|
+
}
|
|
8
|
+
if (productType === 'creditCard') {
|
|
9
|
+
return 'card';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return 'credit';
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -8,7 +8,6 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
|
8
8
|
import { createParticipant } from '../../retail/api/createParticipant';
|
|
9
9
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
10
10
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
11
|
-
import { type Task } from '../../retail/api/draftTasksKZO';
|
|
12
11
|
import { getClaimChannel } from '../../retail/api/getClaimChannel';
|
|
13
12
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
14
13
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
@@ -18,7 +17,6 @@ import { updateUserTask } from '../../retail/api/updateUserTask';
|
|
|
18
17
|
import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
|
|
19
18
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
20
19
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
21
|
-
import { useDraftSearch } from '../../retail/hooks/useDraftSearch';
|
|
22
20
|
import {
|
|
23
21
|
type CommonLeadProps,
|
|
24
22
|
type ProductType,
|
|
@@ -26,9 +24,9 @@ import {
|
|
|
26
24
|
type UpdateUserDataNewMicroserviceProps,
|
|
27
25
|
type UpdateUserDataProps,
|
|
28
26
|
} from '../../retail/model/ApplicationLeadFormTypes';
|
|
29
|
-
import { type DraftTaskType } from '../../retail/model/DraftTaskType';
|
|
30
27
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
31
28
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
29
|
+
import { productTypeToTaskType } from '../../retail/utils/productTypeToTaskType';
|
|
32
30
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
33
31
|
import { formatPhone } from '../../utils/formatPhone';
|
|
34
32
|
import { productTypeToConsentsMap } from './consents';
|
|
@@ -70,7 +68,6 @@ export const useApplicationLeadApi = ({
|
|
|
70
68
|
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
71
69
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
72
70
|
const draftDialog = useDraftDialog();
|
|
73
|
-
const { searchDrafts } = useDraftSearch();
|
|
74
71
|
|
|
75
72
|
const handleFailSendForm = () => {
|
|
76
73
|
verifyPhoneDialog.close();
|
|
@@ -124,7 +121,7 @@ export const useApplicationLeadApi = ({
|
|
|
124
121
|
draftDialog.open({
|
|
125
122
|
task,
|
|
126
123
|
isFromLead: true,
|
|
127
|
-
taskType: productType
|
|
124
|
+
taskType: productTypeToTaskType(productType),
|
|
128
125
|
sendAspects,
|
|
129
126
|
onClose: sendCurrentTask,
|
|
130
127
|
});
|
|
@@ -199,7 +196,6 @@ export const useApplicationLeadApi = ({
|
|
|
199
196
|
common,
|
|
200
197
|
draftDialog,
|
|
201
198
|
sendCurrentTask,
|
|
202
|
-
searchDrafts,
|
|
203
199
|
});
|
|
204
200
|
|
|
205
201
|
const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
|
|
@@ -263,35 +259,30 @@ const createHandleSuccessVerifyNew =
|
|
|
263
259
|
common,
|
|
264
260
|
draftDialog,
|
|
265
261
|
sendCurrentTask,
|
|
266
|
-
searchDrafts,
|
|
267
262
|
}: {
|
|
268
263
|
common: CommonLeadProps;
|
|
269
264
|
draftDialog: any;
|
|
270
265
|
sendCurrentTask: () => Promise<void>;
|
|
271
|
-
searchDrafts: () => Promise<{ draft: Task | null; taskType: DraftTaskType | undefined }>;
|
|
272
266
|
}) =>
|
|
273
267
|
async () => {
|
|
274
|
-
const { verifyPhoneDialog, sendAspects, handleFailSendForm } =
|
|
268
|
+
const { verifyPhoneDialog, sendAspects, handleFailSendForm, userId, programId, productType } =
|
|
269
|
+
common;
|
|
275
270
|
try {
|
|
276
|
-
const {
|
|
277
|
-
|
|
278
|
-
verifyPhoneDialog.close();
|
|
271
|
+
const lastTaskId = await getLastTaskStatus({ userId, programId });
|
|
279
272
|
|
|
280
|
-
if (
|
|
273
|
+
if (lastTaskId) {
|
|
274
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
275
|
+
verifyPhoneDialog.close();
|
|
281
276
|
draftDialog.open({
|
|
282
|
-
task
|
|
283
|
-
|
|
277
|
+
task,
|
|
278
|
+
isFromLead: true,
|
|
279
|
+
taskType: productTypeToTaskType(productType),
|
|
280
|
+
sendAspects,
|
|
281
|
+
onClose: sendCurrentTask,
|
|
284
282
|
});
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
} else {
|
|
284
|
+
await sendCurrentTask();
|
|
287
285
|
}
|
|
288
|
-
draftDialog.open({
|
|
289
|
-
task: draft,
|
|
290
|
-
taskType,
|
|
291
|
-
isFromLead: true,
|
|
292
|
-
sendAspects,
|
|
293
|
-
onClose: sendCurrentTask,
|
|
294
|
-
});
|
|
295
286
|
} catch {
|
|
296
287
|
handleFailSendForm();
|
|
297
288
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { checkNewMicroservice } from '../utils/checkNewMicroservice';
|
|
1
2
|
import { fetchRetailJSON } from './doRequest';
|
|
2
3
|
import { type Task } from './draftTasksKZO';
|
|
3
4
|
|
|
4
5
|
type GetTaskByIdBody = {
|
|
5
|
-
taskId: number;
|
|
6
|
+
taskId: string | number;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
export const getTaskById = async (body: GetTaskByIdBody): Promise<Task | undefined> => {
|
|
9
|
-
const
|
|
10
|
+
const isNewMicroservice = checkNewMicroservice();
|
|
11
|
+
|
|
12
|
+
const endpoint = isNewMicroservice ? '/public-data/getTaskById' : '/user-data/getTaskById';
|
|
13
|
+
|
|
14
|
+
const res = await fetchRetailJSON<Task>(endpoint, 'POST', body);
|
|
10
15
|
|
|
11
16
|
return res || undefined;
|
|
12
17
|
};
|
|
@@ -130,23 +130,25 @@ export const getSelectValue = (
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
export const getProductData = (taskType?: DraftTaskType) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
switch (taskType) {
|
|
134
|
+
case 'debit':
|
|
135
|
+
return {
|
|
136
|
+
nextStepLink: '/debit-card-lead',
|
|
137
|
+
newTaskLink: '/natural/debetcards',
|
|
138
|
+
description: 'На дебетовую карту',
|
|
139
|
+
};
|
|
140
|
+
case 'credit':
|
|
141
|
+
return {
|
|
142
|
+
nextStepLink: '/credit-lead',
|
|
143
|
+
newTaskLink: '/natural/loans/all-goals',
|
|
144
|
+
description: 'На получение кредита',
|
|
145
|
+
};
|
|
146
|
+
case 'card':
|
|
147
|
+
default:
|
|
148
|
+
return {
|
|
149
|
+
nextStepLink: '/credit-card-lead',
|
|
150
|
+
newTaskLink: '/natural/creditcards/svoya',
|
|
151
|
+
description: 'На получение кредитной карты',
|
|
152
|
+
};
|
|
145
153
|
}
|
|
146
|
-
|
|
147
|
-
return {
|
|
148
|
-
nextStepLink: '/credit-card-lead',
|
|
149
|
-
newTaskLink: '/natural/creditcards/svoya',
|
|
150
|
-
description: 'На получение кредитной карты',
|
|
151
|
-
};
|
|
152
154
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ProductType } from '../model/ApplicationLeadFormTypes';
|
|
2
|
+
import { type DraftTaskType } from '../model/DraftTaskType';
|
|
3
|
+
|
|
4
|
+
export const productTypeToTaskType = (productType: ProductType): DraftTaskType => {
|
|
5
|
+
if (productType === 'debitCard') {
|
|
6
|
+
return 'debit';
|
|
7
|
+
}
|
|
8
|
+
if (productType === 'creditCard') {
|
|
9
|
+
return 'card';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return 'credit';
|
|
13
|
+
};
|