@redneckz/wildless-cms-uni-blocks 0.14.700 → 0.14.701
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/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
- package/bundle/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/bundle/bundle.umd.js +252 -30
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/dist/api/RetailAPI/draftTasksKZO.js +9 -0
- package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
- package/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/dist/api/RetailAPI/getTaskById.d.ts +6 -0
- package/dist/api/RetailAPI/getTaskById.js +9 -0
- package/dist/api/RetailAPI/getTaskById.js.map +1 -0
- package/dist/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
- package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
- package/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
- package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
- package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
- package/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/dist/ui-kit/DraftDialog/utils.js +85 -0
- package/dist/ui-kit/DraftDialog/utils.js.map +1 -0
- package/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/lib/api/RetailAPI/draftTasksKZO.js +6 -0
- package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
- package/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/lib/api/RetailAPI/getTaskById.d.ts +6 -0
- package/lib/api/RetailAPI/getTaskById.js +6 -0
- package/lib/api/RetailAPI/getTaskById.js.map +1 -0
- package/lib/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
- package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
- package/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
- package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
- package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
- package/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/lib/ui-kit/DraftDialog/utils.js +78 -0
- package/lib/ui-kit/DraftDialog/utils.js.map +1 -0
- package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/mobile/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/mobile/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
- package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/mobile/bundle/bundle.umd.js +252 -30
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/mobile/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/mobile/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/mobile/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/mobile/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/mobile/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.js +9 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/mobile/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/mobile/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
- package/mobile/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/mobile/dist/api/RetailAPI/getTaskById.d.ts +6 -0
- package/mobile/dist/api/RetailAPI/getTaskById.js +9 -0
- package/mobile/dist/api/RetailAPI/getTaskById.js.map +1 -0
- package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
- package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
- package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/mobile/dist/ui-kit/DraftDialog/utils.js +85 -0
- package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.js +6 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/mobile/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/mobile/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
- package/mobile/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/mobile/lib/api/RetailAPI/getTaskById.d.ts +6 -0
- package/mobile/lib/api/RetailAPI/getTaskById.js +6 -0
- package/mobile/lib/api/RetailAPI/getTaskById.js.map +1 -0
- package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
- package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
- package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/mobile/lib/ui-kit/DraftDialog/utils.js +78 -0
- package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -0
- package/mobile/src/api/RetailAPI/draftTasksKZO.ts +33 -0
- package/mobile/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
- package/mobile/src/api/RetailAPI/getTaskById.ts +12 -0
- package/mobile/src/api/RetailAPI/updateUserTask.ts +8 -8
- package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +6 -6
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
- package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
- package/mobile/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
- package/mobile/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
- package/mobile/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
- package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
- package/mobile/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
- package/mobile/src/ui-kit/DraftDialog/utils.ts +148 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/draftTasksKZO.ts +33 -0
- package/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
- package/src/api/RetailAPI/getTaskById.ts +12 -0
- package/src/api/RetailAPI/updateUserTask.ts +8 -8
- package/src/components/ApplicationLeadForm/LeadFormState.ts +6 -6
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
- package/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
- package/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
- package/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
- package/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
- package/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
- package/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
- package/src/ui-kit/DraftDialog/utils.ts +148 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { type Task } from '../../api/RetailAPI/draftTasksKZO';
|
|
4
|
+
import { useLeadFormStore } from '../../components/ApplicationLeadForm/useLeadFormStore';
|
|
5
|
+
import { locationNavigator } from '../../external/locationNavigator';
|
|
6
|
+
import { useSetter } from '../../hooks/useSetter';
|
|
7
|
+
import { noop } from '../../utils/noop';
|
|
8
|
+
import { Button } from '../Button/Button';
|
|
9
|
+
import { Dialog } from '../DialogManager/Dialog';
|
|
10
|
+
import { Heading } from '../Heading/Heading';
|
|
11
|
+
import { DraftActionButton } from './DraftActionButton';
|
|
12
|
+
import { parseDraftTask } from './parseDraftTask';
|
|
13
|
+
import { creditCodesToProgrammIdMap, creditProgramCodeToProductIdMap } from './utils';
|
|
14
|
+
|
|
15
|
+
export interface DraftDialogProps {
|
|
16
|
+
task: Task;
|
|
17
|
+
isFromLead?: boolean;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
22
|
+
task,
|
|
23
|
+
isFromLead = false,
|
|
24
|
+
onClose = noop,
|
|
25
|
+
}) {
|
|
26
|
+
const leadFormStore = useLeadFormStore();
|
|
27
|
+
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
28
|
+
const navigator = locationNavigator();
|
|
29
|
+
|
|
30
|
+
const { participants, creditProgram, id: taskId } = task;
|
|
31
|
+
|
|
32
|
+
const programmId: string = creditProgramCodeToProductIdMap[creditProgram.code];
|
|
33
|
+
const isCredit = Boolean(creditCodesToProgrammIdMap[creditProgram.code]);
|
|
34
|
+
const nextStepLink = isCredit ? '/credit-lead' : '/credit-card-lead';
|
|
35
|
+
|
|
36
|
+
const { name, midname, id: participantId, profile } = participants[0];
|
|
37
|
+
|
|
38
|
+
const handleGoToDraft = useCallback(() => {
|
|
39
|
+
const taskFromDraft = parseDraftTask(task);
|
|
40
|
+
leadFormStore.participantId = participantId;
|
|
41
|
+
leadFormStore.taskId = taskId;
|
|
42
|
+
leadFormStore.profileId = profile?.id;
|
|
43
|
+
leadFormStore.programId = programmId;
|
|
44
|
+
saveForm(taskFromDraft);
|
|
45
|
+
navigator.assign(nextStepLink);
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
const handleGoToNewTask = useCallback(() => {
|
|
49
|
+
navigator.assign(isCredit ? '/natural/loans/all-goals' : '/natural/creditcards/svoya');
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const handleGoToMainPage = useCallback(() => {
|
|
53
|
+
navigator.assign('/');
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
const appeal = name && midname ? `${name} ${midname}, ` : '';
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Dialog
|
|
60
|
+
className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl"
|
|
61
|
+
onClose={onClose}
|
|
62
|
+
>
|
|
63
|
+
<div className="flex flex-col gap-lg">
|
|
64
|
+
<Heading
|
|
65
|
+
className="whitespace-pre-wrap"
|
|
66
|
+
title={`${appeal}мы нашли черновик вашей заявки.\nПродолжите заполнение?`}
|
|
67
|
+
headingType="h5"
|
|
68
|
+
/>
|
|
69
|
+
<DraftActionButton
|
|
70
|
+
title="Перейти к черновику"
|
|
71
|
+
icon="api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg"
|
|
72
|
+
description="Продолжайте заполнять заявку из черновика"
|
|
73
|
+
onClick={handleGoToDraft}
|
|
74
|
+
/>
|
|
75
|
+
<DraftActionButton
|
|
76
|
+
title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Заполнить новую заявку'}
|
|
77
|
+
icon="api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg"
|
|
78
|
+
onClick={isFromLead ? onClose : handleGoToNewTask}
|
|
79
|
+
/>
|
|
80
|
+
<Button
|
|
81
|
+
type="button"
|
|
82
|
+
version="secondary"
|
|
83
|
+
className="w-full text-h5"
|
|
84
|
+
onClick={handleGoToMainPage}
|
|
85
|
+
>
|
|
86
|
+
Вернуться на главную
|
|
87
|
+
</Button>
|
|
88
|
+
</div>
|
|
89
|
+
</Dialog>
|
|
90
|
+
);
|
|
91
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { locationNavigator } from '../../external/locationNavigator';
|
|
4
|
+
import { noop } from '../../utils/noop';
|
|
5
|
+
import { Button } from '../Button/Button';
|
|
6
|
+
import { Dialog } from '../DialogManager/Dialog';
|
|
7
|
+
import { Heading } from '../Heading/Heading';
|
|
8
|
+
import { Paragraph } from '../Paragraph/Paragraph';
|
|
9
|
+
|
|
10
|
+
export interface EmptyDraftDialogProps {
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const EmptyDraftDialog = JSX<EmptyDraftDialogProps>(function ({ onClose = noop }) {
|
|
15
|
+
const navigator = locationNavigator();
|
|
16
|
+
|
|
17
|
+
const handleGoNewTask = useCallback(() => {
|
|
18
|
+
navigator.assign('/natural/loans/all-goals');
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
const handleGoMainPage = useCallback(() => {
|
|
22
|
+
navigator.assign('/');
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Dialog
|
|
27
|
+
className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl"
|
|
28
|
+
onClose={onClose}
|
|
29
|
+
>
|
|
30
|
+
<div className="flex flex-col gap-lg">
|
|
31
|
+
<Heading className="text-center" title="Заявки не найдены" headingType="h3" />
|
|
32
|
+
<Paragraph size="text-l" align="text-center">
|
|
33
|
+
По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или
|
|
34
|
+
вернуться на главную страницу
|
|
35
|
+
</Paragraph>
|
|
36
|
+
|
|
37
|
+
<Button type="button" className="w-full" onClick={handleGoNewTask}>
|
|
38
|
+
Заполнить новую заявку
|
|
39
|
+
</Button>
|
|
40
|
+
|
|
41
|
+
<Button type="button" version="secondary" className="w-full" onClick={handleGoMainPage}>
|
|
42
|
+
Вернуться на главную
|
|
43
|
+
</Button>
|
|
44
|
+
</div>
|
|
45
|
+
</Dialog>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function */
|
|
2
|
+
import { type Task } from '../../api/RetailAPI/draftTasksKZO';
|
|
3
|
+
import { type LeadFormState } from '../../components/ApplicationLeadForm/LeadFormState';
|
|
4
|
+
import {
|
|
5
|
+
getParticipantAddresses,
|
|
6
|
+
getParticipantContacts,
|
|
7
|
+
getParticipantGender,
|
|
8
|
+
getParticipantIncomes,
|
|
9
|
+
getSelectValue,
|
|
10
|
+
} from './utils';
|
|
11
|
+
|
|
12
|
+
export const parseDraftTask = (task: Task): LeadFormState => {
|
|
13
|
+
const participant = task.participants[0];
|
|
14
|
+
|
|
15
|
+
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
currencyCode: currency,
|
|
19
|
+
paymentSystemTypeCd: paymentSystem,
|
|
20
|
+
classCard: cardCategory,
|
|
21
|
+
codeWord,
|
|
22
|
+
birthDate: limitedBirthday,
|
|
23
|
+
midname: middleName,
|
|
24
|
+
name,
|
|
25
|
+
surname,
|
|
26
|
+
birthPlace,
|
|
27
|
+
dulIssueDate: dulIssueDateField,
|
|
28
|
+
dulIssuedBy,
|
|
29
|
+
dulNumber,
|
|
30
|
+
dulSerie,
|
|
31
|
+
dulSubdivisionCode,
|
|
32
|
+
educationLevelCd: education,
|
|
33
|
+
registrationDate: participantDateRegistration,
|
|
34
|
+
houseTypeCd: housing,
|
|
35
|
+
genderCd,
|
|
36
|
+
participantContacts = [],
|
|
37
|
+
participantAddresses = [],
|
|
38
|
+
employmentContractDate: beginDate,
|
|
39
|
+
employmentTypeCd: employment,
|
|
40
|
+
organizationName,
|
|
41
|
+
organizationInn: inn,
|
|
42
|
+
organizationActivityTypeCd: employerActivities,
|
|
43
|
+
organizationTypeCd: organization,
|
|
44
|
+
organizationKindCd: employerOrganization,
|
|
45
|
+
employeesNumberCd: amountWorkers,
|
|
46
|
+
opf: legalForm,
|
|
47
|
+
seniority: generalSeniority,
|
|
48
|
+
generalSeniority: experience5Years,
|
|
49
|
+
jobsNumber,
|
|
50
|
+
lastWorkDuration: lastJobExperience,
|
|
51
|
+
positionCd: positionOrganization,
|
|
52
|
+
maritalStatusCd: familyStatus,
|
|
53
|
+
childrenDependents: children,
|
|
54
|
+
totalDependents: familyMembers,
|
|
55
|
+
otherDependents: dependents,
|
|
56
|
+
militaryStatusCd: conscription,
|
|
57
|
+
participantIncomes,
|
|
58
|
+
snils,
|
|
59
|
+
armyIdFlg,
|
|
60
|
+
bankruptcyFlg,
|
|
61
|
+
shareholderFlg,
|
|
62
|
+
nameLegalEntity: legalEntityName,
|
|
63
|
+
creditInRshbCd,
|
|
64
|
+
payrollCardRshbFlg: isInsurance,
|
|
65
|
+
consentInsuranceFlg: isSalaryClient,
|
|
66
|
+
} = participant;
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
currency: currency?.key,
|
|
70
|
+
paymentSystem,
|
|
71
|
+
cardCategory: getSelectValue(cardCategory),
|
|
72
|
+
codeWord,
|
|
73
|
+
limitedBirthday,
|
|
74
|
+
middleName,
|
|
75
|
+
name,
|
|
76
|
+
surname,
|
|
77
|
+
birthPlace,
|
|
78
|
+
dulIssueDateField,
|
|
79
|
+
dulIssuedBy,
|
|
80
|
+
dulNumber,
|
|
81
|
+
dulSerie,
|
|
82
|
+
dulSubdivisionCode,
|
|
83
|
+
education: getSelectValue(education),
|
|
84
|
+
participantDateRegistration,
|
|
85
|
+
housing: getSelectValue(housing),
|
|
86
|
+
beginDate,
|
|
87
|
+
employment: getSelectValue(employment),
|
|
88
|
+
organizationName,
|
|
89
|
+
inn,
|
|
90
|
+
employerActivities: getSelectValue(employerActivities),
|
|
91
|
+
organization: getSelectValue(organization),
|
|
92
|
+
employerOrganization: getSelectValue(employerOrganization),
|
|
93
|
+
amountWorkers: getSelectValue(amountWorkers),
|
|
94
|
+
legalForm,
|
|
95
|
+
generalSeniority: generalSeniority?.toString(),
|
|
96
|
+
experience5Years: experience5Years?.toString(),
|
|
97
|
+
jobsNumber: jobsNumber?.toString(),
|
|
98
|
+
lastJobExperience: lastJobExperience?.toString(),
|
|
99
|
+
positionOrganization: getSelectValue(positionOrganization),
|
|
100
|
+
familyStatus: getSelectValue(familyStatus),
|
|
101
|
+
children: children?.toString(),
|
|
102
|
+
familyMembers: familyMembers?.toString(),
|
|
103
|
+
dependents: dependents?.toString(),
|
|
104
|
+
conscription: getSelectValue(conscription),
|
|
105
|
+
snils,
|
|
106
|
+
armyIdFlg,
|
|
107
|
+
bankruptcyFlg,
|
|
108
|
+
shareholderFlg,
|
|
109
|
+
legalEntityName,
|
|
110
|
+
creditInRshbCd: getSelectValue(creditInRshbCd),
|
|
111
|
+
calculator: {
|
|
112
|
+
isInsurance,
|
|
113
|
+
isSalaryClient,
|
|
114
|
+
moneyValue,
|
|
115
|
+
monthsValue,
|
|
116
|
+
isAnnuity: paymentTypeCd?.key === 'ANNUITY',
|
|
117
|
+
},
|
|
118
|
+
...getParticipantIncomes(participantIncomes),
|
|
119
|
+
...getParticipantAddresses(participantAddresses),
|
|
120
|
+
...getParticipantContacts(participantContacts),
|
|
121
|
+
...getParticipantGender(genderCd),
|
|
122
|
+
};
|
|
123
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Task } from '../../api/RetailAPI/draftTasksKZO';
|
|
2
|
+
import { useDialog } from '../DialogManager/useDialog';
|
|
3
|
+
import { DraftDialog } from './DraftDialog';
|
|
4
|
+
import { EmptyDraftDialog } from './EmptyDraftDialog';
|
|
5
|
+
|
|
6
|
+
type useDraftDialogOpenProps = {
|
|
7
|
+
task?: Task;
|
|
8
|
+
isFromLead?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const useDraftDialog = () => {
|
|
13
|
+
const { open: openDraftDialog } = useDialog(DraftDialog);
|
|
14
|
+
const { open: openEmptyDraftDialog } = useDialog(EmptyDraftDialog);
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
open: ({ task, isFromLead, onClose }: useDraftDialogOpenProps) => {
|
|
18
|
+
task ? openDraftDialog({ task, isFromLead, onClose }) : openEmptyDraftDialog({});
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
import { type LeadProps } from '../../api/RetailAPI/model/LeadFormData';
|
|
3
|
+
import { type Participant } from '../../api/RetailAPI/updateUserTask';
|
|
4
|
+
import { type Option } from '../Select/Option';
|
|
5
|
+
|
|
6
|
+
export const enum EContactType {
|
|
7
|
+
MainPhone = 'MAIN_PHONE',
|
|
8
|
+
SecondPhone = 'SECOND_PHONE',
|
|
9
|
+
HomePhoneFact = 'HOME_PHONE_FACT',
|
|
10
|
+
HomePhoneReg = 'HOME_PHONE_REG',
|
|
11
|
+
OrganizationPhone = 'ORGANIZATION_PHONE',
|
|
12
|
+
EMail = 'EMAIL',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const enum EAddressType {
|
|
16
|
+
REGISTRATION = 'REGISTRATION',
|
|
17
|
+
RESIDENTAL = 'RESIDENTAL',
|
|
18
|
+
WORK = 'WORK',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const enum EIncomesType {
|
|
22
|
+
INCOME_AVERAGE = 'INCOME_AVERAGE',
|
|
23
|
+
MANDATORY_PAYMENTS = 'MANDATORY_PAYMENTS',
|
|
24
|
+
ADDITIONAL_INCOME = 'ADDITIONAL_INCOME',
|
|
25
|
+
OTHER_INCOME = 'OTHER_INCOME',
|
|
26
|
+
OTHER_PAYMENTS = 'OTHER_PAYMENTS',
|
|
27
|
+
RENTAL_INCOME = 'RENTAL_INCOME',
|
|
28
|
+
WAGES = 'WAGES',
|
|
29
|
+
RETIREMENT_INCOME = 'RETIREMENT_INCOME',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const creditCodesToProgrammIdMap = {
|
|
33
|
+
credit_cash: '10',
|
|
34
|
+
credit_cash_single_doc: '28',
|
|
35
|
+
credit_mcx: '39',
|
|
36
|
+
family_offer_credit: '41',
|
|
37
|
+
gas_engine_fuel: '33',
|
|
38
|
+
pension_credit: '12',
|
|
39
|
+
ref_credit: '11',
|
|
40
|
+
ref_credit_single_doc: '29',
|
|
41
|
+
self_employed: '34',
|
|
42
|
+
summer_cash: '35',
|
|
43
|
+
summer_cash_pens: '36',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const cardCodesToProgrammIdMap = {
|
|
47
|
+
amur_card: '14',
|
|
48
|
+
owner_card: '13',
|
|
49
|
+
travel_card: '15',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const creditProgramCodeToProductIdMap = {
|
|
53
|
+
...creditCodesToProgrammIdMap,
|
|
54
|
+
...cardCodesToProgrammIdMap,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const getParticipantIncomes = (participantIncomes: Participant['participantIncomes']) => {
|
|
58
|
+
const wages = participantIncomes?.find(
|
|
59
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.WAGES,
|
|
60
|
+
)?.value;
|
|
61
|
+
const mandatoryPayments = participantIncomes?.find(
|
|
62
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.MANDATORY_PAYMENTS,
|
|
63
|
+
)?.value;
|
|
64
|
+
const incomeAverage = participantIncomes?.find(
|
|
65
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.INCOME_AVERAGE,
|
|
66
|
+
)?.value;
|
|
67
|
+
const additionalIncome = participantIncomes?.find(
|
|
68
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.ADDITIONAL_INCOME,
|
|
69
|
+
)?.value;
|
|
70
|
+
const otherIncome = participantIncomes?.find(
|
|
71
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.OTHER_INCOME,
|
|
72
|
+
)?.value;
|
|
73
|
+
const otherPayments = participantIncomes?.find(
|
|
74
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.OTHER_PAYMENTS,
|
|
75
|
+
)?.value;
|
|
76
|
+
const rentalIncome = participantIncomes?.find(
|
|
77
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.RENTAL_INCOME,
|
|
78
|
+
)?.value;
|
|
79
|
+
const retirementIncome = participantIncomes?.find(
|
|
80
|
+
(contact) => contact.incomeTypeCd.key === EIncomesType.RETIREMENT_INCOME,
|
|
81
|
+
)?.value;
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
wages,
|
|
85
|
+
mandatoryPayments,
|
|
86
|
+
incomeAverage,
|
|
87
|
+
additionalIncome,
|
|
88
|
+
otherIncome,
|
|
89
|
+
otherPayments,
|
|
90
|
+
rentalIncome,
|
|
91
|
+
retirementIncome,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const getParticipantAddresses = (
|
|
96
|
+
participantAddresses: Participant['participantAddresses'],
|
|
97
|
+
) => {
|
|
98
|
+
const addressRegistration = participantAddresses?.find(
|
|
99
|
+
(address) => address.addressType.key === EAddressType.REGISTRATION,
|
|
100
|
+
);
|
|
101
|
+
const addressFact = participantAddresses?.find(
|
|
102
|
+
(address) => address.addressType.key === EAddressType.RESIDENTAL,
|
|
103
|
+
);
|
|
104
|
+
const organizationAddress = participantAddresses?.find(
|
|
105
|
+
(address) => address.addressType.key === EAddressType.WORK,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
addressRegistration,
|
|
110
|
+
addressFact,
|
|
111
|
+
organizationAddress,
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const getParticipantContacts = (participantContacts: Participant['participantContacts']) => {
|
|
116
|
+
const email = participantContacts?.find(
|
|
117
|
+
(contact) => contact.contactTypeCd.key === EContactType.EMail,
|
|
118
|
+
)?.value;
|
|
119
|
+
const phone = participantContacts?.find(
|
|
120
|
+
(contact) => contact.contactTypeCd.key === EContactType.MainPhone,
|
|
121
|
+
)?.value;
|
|
122
|
+
const organizationPhone = participantContacts?.find(
|
|
123
|
+
(contact) => contact.contactTypeCd.key === EContactType.OrganizationPhone,
|
|
124
|
+
)?.value;
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
email,
|
|
128
|
+
phone,
|
|
129
|
+
organizationPhone,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const getParticipantGender = (gender: Participant['genderCd']) => {
|
|
134
|
+
return gender?.key
|
|
135
|
+
? {
|
|
136
|
+
sex: gender.key === 'MAN' ? 'male' : 'female',
|
|
137
|
+
}
|
|
138
|
+
: null;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const getSelectValue = (option?: LeadProps): Option | undefined => {
|
|
142
|
+
return option?.key
|
|
143
|
+
? {
|
|
144
|
+
key: option.key,
|
|
145
|
+
text: option.value,
|
|
146
|
+
}
|
|
147
|
+
: undefined;
|
|
148
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { fetchRetailJSON } from './doRequest';
|
|
2
|
+
import { type Participant, type PaymentType } from './updateUserTask';
|
|
3
|
+
|
|
4
|
+
export type Task = {
|
|
5
|
+
courierDeliveryFlg?: boolean;
|
|
6
|
+
creditPeriod?: number;
|
|
7
|
+
creditProgram: {
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
deliveryComment?: string;
|
|
12
|
+
deliveryDate?: string;
|
|
13
|
+
deliveryTimeCd?: {
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
id: number;
|
|
17
|
+
loanAmount?: number;
|
|
18
|
+
office?: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
participants: Participant[];
|
|
22
|
+
paymentTypeCd?: PaymentType;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type DraftTaskKZOResponse = {
|
|
26
|
+
tasks: Array<Task>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const draftTasksKZO = async (): Promise<DraftTaskKZOResponse['tasks']> => {
|
|
30
|
+
const res = await fetchRetailJSON<DraftTaskKZOResponse>('/user-data/draftTasksKZO', 'GET');
|
|
31
|
+
|
|
32
|
+
return res?.tasks || [];
|
|
33
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { fetchRetailJSON } from './doRequest';
|
|
2
|
+
|
|
3
|
+
type GetLastTaskStatusBody = {
|
|
4
|
+
profileId: number;
|
|
5
|
+
programId: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type GetLastTaskStatusResponse = {
|
|
9
|
+
statusCd: string;
|
|
10
|
+
taskId: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const getLastTaskStatus = async (body: GetLastTaskStatusBody): Promise<number | null> => {
|
|
14
|
+
const res = await fetchRetailJSON<GetLastTaskStatusResponse>(
|
|
15
|
+
'/user-data/getLastStatus',
|
|
16
|
+
'POST',
|
|
17
|
+
body,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { fetchRetailJSON } from './doRequest';
|
|
2
|
+
import { type Task } from './draftTasksKZO';
|
|
3
|
+
|
|
4
|
+
type GetTaskByIdBody = {
|
|
5
|
+
taskId: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const getTaskById = async (body: GetTaskByIdBody): Promise<Task | undefined> => {
|
|
9
|
+
const res = await fetchRetailJSON<Task>('/user-data/getTaskById', 'POST', body);
|
|
10
|
+
|
|
11
|
+
return res || undefined;
|
|
12
|
+
};
|
|
@@ -52,12 +52,12 @@ export type Participant = {
|
|
|
52
52
|
midname?: string;
|
|
53
53
|
name?: string;
|
|
54
54
|
surname?: string;
|
|
55
|
-
profile
|
|
55
|
+
profile: {
|
|
56
56
|
id: number;
|
|
57
57
|
};
|
|
58
58
|
armyIdFlg?: boolean;
|
|
59
59
|
birthPlace?: string;
|
|
60
|
-
childrenDependents?:
|
|
60
|
+
childrenDependents?: string;
|
|
61
61
|
genderCd?: Option;
|
|
62
62
|
dulIssueDate?: string;
|
|
63
63
|
dulIssuedBy?: string;
|
|
@@ -68,13 +68,13 @@ export type Participant = {
|
|
|
68
68
|
employeesNumberCd?: Option;
|
|
69
69
|
employmentContractDate?: string;
|
|
70
70
|
employmentTypeCd?: Option;
|
|
71
|
-
generalSeniority?:
|
|
71
|
+
generalSeniority?: string;
|
|
72
72
|
homeMatchFlg?: boolean;
|
|
73
73
|
houseTypeCd?: Option;
|
|
74
74
|
incomeCertificateCd?: Option;
|
|
75
75
|
initiateBankruptcyFlg?: boolean;
|
|
76
|
-
jobsNumber?:
|
|
77
|
-
lastWorkDuration?:
|
|
76
|
+
jobsNumber?: string;
|
|
77
|
+
lastWorkDuration?: string;
|
|
78
78
|
maritalStatusCd?: Option;
|
|
79
79
|
militaryStatusCd?: Option;
|
|
80
80
|
organizationActivityTypeCd?: Option;
|
|
@@ -82,7 +82,7 @@ export type Participant = {
|
|
|
82
82
|
organizationKindCd?: Option;
|
|
83
83
|
organizationName?: string;
|
|
84
84
|
organizationTypeCd?: Option;
|
|
85
|
-
otherDependents?:
|
|
85
|
+
otherDependents?: string;
|
|
86
86
|
ownershipShare?: string;
|
|
87
87
|
opf?: string;
|
|
88
88
|
participantAddresses?: ParticipantAddress[];
|
|
@@ -94,14 +94,14 @@ export type Participant = {
|
|
|
94
94
|
seniority?: string;
|
|
95
95
|
seniorityInterruptionsFlg?: boolean;
|
|
96
96
|
snils?: string;
|
|
97
|
-
totalDependents?:
|
|
97
|
+
totalDependents?: string;
|
|
98
98
|
bankruptcyFlg?: boolean;
|
|
99
99
|
shareholderFlg?: boolean;
|
|
100
100
|
nameLegalEntity?: string;
|
|
101
101
|
creditInRshbCd?: Option;
|
|
102
102
|
participantContacts?: Array<{
|
|
103
103
|
contactTypeCd: {
|
|
104
|
-
key: 'EMAIL' | 'MAIN_PHONE';
|
|
104
|
+
key: 'EMAIL' | 'MAIN_PHONE' | 'ORGANIZATION_PHONE';
|
|
105
105
|
};
|
|
106
106
|
value: string;
|
|
107
107
|
}>;
|
|
@@ -84,9 +84,9 @@ export interface LeadFormState extends FormConsents, FormStateDeliveryType {
|
|
|
84
84
|
legalForm?: string;
|
|
85
85
|
organizationName?: string;
|
|
86
86
|
generalSeniority?: string;
|
|
87
|
-
lastJobExperience?:
|
|
88
|
-
experience5Years?:
|
|
89
|
-
jobsNumber?:
|
|
87
|
+
lastJobExperience?: string;
|
|
88
|
+
experience5Years?: string;
|
|
89
|
+
jobsNumber?: string;
|
|
90
90
|
organizationAddress?: Address;
|
|
91
91
|
beginDate?: Date | string;
|
|
92
92
|
addressFact?: Address;
|
|
@@ -105,9 +105,9 @@ export interface LeadFormState extends FormConsents, FormStateDeliveryType {
|
|
|
105
105
|
consentAssignmentClaimsFlg?: boolean;
|
|
106
106
|
consentCollectionFlg?: boolean;
|
|
107
107
|
familyStatus?: Option;
|
|
108
|
-
children?:
|
|
109
|
-
familyMembers?:
|
|
110
|
-
dependents?:
|
|
108
|
+
children?: string;
|
|
109
|
+
familyMembers?: string;
|
|
110
|
+
dependents?: string;
|
|
111
111
|
totalIncome?: number;
|
|
112
112
|
expenses?: number;
|
|
113
113
|
snils?: string;
|