@redneckz/wildless-cms-uni-blocks 0.14.952 → 0.14.953
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +170 -58
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/utils/calculateInputs.d.ts +1 -1
- package/bundle/retail/utils/renderStep.d.ts +1 -2
- package/bundle/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/dist/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +1 -2
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +52 -8
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/DebitForm/DebitFormStep.js +1 -2
- package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/dist/retail/adaptors/getEmploymentData.js +25 -21
- package/dist/retail/adaptors/getEmploymentData.js.map +1 -1
- package/dist/retail/utils/calculateInputs.d.ts +1 -1
- package/dist/retail/utils/calculateInputs.js +2 -6
- package/dist/retail/utils/calculateInputs.js.map +1 -1
- package/dist/retail/utils/renderStep.d.ts +1 -2
- package/dist/retail/utils/renderStep.js +2 -2
- package/dist/retail/utils/renderStep.js.map +1 -1
- package/dist/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/dist/retail/validator/getRetailFormValidator.js +1 -1
- package/dist/retail/validator/getRetailFormValidator.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +1 -2
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +52 -8
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/DebitForm/DebitFormStep.js +1 -2
- package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/lib/retail/adaptors/getEmploymentData.js +25 -21
- package/lib/retail/adaptors/getEmploymentData.js.map +1 -1
- package/lib/retail/utils/calculateInputs.d.ts +1 -1
- package/lib/retail/utils/calculateInputs.js +2 -6
- package/lib/retail/utils/calculateInputs.js.map +1 -1
- package/lib/retail/utils/renderStep.d.ts +1 -2
- package/lib/retail/utils/renderStep.js +2 -2
- package/lib/retail/utils/renderStep.js.map +1 -1
- package/lib/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/lib/retail/validator/getRetailFormValidator.js +1 -1
- package/lib/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +170 -58
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/utils/calculateInputs.d.ts +1 -1
- package/mobile/bundle/retail/utils/renderStep.d.ts +1 -2
- package/mobile/bundle/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +1 -2
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +52 -8
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/DebitForm/DebitFormStep.js +1 -2
- package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/dist/retail/adaptors/getEmploymentData.js +25 -21
- package/mobile/dist/retail/adaptors/getEmploymentData.js.map +1 -1
- package/mobile/dist/retail/utils/calculateInputs.d.ts +1 -1
- package/mobile/dist/retail/utils/calculateInputs.js +2 -6
- package/mobile/dist/retail/utils/calculateInputs.js.map +1 -1
- package/mobile/dist/retail/utils/renderStep.d.ts +1 -2
- package/mobile/dist/retail/utils/renderStep.js +2 -2
- package/mobile/dist/retail/utils/renderStep.js.map +1 -1
- package/mobile/dist/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/mobile/dist/retail/validator/getRetailFormValidator.js +1 -1
- package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +1 -2
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +52 -8
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/DebitForm/DebitFormStep.js +1 -2
- package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/lib/retail/adaptors/getEmploymentData.js +25 -21
- package/mobile/lib/retail/adaptors/getEmploymentData.js.map +1 -1
- package/mobile/lib/retail/utils/calculateInputs.d.ts +1 -1
- package/mobile/lib/retail/utils/calculateInputs.js +2 -6
- package/mobile/lib/retail/utils/calculateInputs.js.map +1 -1
- package/mobile/lib/retail/utils/renderStep.d.ts +1 -2
- package/mobile/lib/retail/utils/renderStep.js +2 -2
- package/mobile/lib/retail/utils/renderStep.js.map +1 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/mobile/lib/retail/validator/getRetailFormValidator.js +1 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +1 -2
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +84 -13
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +1 -2
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +52 -8
- package/mobile/src/components/DebitForm/DebitFormStep.tsx +1 -2
- package/mobile/src/retail/adaptors/getEmploymentData.tsx +25 -21
- package/mobile/src/retail/utils/calculateInputs.ts +2 -10
- package/mobile/src/retail/utils/renderStep.tsx +1 -3
- package/mobile/src/retail/validator/getRetailFormValidator.ts +1 -3
- package/package.json +1 -1
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +1 -2
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +84 -13
- package/src/components/CreditForm/CreditFormStep.tsx +1 -2
- package/src/components/CreditForm/creditFormStepsData.tsx +52 -8
- package/src/components/DebitForm/DebitFormStep.tsx +1 -2
- package/src/retail/adaptors/getEmploymentData.tsx +25 -21
- package/src/retail/utils/calculateInputs.ts +2 -10
- package/src/retail/utils/renderStep.tsx +1 -3
- package/src/retail/validator/getRetailFormValidator.ts +1 -3
|
@@ -40,6 +40,7 @@ const EMPLOYMENT_CONTENT: SectionsRetailProps[] = [
|
|
|
40
40
|
label:
|
|
41
41
|
'Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, ' +
|
|
42
42
|
'если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске',
|
|
43
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
43
44
|
},
|
|
44
45
|
],
|
|
45
46
|
},
|
|
@@ -49,34 +50,69 @@ const EMPLOYMENT_CONTENT: SectionsRetailProps[] = [
|
|
|
49
50
|
{
|
|
50
51
|
columns: 2,
|
|
51
52
|
inputs: [
|
|
52
|
-
{
|
|
53
|
-
|
|
53
|
+
{
|
|
54
|
+
name: 'organizationName',
|
|
55
|
+
required: true,
|
|
56
|
+
dadata: true,
|
|
57
|
+
filledByEsia: true,
|
|
58
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'inn',
|
|
62
|
+
required: true,
|
|
63
|
+
dadata: true,
|
|
64
|
+
filledByEsia: true,
|
|
65
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
66
|
+
},
|
|
54
67
|
],
|
|
55
68
|
},
|
|
56
69
|
{
|
|
57
70
|
columns: 2,
|
|
58
71
|
inputs: [
|
|
59
|
-
{
|
|
72
|
+
{
|
|
73
|
+
name: 'amountWorkers',
|
|
74
|
+
required: true,
|
|
75
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
76
|
+
},
|
|
60
77
|
{
|
|
61
78
|
name: 'organizationPhone',
|
|
62
79
|
label: 'Телефон работодателя',
|
|
63
80
|
required: true,
|
|
81
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
64
82
|
},
|
|
65
83
|
],
|
|
66
84
|
},
|
|
67
85
|
{
|
|
68
86
|
columns: 2,
|
|
69
87
|
inputs: [
|
|
70
|
-
{
|
|
71
|
-
|
|
88
|
+
{
|
|
89
|
+
name: 'jobsNumber',
|
|
90
|
+
required: true,
|
|
91
|
+
filledByEsia: true,
|
|
92
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'beginDate',
|
|
96
|
+
required: true,
|
|
97
|
+
filledByEsia: true,
|
|
98
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
99
|
+
},
|
|
72
100
|
],
|
|
73
101
|
},
|
|
74
102
|
{
|
|
75
103
|
title: 'Адрес работодателя',
|
|
76
104
|
inputs: [],
|
|
105
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
77
106
|
},
|
|
78
107
|
{
|
|
79
|
-
inputs: [
|
|
108
|
+
inputs: [
|
|
109
|
+
{
|
|
110
|
+
name: 'organizationAddress',
|
|
111
|
+
required: true,
|
|
112
|
+
dadata: true,
|
|
113
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
114
|
+
},
|
|
115
|
+
],
|
|
80
116
|
},
|
|
81
117
|
];
|
|
82
118
|
const FAMILY_STATUS_AND_INCOME_CONTENT: SectionsRetailProps[] = [
|
|
@@ -112,12 +148,20 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: SectionsRetailProps[] = [
|
|
|
112
148
|
{
|
|
113
149
|
name: 'infoCard',
|
|
114
150
|
label: 'Сумма основного и дополнительных доходов после вычета налога',
|
|
151
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
115
152
|
},
|
|
116
153
|
],
|
|
117
154
|
},
|
|
118
155
|
{
|
|
119
156
|
columns: 1,
|
|
120
|
-
inputs: [
|
|
157
|
+
inputs: [
|
|
158
|
+
{
|
|
159
|
+
name: 'wages',
|
|
160
|
+
required: true,
|
|
161
|
+
filledByEsia: true,
|
|
162
|
+
condition: { name: 'employment', values: ['WORK', 'WORK_RETIREE'] },
|
|
163
|
+
},
|
|
164
|
+
],
|
|
121
165
|
},
|
|
122
166
|
{
|
|
123
167
|
columns: 1,
|
|
@@ -125,7 +169,7 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: SectionsRetailProps[] = [
|
|
|
125
169
|
{
|
|
126
170
|
name: 'retirementIncome',
|
|
127
171
|
required: true,
|
|
128
|
-
condition: { name: 'employment', values: ['RETIREE'] },
|
|
172
|
+
condition: { name: 'employment', values: ['RETIREE', 'WORK_RETIREE'] },
|
|
129
173
|
},
|
|
130
174
|
],
|
|
131
175
|
},
|
|
@@ -32,7 +32,6 @@ export const DebitFormStep = JSX<DebitFormStepProps>(
|
|
|
32
32
|
getRetailFormValidator({
|
|
33
33
|
formState,
|
|
34
34
|
inputs,
|
|
35
|
-
step,
|
|
36
35
|
productType: PRODUCT_TYPE,
|
|
37
36
|
}),
|
|
38
37
|
[inputs],
|
|
@@ -51,7 +50,7 @@ export const DebitFormStep = JSX<DebitFormStepProps>(
|
|
|
51
50
|
|
|
52
51
|
return (
|
|
53
52
|
<form onSubmit={handleSubmit} className="space-y-m">
|
|
54
|
-
{renderStep({ sections, field
|
|
53
|
+
{renderStep({ sections, field })}
|
|
55
54
|
<StepsNavigationButtons step={step} isSending={isSending} onPrevStep={onPrevStep} />
|
|
56
55
|
</form>
|
|
57
56
|
);
|
|
@@ -25,25 +25,29 @@ export const getEmploymentData = (formData: LeadFormState): Partial<Participant>
|
|
|
25
25
|
partInBusiness,
|
|
26
26
|
} = formData;
|
|
27
27
|
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
return employment?.key === 'RETIREE'
|
|
29
|
+
? {
|
|
30
|
+
employmentTypeCd: employment,
|
|
31
|
+
}
|
|
32
|
+
: {
|
|
33
|
+
employmentContractDate: formatDate(beginDate || '', true),
|
|
34
|
+
employmentTypeCd: employment,
|
|
35
|
+
organizationName,
|
|
36
|
+
organizationInn: inn,
|
|
37
|
+
organizationActivityTypeCd: employerActivities?.key ? employerActivities : undefined,
|
|
38
|
+
organizationTypeCd: organization,
|
|
39
|
+
organizationKindCd: employerOrganization,
|
|
40
|
+
employeesNumberCd: amountWorkers,
|
|
41
|
+
opf: legalForm,
|
|
42
|
+
seniority: generalSeniority,
|
|
43
|
+
generalSeniority: experience5Years,
|
|
44
|
+
jobsNumber,
|
|
45
|
+
lastWorkDuration: lastJobExperience,
|
|
46
|
+
positionCd: positionOrganization?.key ? positionOrganization : undefined,
|
|
47
|
+
participantContacts: getParticipantContacts({
|
|
48
|
+
organizationPhone: organizationPhone && formatPhone(organizationPhone),
|
|
49
|
+
}),
|
|
50
|
+
participantAddresses: getParticipantAddresses({ organizationAddress }),
|
|
51
|
+
ownershipShare: positionOrganization?.key === 'BUSINESS_OWNER' ? partInBusiness : undefined,
|
|
52
|
+
};
|
|
49
53
|
};
|
|
@@ -4,14 +4,12 @@ import { type FieldRetailDef } from '../model/RetailFormContent';
|
|
|
4
4
|
|
|
5
5
|
export type GetValue = <K extends keyof LeadFormState>(name: K) => LeadFormState[K];
|
|
6
6
|
|
|
7
|
-
export const calculateInputs = (getValue: GetValue) => (inputs: FieldRetailDef[]
|
|
7
|
+
export const calculateInputs = (getValue: GetValue) => (inputs: FieldRetailDef[]) =>
|
|
8
8
|
inputs
|
|
9
9
|
.filter((_) => _)
|
|
10
10
|
.map((_) => {
|
|
11
11
|
if (
|
|
12
12
|
[
|
|
13
|
-
checkIsRetiree(step, getValue),
|
|
14
|
-
checkIsUnemployedRetiree(_, getValue),
|
|
15
13
|
checkBusinessOwner(_, getValue),
|
|
16
14
|
checkConsentPfrFlg(_, getValue),
|
|
17
15
|
checkAddressFillFromESIA(_, getValue),
|
|
@@ -25,12 +23,6 @@ export const calculateInputs = (getValue: GetValue) => (inputs: FieldRetailDef[]
|
|
|
25
23
|
return _;
|
|
26
24
|
});
|
|
27
25
|
|
|
28
|
-
const checkIsRetiree = (step: number, getValue: GetValue) =>
|
|
29
|
-
step === 2 && getValue('employment')?.key === 'RETIREE';
|
|
30
|
-
|
|
31
|
-
const checkIsUnemployedRetiree = ({ name }: FieldRetailDef, getValue: GetValue) =>
|
|
32
|
-
name === 'wages' && getValue('employment')?.key === 'RETIREE' && !getValue('inn');
|
|
33
|
-
|
|
34
26
|
const checkBusinessOwner = ({ name }: FieldRetailDef, getValue: GetValue) =>
|
|
35
27
|
name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
|
|
36
28
|
|
|
@@ -42,7 +34,7 @@ const checkAddressFact = ({ name }: FieldRetailDef, getValue: GetValue) =>
|
|
|
42
34
|
|
|
43
35
|
export const checkCondition = ({ condition }: FieldRetailDef, getValue: GetValue) =>
|
|
44
36
|
condition?.name &&
|
|
45
|
-
condition?.values?.
|
|
37
|
+
condition?.values?.every((_) => {
|
|
46
38
|
const dataValue = getValue(condition?.name);
|
|
47
39
|
|
|
48
40
|
return _ !== ((dataValue as Option)?.key ?? dataValue);
|
|
@@ -10,18 +10,16 @@ import { renderInputs } from './renderInputs';
|
|
|
10
10
|
export interface StepProps<SectionsProps extends SectionsRetailProps> {
|
|
11
11
|
sections?: SectionsProps[];
|
|
12
12
|
field: FormFieldRegisterer<LeadFormState>;
|
|
13
|
-
step: number;
|
|
14
13
|
params?: Record<string, any>;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
export const renderStep = <SectionsProps extends SectionsRetailProps>({
|
|
18
17
|
sections,
|
|
19
18
|
field,
|
|
20
|
-
step,
|
|
21
19
|
params,
|
|
22
20
|
}: StepProps<SectionsProps>) =>
|
|
23
21
|
sections?.map(({ inputs: origInputs = [], columns, title, condition }, i) => {
|
|
24
|
-
const inputs = calculateInputs(getValue(field))(origInputs
|
|
22
|
+
const inputs = calculateInputs(getValue(field))(origInputs);
|
|
25
23
|
const cleanElements = [
|
|
26
24
|
!checkCondition({ condition }, getValue(field)) ? renderTitle(title) : null,
|
|
27
25
|
...renderInputs({ field, inputs, params }),
|
|
@@ -17,17 +17,15 @@ import {
|
|
|
17
17
|
type getRetailFormValidatorProps = {
|
|
18
18
|
formState: LeadFormState;
|
|
19
19
|
inputs: FieldRetailDef[];
|
|
20
|
-
step: number;
|
|
21
20
|
productType: ProductType;
|
|
22
21
|
};
|
|
23
22
|
|
|
24
23
|
export const getRetailFormValidator = ({
|
|
25
24
|
formState,
|
|
26
25
|
inputs,
|
|
27
|
-
step,
|
|
28
26
|
productType,
|
|
29
27
|
}: getRetailFormValidatorProps) =>
|
|
30
|
-
getFormValidator(calculateInputs((_) => formState[_])(inputs
|
|
28
|
+
getFormValidator(calculateInputs((_) => formState[_])(inputs), {
|
|
31
29
|
...validatorObj,
|
|
32
30
|
limitedBirthday: getLimitedBirthdayValidation(productType),
|
|
33
31
|
dulIssueDate: passportValidator(formState.limitedBirthday as Date),
|