@redneckz/wildless-cms-uni-blocks 0.14.711 → 0.14.713

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 (129) hide show
  1. package/bundle/api/RetailAPI/draftTasksKZO.d.ts +7 -0
  2. package/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -2
  3. package/bundle/api/RetailAPI/getTaskStatus.d.ts +5 -0
  4. package/bundle/api/RetailAPI/updateUserTask.d.ts +1 -5
  5. package/bundle/bundle.umd.js +26 -9
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
  8. package/dist/api/RetailAPI/draftTasksKZO.d.ts +7 -0
  9. package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -1
  10. package/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -2
  11. package/dist/api/RetailAPI/getPaymentSystems.js +5 -1
  12. package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  13. package/dist/api/RetailAPI/getTaskStatus.d.ts +5 -0
  14. package/dist/api/RetailAPI/getTaskStatus.js +5 -0
  15. package/dist/api/RetailAPI/getTaskStatus.js.map +1 -1
  16. package/dist/api/RetailAPI/updateUserTask.d.ts +1 -5
  17. package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  18. package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
  19. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -0
  20. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  21. package/dist/components/CreditCardForm/formStateMap.js +1 -1
  22. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  23. package/dist/components/CreditForm/CreditFormStatusTracker.js +3 -0
  24. package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  25. package/dist/ui-kit/DraftDialog/parseDraftTask.js +4 -2
  26. package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
  27. package/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  28. package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  29. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
  30. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  31. package/lib/api/RetailAPI/draftTasksKZO.d.ts +7 -0
  32. package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -1
  33. package/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -2
  34. package/lib/api/RetailAPI/getPaymentSystems.js +5 -1
  35. package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  36. package/lib/api/RetailAPI/getTaskStatus.d.ts +5 -0
  37. package/lib/api/RetailAPI/getTaskStatus.js +5 -0
  38. package/lib/api/RetailAPI/getTaskStatus.js.map +1 -1
  39. package/lib/api/RetailAPI/updateUserTask.d.ts +1 -5
  40. package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  41. package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
  42. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -0
  43. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  44. package/lib/components/CreditCardForm/formStateMap.js +1 -1
  45. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  46. package/lib/components/CreditForm/CreditFormStatusTracker.js +3 -0
  47. package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  48. package/lib/ui-kit/DraftDialog/parseDraftTask.js +4 -2
  49. package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
  50. package/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  51. package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  52. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
  53. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  54. package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +7 -0
  55. package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -2
  56. package/mobile/bundle/api/RetailAPI/getTaskStatus.d.ts +5 -0
  57. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +1 -5
  58. package/mobile/bundle/bundle.umd.js +26 -9
  59. package/mobile/bundle/bundle.umd.min.js +1 -1
  60. package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
  61. package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +7 -0
  62. package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -1
  63. package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -2
  64. package/mobile/dist/api/RetailAPI/getPaymentSystems.js +5 -1
  65. package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  66. package/mobile/dist/api/RetailAPI/getTaskStatus.d.ts +5 -0
  67. package/mobile/dist/api/RetailAPI/getTaskStatus.js +5 -0
  68. package/mobile/dist/api/RetailAPI/getTaskStatus.js.map +1 -1
  69. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +1 -5
  70. package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  71. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
  72. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -0
  73. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  74. package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
  75. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  76. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +3 -0
  77. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  78. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +4 -2
  79. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
  80. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  81. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  82. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
  83. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  84. package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +7 -0
  85. package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -1
  86. package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -2
  87. package/mobile/lib/api/RetailAPI/getPaymentSystems.js +5 -1
  88. package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  89. package/mobile/lib/api/RetailAPI/getTaskStatus.d.ts +5 -0
  90. package/mobile/lib/api/RetailAPI/getTaskStatus.js +5 -0
  91. package/mobile/lib/api/RetailAPI/getTaskStatus.js.map +1 -1
  92. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +1 -5
  93. package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  94. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
  95. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -0
  96. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  97. package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
  98. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  99. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +3 -0
  100. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  101. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +4 -2
  102. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
  103. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  104. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  105. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
  106. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  107. package/mobile/src/api/RetailAPI/draftTasksKZO.ts +5 -0
  108. package/mobile/src/api/RetailAPI/getPaymentSystems.ts +13 -2
  109. package/mobile/src/api/RetailAPI/getTaskStatus.ts +5 -0
  110. package/mobile/src/api/RetailAPI/updateUserTask.ts +1 -6
  111. package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +2 -2
  112. package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -0
  113. package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
  114. package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +3 -0
  115. package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +9 -5
  116. package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
  117. package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +6 -6
  118. package/package.json +1 -1
  119. package/src/api/RetailAPI/draftTasksKZO.ts +5 -0
  120. package/src/api/RetailAPI/getPaymentSystems.ts +13 -2
  121. package/src/api/RetailAPI/getTaskStatus.ts +5 -0
  122. package/src/api/RetailAPI/updateUserTask.ts +1 -6
  123. package/src/components/ApplicationLeadForm/LeadFormState.ts +2 -2
  124. package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -0
  125. package/src/components/CreditCardForm/formStateMap.tsx +1 -1
  126. package/src/components/CreditForm/CreditFormStatusTracker.tsx +3 -0
  127. package/src/ui-kit/DraftDialog/parseDraftTask.ts +9 -5
  128. package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
  129. package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +6 -6
