@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.
Files changed (193) hide show
  1. package/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  2. package/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  3. package/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
  4. package/bundle/api/RetailAPI/updateUserTask.d.ts +8 -8
  5. package/bundle/bundle.umd.js +252 -30
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
  8. package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  9. package/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  10. package/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  11. package/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  12. package/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  13. package/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  14. package/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
  15. package/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  16. package/dist/api/RetailAPI/draftTasksKZO.js +9 -0
  17. package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
  18. package/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  19. package/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
  20. package/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  21. package/dist/api/RetailAPI/getTaskById.d.ts +6 -0
  22. package/dist/api/RetailAPI/getTaskById.js +9 -0
  23. package/dist/api/RetailAPI/getTaskById.js.map +1 -0
  24. package/dist/api/RetailAPI/updateUserTask.d.ts +8 -8
  25. package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
  26. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  27. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  28. package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  29. package/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
  30. package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  31. package/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  32. package/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
  33. package/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  34. package/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  35. package/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
  36. package/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  37. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  38. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
  39. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  40. package/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  41. package/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
  42. package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  43. package/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  44. package/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
  45. package/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  46. package/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
  47. package/dist/ui-kit/DraftDialog/utils.js +85 -0
  48. package/dist/ui-kit/DraftDialog/utils.js.map +1 -0
  49. package/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  50. package/lib/api/RetailAPI/draftTasksKZO.js +6 -0
  51. package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
  52. package/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  53. package/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
  54. package/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  55. package/lib/api/RetailAPI/getTaskById.d.ts +6 -0
  56. package/lib/api/RetailAPI/getTaskById.js +6 -0
  57. package/lib/api/RetailAPI/getTaskById.js.map +1 -0
  58. package/lib/api/RetailAPI/updateUserTask.d.ts +8 -8
  59. package/lib/common.css +1 -1
  60. package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
  61. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  62. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  63. package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  64. package/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
  65. package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  66. package/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  67. package/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
  68. package/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  69. package/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  70. package/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
  71. package/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  72. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  73. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
  74. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  75. package/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  76. package/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
  77. package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  78. package/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  79. package/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
  80. package/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  81. package/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
  82. package/lib/ui-kit/DraftDialog/utils.js +78 -0
  83. package/lib/ui-kit/DraftDialog/utils.js.map +1 -0
  84. package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  85. package/mobile/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  86. package/mobile/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
  87. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +8 -8
  88. package/mobile/bundle/bundle.umd.js +252 -30
  89. package/mobile/bundle/bundle.umd.min.js +1 -1
  90. package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
  91. package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  92. package/mobile/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  93. package/mobile/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  94. package/mobile/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  95. package/mobile/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  96. package/mobile/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  97. package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
  98. package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  99. package/mobile/dist/api/RetailAPI/draftTasksKZO.js +9 -0
  100. package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
  101. package/mobile/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  102. package/mobile/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
  103. package/mobile/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  104. package/mobile/dist/api/RetailAPI/getTaskById.d.ts +6 -0
  105. package/mobile/dist/api/RetailAPI/getTaskById.js +9 -0
  106. package/mobile/dist/api/RetailAPI/getTaskById.js.map +1 -0
  107. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +8 -8
  108. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
  109. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  110. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  111. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  112. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
  113. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  114. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  115. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
  116. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  117. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  118. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
  119. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  120. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  121. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
  122. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  123. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  124. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
  125. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  126. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  127. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
  128. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  129. package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
  130. package/mobile/dist/ui-kit/DraftDialog/utils.js +85 -0
  131. package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -0
  132. package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  133. package/mobile/lib/api/RetailAPI/draftTasksKZO.js +6 -0
  134. package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
  135. package/mobile/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  136. package/mobile/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
  137. package/mobile/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  138. package/mobile/lib/api/RetailAPI/getTaskById.d.ts +6 -0
  139. package/mobile/lib/api/RetailAPI/getTaskById.js +6 -0
  140. package/mobile/lib/api/RetailAPI/getTaskById.js.map +1 -0
  141. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +8 -8
  142. package/mobile/lib/common.css +1 -1
  143. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
  144. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  145. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  146. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  147. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
  148. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  149. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  150. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
  151. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  152. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  153. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
  154. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  155. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  156. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
  157. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  158. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  159. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
  160. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  161. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  162. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
  163. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  164. package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
  165. package/mobile/lib/ui-kit/DraftDialog/utils.js +78 -0
  166. package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -0
  167. package/mobile/src/api/RetailAPI/draftTasksKZO.ts +33 -0
  168. package/mobile/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
  169. package/mobile/src/api/RetailAPI/getTaskById.ts +12 -0
  170. package/mobile/src/api/RetailAPI/updateUserTask.ts +8 -8
  171. package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +6 -6
  172. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
  173. package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
  174. package/mobile/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
  175. package/mobile/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
  176. package/mobile/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
  177. package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
  178. package/mobile/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
  179. package/mobile/src/ui-kit/DraftDialog/utils.ts +148 -0
  180. package/package.json +1 -1
  181. package/src/api/RetailAPI/draftTasksKZO.ts +33 -0
  182. package/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
  183. package/src/api/RetailAPI/getTaskById.ts +12 -0
  184. package/src/api/RetailAPI/updateUserTask.ts +8 -8
  185. package/src/components/ApplicationLeadForm/LeadFormState.ts +6 -6
  186. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
  187. package/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
  188. package/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
  189. package/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
  190. package/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
  191. package/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
  192. package/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
  193. package/src/ui-kit/DraftDialog/utils.ts +148 -0
