@redneckz/wildless-cms-uni-blocks 0.14.711 → 0.14.712
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 +7 -0
- package/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -2
- package/bundle/api/RetailAPI/updateUserTask.d.ts +1 -5
- package/bundle/bundle.umd.js +15 -9
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
- package/dist/api/RetailAPI/draftTasksKZO.d.ts +7 -0
- package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -1
- package/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -2
- package/dist/api/RetailAPI/getPaymentSystems.js +5 -1
- package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/dist/api/RetailAPI/updateUserTask.d.ts +1 -5
- package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
- package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
- package/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/ui-kit/DraftDialog/parseDraftTask.js +4 -2
- package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
- package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/lib/api/RetailAPI/draftTasksKZO.d.ts +7 -0
- package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -1
- package/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -2
- package/lib/api/RetailAPI/getPaymentSystems.js +5 -1
- package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/lib/api/RetailAPI/updateUserTask.d.ts +1 -5
- package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
- package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
- package/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/ui-kit/DraftDialog/parseDraftTask.js +4 -2
- package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
- package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +7 -0
- package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -2
- package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +1 -5
- package/mobile/bundle/bundle.umd.js +15 -9
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
- package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +7 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -1
- package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -2
- package/mobile/dist/api/RetailAPI/getPaymentSystems.js +5 -1
- package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +1 -5
- package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
- package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +4 -2
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +7 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -1
- package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -2
- package/mobile/lib/api/RetailAPI/getPaymentSystems.js +5 -1
- package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +1 -5
- package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +2 -2
- package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +4 -2
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +3 -3
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/src/api/RetailAPI/draftTasksKZO.ts +5 -0
- package/mobile/src/api/RetailAPI/getPaymentSystems.ts +13 -2
- package/mobile/src/api/RetailAPI/updateUserTask.ts +1 -6
- package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +2 -2
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +9 -5
- package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +6 -6
- package/package.json +1 -1
- package/src/api/RetailAPI/draftTasksKZO.ts +5 -0
- package/src/api/RetailAPI/getPaymentSystems.ts +13 -2
- package/src/api/RetailAPI/updateUserTask.ts +1 -6
- package/src/components/ApplicationLeadForm/LeadFormState.ts +2 -2
- package/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/src/ui-kit/DraftDialog/parseDraftTask.ts +9 -5
- package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
- package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +6 -6
|
@@ -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
|
-
|
|
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
|
+
}));
|
|
@@ -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?:
|
|
108
|
+
paymentSystemTypeCd?: Option;
|
|
114
109
|
classCard?: Option;
|
|
115
110
|
codeWord?: string;
|
|
116
111
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
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?:
|
|
135
|
+
paymentSystem?: Option;
|
|
136
136
|
cardCategory?: Option;
|
|
137
137
|
codeWord?: string;
|
|
138
138
|
esiaAccountTypeCd?: Option;
|
|
@@ -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?.
|
|
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<
|
|
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((_) => _.
|
|
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?.
|
|
37
|
+
value={value?.key}
|
|
38
38
|
onChange={handleChange}
|
|
39
39
|
/>
|
|
40
40
|
);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
const formatPaymentSystems = (paymentSystems:
|
|
44
|
-
paymentSystems?.map((_) => ({ id: _.
|
|
43
|
+
const formatPaymentSystems = (paymentSystems: Option[]) =>
|
|
44
|
+
paymentSystems?.map((_) => ({ id: _.key, text: _.text })) ?? [];
|