@@ -1,5 +1,10 @@
1
+ import { type Option } from '../../ui-kit/Select/Option';
1
2
  import { fetchRetailJSON } from './doRequest';
2
- import { type PaymentSystem } from './updateUserTask';
3
+
4
+ type PaymentSystem = {
5
+ name: string;
6
+ type: string;
7
+ };
3
8
 
4
9
  type PaymentSystemResponse = {
5
10
  paymentSystems?: PaymentSystem[];
@@ -14,5 +19,11 @@ export const getPaymentSystems = async (creditProgramId: string) => {
14
19
  },
15
20
  );
16
21
 
17
- return data?.paymentSystems || [];
22
+ return formatData(data?.paymentSystems || []);
18
23
  };
24
+
25
+ const formatData = (paymentSystems: PaymentSystem[]): Option[] =>
26
+ paymentSystems.map((_) => ({
27
+ key: _.type,
28
+ text: _.name,
29
+ }));
@@ -4,6 +4,11 @@ export enum STATUS_TYPE {
4
4
  process = 'IN_PROCESS',
5
5
  ok = 'APPROVED',
6
6
  fail = 'CANCELLED',
7
+ pre_decision = 'PRE_DECISION',
8
+ approved = 'APPROVED',
9
+ cancelled = 'CANCELLED',
10
+ failed = 'FAILED',
11
+ draft = 'DRAFT',
7
12
  rework = 'REVISION',
8
13
  }
9
14
 
@@ -41,11 +41,6 @@ export type PaymentType = {
41
41
  value: string;
42
42
  };
43
43
 
44
- export type PaymentSystem = {
45
- name: string;
46
- type: string;
47
- };
48
-
49
44
  export type Participant = {
50
45
  birthDate?: string;
51
46
  id: number;
@@ -110,7 +105,7 @@ export type Participant = {
110
105
  value: string;
111
106
  };
112
107
  currencyCode?: { key: string };
113
- paymentSystemTypeCd?: PaymentSystem;
108
+ paymentSystemTypeCd?: Option;
114
109
  classCard?: Option;
115
110
  codeWord?: string;
116
111
  };
@@ -1,4 +1,4 @@
1
- import { type PaymentSystem, type PaymentType } from '../../api/RetailAPI/updateUserTask';
1
+ import { type PaymentType } from '../../api/RetailAPI/updateUserTask';
2
2
  import { type Option } from '../../ui-kit/Select/Option';
3
3
 