@@ -0,0 +1,26 @@
1
+ import { type Participant, type PaymentType } from './updateUserTask';
2
+ export declare type Task = {
3
+ courierDeliveryFlg?: boolean;
4
+ creditPeriod?: number;
5
+ creditProgram: {
6
+ code: string;
7
+ name: string;
8
+ };
9
+ deliveryComment?: string;
10
+ deliveryDate?: string;
11
+ deliveryTimeCd?: {
12
+ value: string;
13
+ };
14
+ id: number;
15
+ loanAmount?: number;
16
+ office?: {
17
+ id: string;
18
+ };
19
+ participants: Participant[];
20
+ paymentTypeCd?: PaymentType;
21
+ };
22
+ declare type DraftTaskKZOResponse = {
23
+ tasks: Array<Task>;
24
+ };
25
+ export declare const draftTasksKZO: () => Promise<DraftTaskKZOResponse['tasks']>;
26
+ export {};
@@ -0,0 +1,6 @@
1
+ declare type GetLastTaskStatusBody = {
2
+ profileId: number;
3
+ programId: string;
4
+ };
5
+ export declare const getLastTaskStatus: (body: GetLastTaskStatusBody) => Promise<number | null>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type Task } from './draftTasksKZO';
2
+ declare type GetTaskByIdBody = {
3
+ taskId: number;
4
+ };
5
+ export declare const getTaskById: (body: GetTaskByIdBody) => Promise<Task | undefined>;
6
+ export {};
@@ -38,12 +38,12 @@ export declare type Participant = {
38
38
  midname?: string;
39
39
  name?: string;
40
40
  surname?: string;
41
- profile?: {
41
+ profile: {
42
42
  id: number;
43
43
  };
44
44
  armyIdFlg?: boolean;
45
45
  birthPlace?: string;
46
- childrenDependents?: number;
46
+ childrenDependents?: string;
47
47
  genderCd?: Option;
48
48
  dulIssueDate?: string;
49
49
  dulIssuedBy?: string;
@@ -54,13 +54,13 @@ export declare type Participant = {
54
54
  employeesNumberCd?: Option;
55
55
  employmentContractDate?: string;
56
56
  employmentTypeCd?: Option;
57
- generalSeniority?: number;
57
+ generalSeniority?: string;
58
58
  homeMatchFlg?: boolean;
59
59
  houseTypeCd?: Option;
60
60
  incomeCertificateCd?: Option;
61
61
  initiateBankruptcyFlg?: boolean;
62
- jobsNumber?: number;
63
- lastWorkDuration?: number;
62
+ jobsNumber?: string;
63
+ lastWorkDuration?: string;
64
64
  maritalStatusCd?: Option;
65
65
  militaryStatusCd?: Option;
66
66
  organizationActivityTypeCd?: Option;
@@ -68,7 +68,7 @@ export declare type Participant = {
68
68
  organizationKindCd?: Option;
69
69
  organizationName?: string;
70
70
  organizationTypeCd?: Option;
71
- otherDependents?: number;
71
+ otherDependents?: string;
72
72
  ownershipShare?: string;
73
73
  opf?: string;
74
74
  participantAddresses?: ParticipantAddress[];
@@ -80,14 +80,14 @@ export declare type Participant = {
80
80
  seniority?: string;
81
81
  seniorityInterruptionsFlg?: boolean;
82
82
  snils?: string;
83
- totalDependents?: number;
83
+ totalDependents?: string;
84
84
  bankruptcyFlg?: boolean;
85
85
  shareholderFlg?: boolean;
86
86
  nameLegalEntity?: string;
87
87
  creditInRshbCd?: Option;
88
88
  participantContacts?: Array<{
89
89
  contactTypeCd: {
90
- key: 'EMAIL' | 'MAIN_PHONE';
90
+ key: 'EMAIL' | 'MAIN_PHONE' | 'ORGANIZATION_PHONE';
91
91
  };
92
92
  value: string;
93
93
  }>;
@@ -4449,6 +4449,16 @@
4449
4449
 
4450
4450
  const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
4451
4451
 
4452
+ const getLastTaskStatus = async (body) => {
4453
+ const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
4454
+ return res?.statusCd === 'DRAFT' ? res?.taskId : null;
4455
+ };
4456
+
4457
+ const getTaskById = async (body) => {
4458
+ const res = await fetchRetailJSON('/user-data/getTaskById', 'POST', body);
4459
+ return res || undefined;
4460
+ };
4461
+
4452
4462
  const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
4453
4463
 
4454
4464
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
@@ -4476,16 +4486,6 @@
4476
4486
  };
4477
4487
  };
4478
4488
 
4479
- const useSetter = (target, key) => useCallback((value) => {
4480
- const newValue = value instanceof Function ? value(target[key]) : value;
4481
- if (newValue !== null && newValue !== undefined) {
4482
- target[key] = newValue;
4483
- }
4484
- else {
4485
- delete target[key];
4486
- }
4487
- }, [target, key]);
4488
-
4489
4489
  const sendCode = (body) => fetchRetailJSON('/sms/sendCode', 'POST', body).then((res) => !isErrorResult(res, body.phoneNumber));
4490
4490
  const isErrorResult = (res, phoneNumber) => Boolean(res) &&
4491
4491
  typeof res !== 'string' &&
@@ -4759,6 +4759,208 @@
4759
4759
  };
4760
4760
  };
4761
4761
 
4762
+ const useLeadFormStore = () => useLocalStore();
4763
+
4764
+ const useSetter = (target, key) => useCallback((value) => {
4765
+ const newValue = value instanceof Function ? value(target[key]) : value;
4766
+ if (newValue !== null && newValue !== undefined) {
4767
+ target[key] = newValue;
4768
+ }
4769
+ else {
4770
+ delete target[key];
4771
+ }
4772
+ }, [target, key]);
4773
+
4774
+ const DraftActionButton = JSX(({ title, icon, description, onClick = noop }) => (jsxs("button", { className: "flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green", type: "button", onClick: onClick, children: [jsx(Img, { image: { src: icon }, width: "78", height: "78" }), jsxs("div", { children: [jsx(Heading, { className: "text-left", title: title, headingType: "h5" }), description ? (jsx(Paragraph, { color: "text-secondary-text", size: "text-m", children: description })) : null] })] })));
4775
+
4776
+ const creditCodesToProgrammIdMap = {
4777
+ credit_cash: '10',
4778
+ credit_cash_single_doc: '28',
4779
+ credit_mcx: '39',
4780
+ family_offer_credit: '41',
4781
+ gas_engine_fuel: '33',
4782
+ pension_credit: '12',
4783
+ ref_credit: '11',
4784
+ ref_credit_single_doc: '29',
4785
+ self_employed: '34',
4786
+ summer_cash: '35',
4787
+ summer_cash_pens: '36',
4788
+ };
4789
+ const cardCodesToProgrammIdMap = {
4790
+ amur_card: '14',
4791
+ owner_card: '13',
4792
+ travel_card: '15',
4793
+ };
4794
+ const creditProgramCodeToProductIdMap = {
4795
+ ...creditCodesToProgrammIdMap,
4796
+ ...cardCodesToProgrammIdMap,
4797
+ };
4798
+ const getParticipantIncomes$1 = (participantIncomes) => {
4799
+ const wages = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "WAGES" /* EIncomesType.WAGES */)?.value;
4800
+ const mandatoryPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "MANDATORY_PAYMENTS" /* EIncomesType.MANDATORY_PAYMENTS */)?.value;
4801
+ const incomeAverage = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "INCOME_AVERAGE" /* EIncomesType.INCOME_AVERAGE */)?.value;
4802
+ const additionalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "ADDITIONAL_INCOME" /* EIncomesType.ADDITIONAL_INCOME */)?.value;
4803
+ const otherIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_INCOME" /* EIncomesType.OTHER_INCOME */)?.value;
4804
+ const otherPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_PAYMENTS" /* EIncomesType.OTHER_PAYMENTS */)?.value;
4805
+ const rentalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RENTAL_INCOME" /* EIncomesType.RENTAL_INCOME */)?.value;
4806
+ const retirementIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RETIREMENT_INCOME" /* EIncomesType.RETIREMENT_INCOME */)?.value;
4807
+ return {
4808
+ wages,
4809
+ mandatoryPayments,
4810
+ incomeAverage,
4811
+ additionalIncome,
4812
+ otherIncome,
4813
+ otherPayments,
4814
+ rentalIncome,
4815
+ retirementIncome,
4816
+ };
4817
+ };
4818
+ const getParticipantAddresses$1 = (participantAddresses) => {
4819
+ const addressRegistration = participantAddresses?.find((address) => address.addressType.key === "REGISTRATION" /* EAddressType.REGISTRATION */);
4820
+ const addressFact = participantAddresses?.find((address) => address.addressType.key === "RESIDENTAL" /* EAddressType.RESIDENTAL */);
4821
+ const organizationAddress = participantAddresses?.find((address) => address.addressType.key === "WORK" /* EAddressType.WORK */);
4822
+ return {
4823
+ addressRegistration,
4824
+ addressFact,
4825
+ organizationAddress,
4826
+ };
4827
+ };
4828
+ const getParticipantContacts$1 = (participantContacts) => {
4829
+ const email = participantContacts?.find((contact) => contact.contactTypeCd.key === "EMAIL" /* EContactType.EMail */)?.value;
4830
+ const phone = participantContacts?.find((contact) => contact.contactTypeCd.key === "MAIN_PHONE" /* EContactType.MainPhone */)?.value;
4831
+ const organizationPhone = participantContacts?.find((contact) => contact.contactTypeCd.key === "ORGANIZATION_PHONE" /* EContactType.OrganizationPhone */)?.value;
4832
+ return {
4833
+ email,
4834
+ phone,
4835
+ organizationPhone,
4836
+ };
4837
+ };
4838
+ const getParticipantGender = (gender) => {
4839
+ return gender?.key
4840
+ ? {
4841
+ sex: gender.key === 'MAN' ? 'male' : 'female',
4842
+ }
4843
+ : null;
4844
+ };
4845
+ const getSelectValue = (option) => {
4846
+ return option?.key
4847
+ ? {
4848
+ key: option.key,
4849
+ text: option.value,
4850
+ }
4851
+ : undefined;
4852
+ };
4853
+
4854
+ const parseDraftTask = (task) => {
4855
+ const participant = task.participants[0];
4856
+ const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
4857
+ const { currencyCode: currency, paymentSystemTypeCd: paymentSystem, classCard: cardCategory, codeWord, birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDateField, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, } = participant;
4858
+ return {
4859
+ currency: currency?.key,
4860
+ paymentSystem,
4861
+ cardCategory: getSelectValue(cardCategory),
4862
+ codeWord,
4863
+ limitedBirthday,
4864
+ middleName,
4865
+ name,
4866
+ surname,
4867
+ birthPlace,
4868
+ dulIssueDateField,
4869
+ dulIssuedBy,
4870
+ dulNumber,
4871
+ dulSerie,
4872
+ dulSubdivisionCode,
4873
+ education: getSelectValue(education),
4874
+ participantDateRegistration,
4875
+ housing: getSelectValue(housing),
4876
+ beginDate,
4877
+ employment: getSelectValue(employment),
4878
+ organizationName,
4879
+ inn,
4880
+ employerActivities: getSelectValue(employerActivities),
4881
+ organization: getSelectValue(organization),
4882
+ employerOrganization: getSelectValue(employerOrganization),
4883
+ amountWorkers: getSelectValue(amountWorkers),
4884
+ legalForm,
4885
+ generalSeniority: generalSeniority?.toString(),
4886
+ experience5Years: experience5Years?.toString(),
4887
+ jobsNumber: jobsNumber?.toString(),
4888
+ lastJobExperience: lastJobExperience?.toString(),
4889
+ positionOrganization: getSelectValue(positionOrganization),
4890
+ familyStatus: getSelectValue(familyStatus),
4891
+ children: children?.toString(),
4892
+ familyMembers: familyMembers?.toString(),
4893
+ dependents: dependents?.toString(),
4894
+ conscription: getSelectValue(conscription),
4895
+ snils,
4896
+ armyIdFlg,
4897
+ bankruptcyFlg,
4898
+ shareholderFlg,
4899
+ legalEntityName,
4900
+ creditInRshbCd: getSelectValue(creditInRshbCd),
4901
+ calculator: {
4902
+ isInsurance,
4903
+ isSalaryClient,
4904
+ moneyValue,
4905
+ monthsValue,
4906
+ isAnnuity: paymentTypeCd?.key === 'ANNUITY',
4907
+ },
4908
+ ...getParticipantIncomes$1(participantIncomes),
4909
+ ...getParticipantAddresses$1(participantAddresses),
4910
+ ...getParticipantContacts$1(participantContacts),
4911
+ ...getParticipantGender(genderCd),
4912
+ };
4913
+ };
4914
+
4915
+ const DraftDialog = JSX(function ({ task, isFromLead = false, onClose = noop, }) {
4916
+ const leadFormStore = useLeadFormStore();
4917
+ const saveForm = useSetter(leadFormStore, 'leadForm');
4918
+ const navigator = locationNavigator();
4919
+ const { participants, creditProgram, id: taskId } = task;
4920
+ const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
4921
+ const isCredit = Boolean(creditCodesToProgrammIdMap[creditProgram.code]);
4922
+ const nextStepLink = isCredit ? '/credit-lead' : '/credit-card-lead';
4923
+ const { name, midname, id: participantId, profile } = participants[0];
4924
+ const handleGoToDraft = useCallback(() => {
4925
+ const taskFromDraft = parseDraftTask(task);
4926
+ leadFormStore.participantId = participantId;
4927
+ leadFormStore.taskId = taskId;
4928
+ leadFormStore.profileId = profile?.id;
4929
+ leadFormStore.programId = programmId;
4930
+ saveForm(taskFromDraft);
4931
+ navigator.assign(nextStepLink);
4932
+ }, []);
4933
+ const handleGoToNewTask = useCallback(() => {
4934
+ navigator.assign(isCredit ? '/natural/loans/all-goals' : '/natural/creditcards/svoya');
4935
+ }, []);
4936
+ const handleGoToMainPage = useCallback(() => {
4937
+ navigator.assign('/');
4938
+ }, []);
4939
+ const appeal = name && midname ? `${name} ${midname}, ` : '';
4940
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "whitespace-pre-wrap", title: `${appeal}мы нашли черновик вашей заявки.\nПродолжите заполнение?`, headingType: "h5" }), jsx(DraftActionButton, { title: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0443", icon: "api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg", description: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u0439\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u0437 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", onClick: handleGoToDraft }), jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Заполнить новую заявку', icon: "api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg", onClick: isFromLead ? onClose : handleGoToNewTask }), jsx(Button, { type: "button", version: "secondary", className: "w-full text-h5", onClick: handleGoToMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
4941
+ });
4942
+
4943
+ const EmptyDraftDialog = JSX(function ({ onClose = noop }) {
4944
+ const navigator = locationNavigator();
4945
+ const handleGoNewTask = useCallback(() => {
4946
+ navigator.assign('/natural/loans/all-goals');
4947
+ }, []);
4948
+ const handleGoMainPage = useCallback(() => {
4949
+ navigator.assign('/');
4950
+ }, []);
4951
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "text-center", title: "\u0417\u0430\u044F\u0432\u043A\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B", headingType: "h3" }), jsx(Paragraph, { size: "text-l", align: "text-center", children: "\u041F\u043E \u0434\u0430\u043D\u043D\u043E\u043C\u0443 \u043D\u043E\u043C\u0435\u0440\u0443 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043D\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044B\u0445 \u0437\u0430\u044F\u0432\u043E\u043A. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u043B\u0438 \u0432\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443" }), jsx(Button, { type: "button", className: "w-full", onClick: handleGoNewTask, children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443" }), jsx(Button, { type: "button", version: "secondary", className: "w-full", onClick: handleGoMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
4952
+ });
4953
+
4954
+ const useDraftDialog = () => {
4955
+ const { open: openDraftDialog } = useDialog(DraftDialog);
4956
+ const { open: openEmptyDraftDialog } = useDialog(EmptyDraftDialog);
4957
+ return {
4958
+ open: ({ task, isFromLead, onClose }) => {
4959
+ task ? openDraftDialog({ task, isFromLead, onClose }) : openEmptyDraftDialog({});
4960
+ },
4961
+ };
4962
+ };
4963
+
4762
4964
  const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
4763
4965
 
4764
4966
  const EsiaLoginDialog = JSX(({ onClose }) => {
@@ -4890,22 +5092,26 @@
4890
5092
  };
4891
5093
  };
4892
5094
 
4893
- const useLeadFormStore = () => useLocalStore();
4894
-
4895
- const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
4896
- const [responseStatus, setResponseStatus] = useState('');
5095
+ const useSaveUserData = () => {
4897
5096
  const leadFormStore = useLeadFormStore();
4898
5097
  const saveForm = useSetter(leadFormStore, 'leadForm');
4899
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
4900
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
4901
- const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
4902
- const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber }) => {
5098
+ const saveUserData = useCallback(({ participantId, taskId, profileId, formData, programId: programNumber }) => {
4903
5099
  leadFormStore.participantId = participantId;
4904
5100
  leadFormStore.taskId = taskId;
4905
5101
  leadFormStore.profileId = profileId;
4906
5102
  leadFormStore.programId = programNumber;
5103
+ saveForm(formData);
4907
5104
  }, []);
4908
- // eslint-disable-next-line consistent-return
5105
+ return saveUserData;
5106
+ };
5107
+
5108
+ const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
5109
+ const [responseStatus, setResponseStatus] = useState('');
5110
+ const saveUserData = useSaveUserData();
5111
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5112
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5113
+ const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5114
+ const draftDialog = useDraftDialog();
4909
5115
  const handleSubmit = useCallback(async (formData) => {
4910
5116
  const feedbackValidator = objectValidator(getObjectValidator(inputs));
4911
5117
  if (!isValidationSuccess(feedbackValidator(formData))) {
@@ -4916,17 +5122,34 @@
4916
5122
  profile: { phone: formatPhone(formData.phone) },
4917
5123
  });
4918
5124
  if (profileId && formData?.phone) {
5125
+ const sendCurrentTask = async () => {
5126
+ await updateUserData({
5127
+ programId,
5128
+ profileId,
5129
+ formData,
5130
+ saveUserData,
5131
+ });
5132
+ verifyPhoneDialog.close();
5133
+ consentBkiDialog.open(formData.phone, profileId);
5134
+ };
4919
5135
  const handleSuccessVerify = async () => {
4920
5136
  try {
4921
- await updateUserData({
4922
- programId,
5137
+ const lastTaskId = await getLastTaskStatus({
4923
5138
  profileId,
4924
- formData,
4925
- saveUserData,
4926
- saveForm,
5139
+ programId,
4927
5140
  });
4928
- verifyPhoneDialog.close();
4929
- consentBkiDialog.open(formData.phone, profileId);
5141
+ if (lastTaskId) {
5142
+ const task = await getTaskById({ taskId: lastTaskId });
5143
+ verifyPhoneDialog.close();
5144
+ draftDialog.open({
5145
+ task,
5146
+ isFromLead: true,
5147
+ onClose: sendCurrentTask,
5148
+ });
5149
+ }
5150
+ else {
5151
+ await sendCurrentTask();
5152
+ }
4930
5153
  }
4931
5154
  catch {
4932
5155
  setResponseStatus('Fail');
@@ -4951,7 +5174,7 @@
4951
5174
  responseStatus,
4952
5175
  };
4953
5176
  };
4954
- const updateUserData = async ({ programId, profileId, formData, saveUserData, saveForm, }) => {
5177
+ const updateUserData = async ({ programId, profileId, formData, saveUserData, }) => {
4955
5178
  const transformedForm = transformOtherConsentsField(formData);
4956
5179
  await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
4957
5180
  const { taskId, participantId } = await createDraftTask({
@@ -4969,8 +5192,7 @@
4969
5192
  catch (ex) {
4970
5193
  console.log(ex);
4971
5194
  }
4972
- saveUserData({ participantId, taskId, profileId, programId });
4973
- saveForm(formData);
5195
+ saveUserData({ participantId, taskId, profileId, programId, formData });
4974
5196
  };
4975
5197
  const transformOtherConsentsField = (formData) => {
4976
5198
  const { consentOthersFlg, ...form } = formData;
@@ -10544,7 +10766,7 @@
10544
10766
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10545
10767
  });
10546
10768
 
10547
- const packageVersion = "0.14.699";
10769
+ const packageVersion = "0.14.700";
10548
10770
 
10549
10771
  exports.Blocks = Blocks;
10550
10772
  exports.ContentPage = ContentPage;