4
4
  export interface FormConsents {
@@ -132,7 +132,7 @@ export interface LeadFormState extends FormConsents, FormStateDeliveryType {
132
132
  addressMatch?: boolean;
133
133
  confirmationIncome?: Option;
134
134
  currency?: string;
135
- paymentSystem?: PaymentSystem;
135
+ paymentSystem?: Option;
136
136
  cardCategory?: Option;
137
137
  codeWord?: string;
138
138
  esiaAccountTypeCd?: Option;
@@ -50,7 +50,10 @@ const renderStatus = (status: STATUS_TYPE, handleExpire: () => void) => {
50
50
  const statusesMap: Record<STATUS_TYPE, VNode> = {
51
51
  IN_PROCESS: <PendingStatusContent handleExpireTimer={handleExpire} />,
52
52
  CANCELLED: <FailedStatusContent />,
53
+ FAILED: <FailedStatusContent />,
54
+ DRAFT: <FailedStatusContent />,
53
55
  APPROVED: <SuccessStatusContent />,
56
+ PRE_DECISION: <SuccessStatusContent />,
54
57
  REVISION: <ReworkStatusContent />,
55
58
  };
56
59
 
@@ -2,7 +2,7 @@ import { type LeadFormState } from '../ApplicationLeadForm/LeadFormState';
2
2
 
3
3
  export const formStateMap: Partial<LeadFormState>[] = [
4
4
  {
5
- paymentSystem: { name: '', type: '' },
5
+ paymentSystem: { key: '', text: '' },
6
6
  currency: '810',
7
7
  codeWord: '',
8
8
  },
@@ -49,7 +49,10 @@ const renderStatus = (status: STATUS_TYPE, handleExpire: () => void) => {
49
49
  const statusesMap: Record<STATUS_TYPE, VNode> = {
50
50
  IN_PROCESS: <PendingStatusContent handleExpireTimer={handleExpire} />,
51
51
  CANCELLED: <FailedStatusContent />,
52
+ FAILED: <FailedStatusContent />,
53
+ DRAFT: <FailedStatusContent />,
52
54
  APPROVED: <SuccessStatusContent />,
55
+ PRE_DECISION: <SuccessStatusContent />,
53
56
  REVISION: <ReworkStatusContent />,
54
57
  };
55
58
 
@@ -11,14 +11,16 @@ import {
11
11
 
12
12
  export const parseDraftTask = (task: Task): LeadFormState => {
13
13
  const participant = task.participants[0];
14
+ const {
15
+ classCard: cardCategory,
16
+ codeWord,
17
+ paymentSystemTypeCd: paymentSystem,
18
+ currencyCode: currency,
19
+ } = task;
14
20
 
15
21
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
16
22
 
17
23
  const {
18
- currencyCode: currency,
19
- paymentSystemTypeCd: paymentSystem,
20
- classCard: cardCategory,
21
- codeWord,
22
24
  birthDate: limitedBirthday,
23
25
  midname: middleName,
24
26
  name,
@@ -63,11 +65,12 @@ export const parseDraftTask = (task: Task): LeadFormState => {
63
65
  creditInRshbCd,
64
66
  payrollCardRshbFlg: isInsurance,
65
67
  consentInsuranceFlg: isSalaryClient,
68
+ incomeCertificateCd,
66
69
  } = participant;
67
70
 
68
71
  return {
69
72
  currency: currency?.key,
70
- paymentSystem,
73
+ paymentSystem: getSelectValue(paymentSystem),
71
74
  cardCategory: getSelectValue(cardCategory),
72
75
  codeWord,
73
76
  limitedBirthday,
@@ -102,6 +105,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
102
105
  familyMembers: familyMembers?.toString(),
103
106
  dependents: dependents?.toString(),
104
107
  conscription: getSelectValue(conscription),
108
+ confirmationIncome: getSelectValue(incomeCertificateCd),
105
109
  snils,
106
110
  armyIdFlg,
107
111
  bankruptcyFlg,
@@ -10,7 +10,7 @@ export const CardCategoryField = JSX<CustomFieldProps>(({ field, input }) => {
10
10
  const [cardTypes, setCardTypes] = useState<CardTypeData[]>([]);
11
11
  const [programId] = useLocalStorage<string>('programId');
12
12
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
13
- const selectedPaymentSystem = field('paymentSystem')?.value?.type;
13
+ const selectedPaymentSystem = field('paymentSystem')?.value?.key;
14
14
 
15
15
  useEffect(() => {
16
16
  if (selectedPaymentSystem && programId) {
@@ -1,9 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { getPaymentSystems } from '../../../api/RetailAPI/getPaymentSystems';
4
- import { type PaymentSystem } from '../../../api/RetailAPI/updateUserTask';
5
4
  import { useLocalStorage } from '../../../hooks/useLocalStorage';
6
5
  import { RadioButtonGroupControl } from '../../RadioButtonGroup/RadioButtonGroupControl';
6
+ import { type Option } from '../../Select/Option';
7
7
  import { type CustomFieldProps } from '../CustomFieldProps';
8
8
  import { validatorObj } from '../getObjectValidator';
9
9
  import { getValidation } from '../getValidation';
@@ -12,7 +12,7 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
12
12
  const { value, onChange } = field('paymentSystem');
13
13
  const [programId] = useLocalStorage<string>('programId');
14
14
 
15
- const [paymentSystemOptions, setPaymentSystemOptions] = useState<PaymentSystem[]>([]);
15
+ const [paymentSystemOptions, setPaymentSystemOptions] = useState<Option[]>([]);
16
16
 
17
17
  useEffect(() => {
18
18
  if (programId) {
@@ -24,7 +24,7 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
24
24
  }, []);
25
25
 
26
26
  const handleChange = useCallback(
27
- (type: string) => onChange?.(paymentSystemOptions?.find((_) => _.type === type)),
27
+ (type: string) => onChange?.(paymentSystemOptions?.find((_) => _.key === type)),
28
28
  [paymentSystemOptions, onChange],
29
29
  );
30
30
 
@@ -34,11 +34,11 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
34
34
  orientation="horizontal"
35
35
  items={formatPaymentSystems(paymentSystemOptions)}
36
36
  {...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required)}
37
- value={value?.type}
37
+ value={value?.key}
38
38
  onChange={handleChange}
39
39
  />
40
40
  );
41
41
  });
42
42
 
43
- const formatPaymentSystems = (paymentSystems: PaymentSystem[]) =>
44
- paymentSystems?.map((_) => ({ id: _.type, text: _.name })) ?? [];
43
+ const formatPaymentSystems = (paymentSystems: Option[]) =>
44
+ paymentSystems?.map((_) => ({ id: _.key, text: _.text })) ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.711",
3
+ "version": "0.14.713",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,7 +1,12 @@
1
+ import { type Option } from '../../ui-kit/Select/Option';
1
2
  import { fetchRetailJSON } from './doRequest';
2
3
  import { type Participant, type PaymentType } from './updateUserTask';
3
4
 
4
5
  export type Task = {
6
+ currencyCode?: { key: string };
7
+ paymentSystemTypeCd?: Option;
8
+ classCard?: Option;
9
+ codeWord?: string;
5
10
  courierDeliveryFlg?: boolean;
6
11
  creditPeriod?: number;
7
12
  creditProgram: {
@@ -1,5 +1,10 @@
1
+ import { type Option } from '../../ui-kit/Select/Option';
1
2
  import { fetchRetailJSON } from './doRequest';
2
- import { type PaymentSystem } from './updateUserTask';
3
+
4
+ type PaymentSystem = {
5
+ name: string;
6
+ type: string;
7
+ };
3
8
 
4
9
  type PaymentSystemResponse = {
5
10
  paymentSystems?: PaymentSystem[];
@@ -14,5 +19,11 @@ export const getPaymentSystems = async (creditProgramId: string) => {
14
19
  },
15
20
  );
16
21
 
17
- return data?.paymentSystems || [];
22
+ return formatData(data?.paymentSystems || []);
18
23
  };
24
+
25
+ const formatData = (paymentSystems: PaymentSystem[]): Option[] =>
26
+ paymentSystems.map((_) => ({
27
+ key: _.type,
28
+ text: _.name,
29
+ }));
@@ -4,6 +4,11 @@ export enum STATUS_TYPE {
4
4
  process = 'IN_PROCESS',
5
5
  ok = 'APPROVED',
6
6
  fail = 'CANCELLED',
7
+ pre_decision = 'PRE_DECISION',
8
+ approved = 'APPROVED',
9
+ cancelled = 'CANCELLED',
10
+ failed = 'FAILED',
11
+ draft = 'DRAFT',
7
12
  rework = 'REVISION',
8
13
  }
9
14
 
@@ -41,11 +41,6 @@ export type PaymentType = {
41
41
  value: string;
42
42
  };
43
43
 
44
- export type PaymentSystem = {
45
- name: string;
46
- type: string;
47
- };
48
-
49
44
  export type Participant = {
50
45
  birthDate?: string;
51
46
  id: number;
@@ -110,7 +105,7 @@ export type Participant = {
110
105
  value: string;
111
106
  };
112
107
  currencyCode?: { key: string };
113
- paymentSystemTypeCd?: PaymentSystem;
108
+ paymentSystemTypeCd?: Option;
114
109
  classCard?: Option;
115
110
  codeWord?: string;
116
111
  };
@@ -1,4 +1,4 @@
1
- import { type PaymentSystem, type PaymentType } from '../../api/RetailAPI/updateUserTask';
1
+ import { type PaymentType } from '../../api/RetailAPI/updateUserTask';
2
2
  import { type Option } from '../../ui-kit/Select/Option';
3
3
 
4
4
  export interface FormConsents {
@@ -132,7 +132,7 @@ export interface LeadFormState extends FormConsents, FormStateDeliveryType {
132
132
  addressMatch?: boolean;
133
133
  confirmationIncome?: Option;
134
134
  currency?: string;
135
- paymentSystem?: PaymentSystem;
135
+ paymentSystem?: Option;
136
136
  cardCategory?: Option;
137
137
  codeWord?: string;
138
138
  esiaAccountTypeCd?: Option;
@@ -50,7 +50,10 @@ const renderStatus = (status: STATUS_TYPE, handleExpire: () => void) => {
50
50
  const statusesMap: Record<STATUS_TYPE, VNode> = {
51
51
  IN_PROCESS: <PendingStatusContent handleExpireTimer={handleExpire} />,
52
52
  CANCELLED: <FailedStatusContent />,
53
+ FAILED: <FailedStatusContent />,
54
+ DRAFT: <FailedStatusContent />,
53
55
  APPROVED: <SuccessStatusContent />,
56
+ PRE_DECISION: <SuccessStatusContent />,
54
57
  REVISION: <ReworkStatusContent />,
55
58
  };
56
59
 
@@ -2,7 +2,7 @@ import { type LeadFormState } from '../ApplicationLeadForm/LeadFormState';
2
2
 
3
3
  export const formStateMap: Partial<LeadFormState>[] = [
4
4
  {
5
- paymentSystem: { name: '', type: '' },
5
+ paymentSystem: { key: '', text: '' },
6
6
  currency: '810',
7
7
  codeWord: '',
8
8
  },
@@ -49,7 +49,10 @@ const renderStatus = (status: STATUS_TYPE, handleExpire: () => void) => {
49
49
  const statusesMap: Record<STATUS_TYPE, VNode> = {
50
50
  IN_PROCESS: <PendingStatusContent handleExpireTimer={handleExpire} />,
51
51
  CANCELLED: <FailedStatusContent />,
52
+ FAILED: <FailedStatusContent />,
53
+ DRAFT: <FailedStatusContent />,
52
54
  APPROVED: <SuccessStatusContent />,
55
+ PRE_DECISION: <SuccessStatusContent />,
53
56
  REVISION: <ReworkStatusContent />,
54
57
  };
55
58
 
@@ -11,14 +11,16 @@ import {
11
11
 
12
12
  export const parseDraftTask = (task: Task): LeadFormState => {
13
13
  const participant = task.participants[0];
14
+ const {
15
+ classCard: cardCategory,
16
+ codeWord,
17
+ paymentSystemTypeCd: paymentSystem,
18
+ currencyCode: currency,
19
+ } = task;
14
20
 
15
21
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
16
22
 
17
23
  const {
18
- currencyCode: currency,
19
- paymentSystemTypeCd: paymentSystem,
20
- classCard: cardCategory,
21
- codeWord,
22
24
  birthDate: limitedBirthday,
23
25
  midname: middleName,
24
26
  name,
@@ -63,11 +65,12 @@ export const parseDraftTask = (task: Task): LeadFormState => {
63
65
  creditInRshbCd,
64
66
  payrollCardRshbFlg: isInsurance,
65
67
  consentInsuranceFlg: isSalaryClient,
68
+ incomeCertificateCd,
66
69
  } = participant;
67
70
 
68
71
  return {
69
72
  currency: currency?.key,
70
- paymentSystem,
73
+ paymentSystem: getSelectValue(paymentSystem),
71
74
  cardCategory: getSelectValue(cardCategory),
72
75
  codeWord,
73
76
  limitedBirthday,
@@ -102,6 +105,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
102
105
  familyMembers: familyMembers?.toString(),
103
106
  dependents: dependents?.toString(),
104
107
  conscription: getSelectValue(conscription),
108
+ confirmationIncome: getSelectValue(incomeCertificateCd),
105
109
  snils,
106
110
  armyIdFlg,
107
111
  bankruptcyFlg,
@@ -10,7 +10,7 @@ export const CardCategoryField = JSX<CustomFieldProps>(({ field, input }) => {
10
10
  const [cardTypes, setCardTypes] = useState<CardTypeData[]>([]);
11
11
  const [programId] = useLocalStorage<string>('programId');
12
12
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
13
- const selectedPaymentSystem = field('paymentSystem')?.value?.type;
13
+ const selectedPaymentSystem = field('paymentSystem')?.value?.key;
14
14
 
15
15
  useEffect(() => {
16
16
  if (selectedPaymentSystem && programId) {
@@ -1,9 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { getPaymentSystems } from '../../../api/RetailAPI/getPaymentSystems';
4
- import { type PaymentSystem } from '../../../api/RetailAPI/updateUserTask';
5
4
  import { useLocalStorage } from '../../../hooks/useLocalStorage';
6
5
  import { RadioButtonGroupControl } from '../../RadioButtonGroup/RadioButtonGroupControl';
6
+ import { type Option } from '../../Select/Option';
7
7
  import { type CustomFieldProps } from '../CustomFieldProps';
8
8
  import { validatorObj } from '../getObjectValidator';
9
9
  import { getValidation } from '../getValidation';
@@ -12,7 +12,7 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
12
12
  const { value, onChange } = field('paymentSystem');
13
13
  const [programId] = useLocalStorage<string>('programId');
14
14
 
15
- const [paymentSystemOptions, setPaymentSystemOptions] = useState<PaymentSystem[]>([]);
15
+ const [paymentSystemOptions, setPaymentSystemOptions] = useState<Option[]>([]);
16
16
 
17
17
  useEffect(() => {
18
18
  if (programId) {
@@ -24,7 +24,7 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
24
24
  }, []);
25
25
 
26
26
  const handleChange = useCallback(
27
- (type: string) => onChange?.(paymentSystemOptions?.find((_) => _.type === type)),
27
+ (type: string) => onChange?.(paymentSystemOptions?.find((_) => _.key === type)),
28
28
  [paymentSystemOptions, onChange],
29
29
  );
30
30
 
@@ -34,11 +34,11 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
34
34
  orientation="horizontal"
35
35
  items={formatPaymentSystems(paymentSystemOptions)}
36
36
  {...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required)}
37
- value={value?.type}
37
+ value={value?.key}
38
38
  onChange={handleChange}
39
39
  />
40
40
  );
41
41
  });
42
42
 
43
- const formatPaymentSystems = (paymentSystems: PaymentSystem[]) =>
44
- paymentSystems?.map((_) => ({ id: _.type, text: _.name })) ?? [];
43
+ const formatPaymentSystems = (paymentSystems: Option[]) =>
44
+ paymentSystems?.map((_) => ({ id: _.key, text: _.text })) ?? [];