@redneckz/wildless-cms-uni-blocks 0.14.722 → 0.14.724
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +136 -151
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
- package/bundle/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
- package/bundle/hooks/useRetailFormStore.d.ts +2 -0
- package/bundle/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
- package/bundle/ui-kit/DraftDialog/utils.d.ts +1 -1
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/dist/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
- package/dist/components/CreditCardForm/SuccessStatusCardContent.js +37 -0
- package/dist/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +0 -1
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/hooks/useRetailFormStore.d.ts +2 -0
- package/dist/hooks/useRetailFormStore.js.map +1 -1
- package/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
- package/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js +5 -3
- package/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/dist/ui-kit/DraftDialog/utils.d.ts +1 -1
- package/dist/ui-kit/DraftDialog/utils.js +2 -1
- package/dist/ui-kit/DraftDialog/utils.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
- package/dist/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/WagesField.js +1 -10
- package/dist/ui-kit/FormField/Fields/WagesField.js.map +1 -1
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/lib/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
- package/lib/components/CreditCardForm/SuccessStatusCardContent.js +35 -0
- package/lib/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +0 -1
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/hooks/useRetailFormStore.d.ts +2 -0
- package/lib/hooks/useRetailFormStore.js.map +1 -1
- package/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
- package/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js +3 -2
- package/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/lib/ui-kit/DraftDialog/utils.d.ts +1 -1
- package/lib/ui-kit/DraftDialog/utils.js +2 -1
- package/lib/ui-kit/DraftDialog/utils.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
- package/lib/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/WagesField.js +1 -10
- package/lib/ui-kit/FormField/Fields/WagesField.js.map +1 -1
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +136 -151
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
- package/mobile/bundle/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
- package/mobile/bundle/hooks/useRetailFormStore.d.ts +2 -0
- package/mobile/bundle/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
- package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
- package/mobile/dist/components/CreditCardForm/SuccessStatusCardContent.js +37 -0
- package/mobile/dist/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +0 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/hooks/useRetailFormStore.d.ts +2 -0
- package/mobile/dist/hooks/useRetailFormStore.js.map +1 -1
- package/mobile/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
- package/mobile/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js +5 -3
- package/mobile/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +1 -1
- package/mobile/dist/ui-kit/DraftDialog/utils.js +2 -1
- package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
- package/mobile/dist/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/WagesField.js +1 -10
- package/mobile/dist/ui-kit/FormField/Fields/WagesField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
- package/mobile/lib/components/CreditCardForm/SuccessStatusCardContent.js +35 -0
- package/mobile/lib/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +0 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/hooks/useRetailFormStore.d.ts +2 -0
- package/mobile/lib/hooks/useRetailFormStore.js.map +1 -1
- package/mobile/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
- package/mobile/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js +3 -2
- package/mobile/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +1 -1
- package/mobile/lib/ui-kit/DraftDialog/utils.js +2 -1
- package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
- package/mobile/lib/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/WagesField.js +1 -10
- package/mobile/lib/ui-kit/FormField/Fields/WagesField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +0 -1
- package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -3
- package/mobile/src/components/CreditCardForm/SuccessStatusCardContent.tsx +45 -0
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +2 -5
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +0 -1
- package/mobile/src/hooks/useRetailFormStore.tsx +2 -0
- package/mobile/src/services/retail/adaptors/getFamilyStatusAndIncomeData.ts +4 -2
- package/mobile/src/ui-kit/DraftDialog/utils.ts +2 -3
- package/mobile/src/ui-kit/FormField/Fields/RetirementIncomeField.tsx +9 -25
- package/mobile/src/ui-kit/FormField/Fields/WagesField.tsx +9 -25
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +0 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/LeadFormState.ts +0 -1
- package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -3
- package/src/components/CreditCardForm/SuccessStatusCardContent.tsx +45 -0
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +2 -5
- package/src/components/CreditForm/useCreditFormAPI.tsx +0 -1
- package/src/hooks/useRetailFormStore.tsx +2 -0
- package/src/services/retail/adaptors/getFamilyStatusAndIncomeData.ts +4 -2
- package/src/ui-kit/DraftDialog/utils.ts +2 -3
- package/src/ui-kit/FormField/Fields/RetirementIncomeField.tsx +9 -25
- package/src/ui-kit/FormField/Fields/WagesField.tsx +9 -25
- package/src/ui-kit/FormField/NameFieldDef.ts +0 -1
- package/bundle/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
- package/dist/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
- package/dist/components/CreditCardForm/SuccessStatusContent.js +0 -32
- package/dist/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
- package/lib/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
- package/lib/components/CreditCardForm/SuccessStatusContent.js +0 -30
- package/lib/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
- package/mobile/bundle/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js +0 -32
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js +0 -30
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
- package/mobile/src/components/CreditCardForm/SuccessStatusContent.tsx +0 -37
- package/src/components/CreditCardForm/SuccessStatusContent.tsx +0 -37
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { countIncomeAverage } from '../../services/retail/adaptors/getFamilyStatusAndIncomeData.js';
|
|
1
2
|
export const creditCodesToProgrammIdMap = {
|
|
2
3
|
credit_cash: '10',
|
|
3
4
|
credit_cash_single_doc: '28',
|
|
@@ -23,12 +24,12 @@ export const creditProgramCodeToProductIdMap = {
|
|
|
23
24
|
export const getParticipantIncomes = (participantIncomes) => {
|
|
24
25
|
const wages = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "WAGES" /* EIncomesType.WAGES */)?.value;
|
|
25
26
|
const mandatoryPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "MANDATORY_PAYMENTS" /* EIncomesType.MANDATORY_PAYMENTS */)?.value;
|
|
26
|
-
const incomeAverage = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "INCOME_AVERAGE" /* EIncomesType.INCOME_AVERAGE */)?.value;
|
|
27
27
|
const additionalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "ADDITIONAL_INCOME" /* EIncomesType.ADDITIONAL_INCOME */)?.value;
|
|
28
28
|
const otherIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_INCOME" /* EIncomesType.OTHER_INCOME */)?.value;
|
|
29
29
|
const otherPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_PAYMENTS" /* EIncomesType.OTHER_PAYMENTS */)?.value;
|
|
30
30
|
const rentalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RENTAL_INCOME" /* EIncomesType.RENTAL_INCOME */)?.value;
|
|
31
31
|
const retirementIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RETIREMENT_INCOME" /* EIncomesType.RETIREMENT_INCOME */)?.value;
|
|
32
|
+
const incomeAverage = countIncomeAverage(wages, retirementIncome);
|
|
32
33
|
return {
|
|
33
34
|
wages,
|
|
34
35
|
mandatoryPayments,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/ui-kit/DraftDialog/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/ui-kit/DraftDialog/utils.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
3
|
import { InputControl } from '../../Input/InputControl.js';
|
|
5
4
|
import { validatorObj } from '../getObjectValidator.js';
|
|
6
5
|
import { getValidation } from '../getValidation.js';
|
|
7
|
-
export const RetirementIncomeField = JSX(({ field, input }) => {
|
|
8
|
-
const currentWages = field('wages')?.value;
|
|
9
|
-
const onChange = useCallback((_) => {
|
|
10
|
-
const incomesSum = Number(_) + Number(currentWages || 0);
|
|
11
|
-
field('retirementIncome')?.onChange?.(_);
|
|
12
|
-
field('incomeAverage')?.onChange?.(String(incomesSum));
|
|
13
|
-
}, [currentWages]);
|
|
14
|
-
return (_jsx(InputControl, { label: "\u041F\u0435\u043D\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required), ...input, onChange: onChange }));
|
|
15
|
-
});
|
|
6
|
+
export const RetirementIncomeField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u041F\u0435\u043D\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required), ...input })));
|
|
16
7
|
//# sourceMappingURL=RetirementIncomeField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RetirementIncomeField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/RetirementIncomeField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"RetirementIncomeField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/RetirementIncomeField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC/E,KAAC,YAAY,IACX,KAAK,EAAC,mGAAmB,EACzB,WAAW,EAAC,6FAAkB,EAC9B,SAAS,EAAE,IAAI,KACX,aAAa,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,YAAY,CAAC,gBAAgB,EAAE,KAAK,EAAE,QAAQ,CAAC,KACxF,KAAK,GACT,CACH,CAAC,CAAC"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
3
|
import { InputControl } from '../../Input/InputControl.js';
|
|
5
4
|
import { validatorObj } from '../getObjectValidator.js';
|
|
6
5
|
import { getValidation } from '../getValidation.js';
|
|
7
|
-
export const WagesField = JSX(({ field, input }) => {
|
|
8
|
-
const currentRetirementIncome = field('retirementIncome')?.value;
|
|
9
|
-
const onChange = useCallback((_) => {
|
|
10
|
-
const incomesSum = Number(_) + Number(currentRetirementIncome || 0);
|
|
11
|
-
field('wages')?.onChange?.(_);
|
|
12
|
-
field('incomeAverage')?.onChange?.(String(incomesSum));
|
|
13
|
-
}, [currentRetirementIncome]);
|
|
14
|
-
return (_jsx(InputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('wages'), validatorObj.wages, input?.required), ...input, onChange: onChange }));
|
|
15
|
-
});
|
|
6
|
+
export const WagesField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('wages'), validatorObj.wages, input?.required), ...input })));
|
|
16
7
|
//# sourceMappingURL=WagesField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WagesField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/WagesField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"WagesField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/WagesField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACpE,KAAC,YAAY,IACX,KAAK,EAAC,2UAAkE,EACxE,WAAW,EAAC,6FAAkB,EAC9B,SAAS,EAAE,IAAI,KACX,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,KAClE,KAAK,GACT,CACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type NameFieldDef = 'surname' | 'name' | 'middleName' | 'education' | 'housing' | 'employment' | 'organization' | 'organizationPhone' | 'organizationAddress' | 'amountWorkers' | 'employerActivities' | 'employerOrganization' | 'positionOrganization' | 'dulSerie' | 'dulNumber' | 'dulIssueDateField' | 'dulSubdivisionCode' | 'dulIssuedBy' | 'email' | 'phone' | 'fullName' | 'inn' | 'comment' | 'region' | 'addressBranch' | 'typeForm' | 'registrationDate' | 'birthday' | 'limitedBirthday' | 'birthPlace' | 'sex' | 'isClient' | 'consentToReceiveMaterials' | 'acquiringType' | 'onlineCheckout' | 'posTerminal' | 'serviceDirection' | 'serviceType' | 'feedbackMethod' | 'bankEmpolee' | 'applicationDate' | 'secondaryPhone' | 'vedTypes' | 'term' | 'amount' | 'annualRevenue' | 'collectionCount' | 'desiredMeetingDate' | 'product' | 'localities' | 'partnerComments' | 'consentDataProcessing' | 'consentInformFlg' | 'consentOthersFlg' | 'consentPfrFlg' | 'consentProviderFlg' | 'processPersonalDataFlg' | 'legalForm' | 'organizationName' | 'generalSeniority' | 'lastJobExperience' | 'experience5Years' | 'jobsNumber' | 'beginDate' | 'addressFact' | 'familyStatus' | 'children' | 'familyMembers' | 'dependents' | 'totalIncome' | 'expenses' | 'snils' | 'conscription' | 'armyIdFlg' | 'addressRegistration' | 'participantDateRegistration' | 'retirementIncome' | 'otherIncome' | '
|
|
1
|
+
export declare type NameFieldDef = 'surname' | 'name' | 'middleName' | 'education' | 'housing' | 'employment' | 'organization' | 'organizationPhone' | 'organizationAddress' | 'amountWorkers' | 'employerActivities' | 'employerOrganization' | 'positionOrganization' | 'dulSerie' | 'dulNumber' | 'dulIssueDateField' | 'dulSubdivisionCode' | 'dulIssuedBy' | 'email' | 'phone' | 'fullName' | 'inn' | 'comment' | 'region' | 'addressBranch' | 'typeForm' | 'registrationDate' | 'birthday' | 'limitedBirthday' | 'birthPlace' | 'sex' | 'isClient' | 'consentToReceiveMaterials' | 'acquiringType' | 'onlineCheckout' | 'posTerminal' | 'serviceDirection' | 'serviceType' | 'feedbackMethod' | 'bankEmpolee' | 'applicationDate' | 'secondaryPhone' | 'vedTypes' | 'term' | 'amount' | 'annualRevenue' | 'collectionCount' | 'desiredMeetingDate' | 'product' | 'localities' | 'partnerComments' | 'consentDataProcessing' | 'consentInformFlg' | 'consentOthersFlg' | 'consentPfrFlg' | 'consentProviderFlg' | 'processPersonalDataFlg' | 'legalForm' | 'organizationName' | 'generalSeniority' | 'lastJobExperience' | 'experience5Years' | 'jobsNumber' | 'beginDate' | 'addressFact' | 'familyStatus' | 'children' | 'familyMembers' | 'dependents' | 'totalIncome' | 'expenses' | 'snils' | 'conscription' | 'armyIdFlg' | 'addressRegistration' | 'participantDateRegistration' | 'retirementIncome' | 'otherIncome' | 'mandatoryPayments' | 'additionalIncome' | 'otherPayments' | 'rentalIncome' | 'wages' | 'creditInRshbCd' | 'disablePeopleFlg' | 'bankruptcyFlg' | 'shareholderFlg' | 'legalEntityName' | 'bankEmployeeCode' | 'partInBusiness' | 'regionRetail' | 'addressRetail' | 'addressMatch' | 'addressCourier' | 'deliveryDate' | 'methodObtain' | 'paymentSystem' | 'currency' | 'cardCategory' | 'codeWord' | 'calculator' | 'confirmationIncome';
|
|
@@ -117,7 +117,6 @@ export interface LeadFormState extends FormConsents, FormStateDeliveryType {
|
|
|
117
117
|
participantDateRegistration?: Date | string;
|
|
118
118
|
retirementIncome?: number;
|
|
119
119
|
otherIncome?: number;
|
|
120
|
-
incomeAverage?: number;
|
|
121
120
|
mandatoryPayments?: number;
|
|
122
121
|
additionalIncome?: number;
|
|
123
122
|
otherPayments?: number;
|
|
@@ -8,7 +8,7 @@ import { type VNode } from '../../model/VNode';
|
|
|
8
8
|
import { FailedStatusContent } from './FailedStatusContent';
|
|
9
9
|
import { PendingStatusContent } from './PendingStatusContent';
|
|
10
10
|
import { ReworkStatusContent } from './ReworkStatusContent';
|
|
11
|
-
import {
|
|
11
|
+
import { SuccessStatusCardContent } from './SuccessStatusCardContent';
|
|
12
12
|
|
|
13
13
|
const SIGNAL_TYPES: SignalType[] = [
|
|
14
14
|
'CREATE_APPLICATION_SHORT_SIGNAL',
|
|
@@ -52,8 +52,8 @@ const renderStatus = (status: STATUS_TYPE, handleExpire: () => void) => {
|
|
|
52
52
|
CANCELLED: <FailedStatusContent />,
|
|
53
53
|
FAILED: <FailedStatusContent />,
|
|
54
54
|
DRAFT: <FailedStatusContent />,
|
|
55
|
-
APPROVED: <
|
|
56
|
-
PRE_DECISION: <
|
|
55
|
+
APPROVED: <SuccessStatusCardContent />,
|
|
56
|
+
PRE_DECISION: <SuccessStatusCardContent />,
|
|
57
57
|
REVISION: <ReworkStatusContent />,
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useRetailFormStore, type StatusInfoState } from '../../hooks/useRetailFormStore';
|
|
3
|
+
import { formatDate } from '../../utils/formatDate';
|
|
4
|
+
import { CreditCardFormStatus } from './CreditCardFormStatus';
|
|
5
|
+
|
|
6
|
+
export const SuccessStatusCardContent = JSX(() => {
|
|
7
|
+
const { statusInfo } = useRetailFormStore();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<CreditCardFormStatus
|
|
11
|
+
title="Банк одобрил вам кредит"
|
|
12
|
+
description="Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит"
|
|
13
|
+
sectionInfo={getSectionInfo(statusInfo)}
|
|
14
|
+
buttonText="Вернуться на главную"
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const getSectionInfo = (statusInfo: StatusInfoState | null) => {
|
|
20
|
+
const sectionInfo = [
|
|
21
|
+
{
|
|
22
|
+
label: 'Название продукта',
|
|
23
|
+
description: 'Кредитная карта',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Категория',
|
|
27
|
+
description: statusInfo?.cardCategory,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
if (statusInfo?.deliveryAddress && statusInfo?.deliveryDate) {
|
|
32
|
+
return sectionInfo.concat([
|
|
33
|
+
{
|
|
34
|
+
label: 'Адрес доставки',
|
|
35
|
+
description: statusInfo?.deliveryAddress,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Дата доставки',
|
|
39
|
+
description: formatDate(statusInfo?.deliveryDate),
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return sectionInfo;
|
|
45
|
+
};
|
|
@@ -40,12 +40,9 @@ export const useCreditCardFormAPI = ({
|
|
|
40
40
|
retailFormStore.statusInfo = {
|
|
41
41
|
regionRetail: leadForm?.regionRetail?.text,
|
|
42
42
|
addressRetail: leadForm?.addressRetail?.text,
|
|
43
|
+
deliveryAddress: leadForm?.addressCourier?.fullAddress,
|
|
43
44
|
cardCategory: leadForm?.cardCategory?.text,
|
|
44
|
-
|
|
45
|
-
monthsValue: leadForm?.calculator?.monthsValue,
|
|
46
|
-
moneyValue: leadForm?.calculator?.moneyValue,
|
|
47
|
-
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
48
|
-
},
|
|
45
|
+
deliveryDate: leadForm?.deliveryDate,
|
|
49
46
|
};
|
|
50
47
|
retailFormStore.leadForm = initialState;
|
|
51
48
|
}
|
|
@@ -41,7 +41,6 @@ export const useCreditFormAPI = ({
|
|
|
41
41
|
retailFormStore.statusInfo = {
|
|
42
42
|
regionRetail: leadForm?.regionRetail?.text,
|
|
43
43
|
addressRetail: leadForm?.addressRetail?.text,
|
|
44
|
-
cardCategory: leadForm?.cardCategory?.text,
|
|
45
44
|
calculator: {
|
|
46
45
|
monthsValue: leadForm?.calculator?.monthsValue,
|
|
47
46
|
moneyValue: leadForm?.calculator?.moneyValue,
|
|
@@ -11,7 +11,6 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
11
11
|
confirmationIncome,
|
|
12
12
|
wages,
|
|
13
13
|
mandatoryPayments,
|
|
14
|
-
incomeAverage,
|
|
15
14
|
additionalIncome,
|
|
16
15
|
otherIncome,
|
|
17
16
|
otherPayments,
|
|
@@ -32,7 +31,7 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
32
31
|
participantIncomes: getParticipantIncomes({
|
|
33
32
|
wages,
|
|
34
33
|
mandatoryPayments,
|
|
35
|
-
incomeAverage,
|
|
34
|
+
incomeAverage: countIncomeAverage(wages, retirementIncome),
|
|
36
35
|
additionalIncome,
|
|
37
36
|
otherIncome,
|
|
38
37
|
otherPayments,
|
|
@@ -43,3 +42,6 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
43
42
|
armyIdFlg,
|
|
44
43
|
};
|
|
45
44
|
};
|
|
45
|
+
|
|
46
|
+
export const countIncomeAverage = (wages?: number, retirementIncome?: number) =>
|
|
47
|
+
Number(wages) + Number(retirementIncome);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
2
|
import { type LeadProps } from '../../api/RetailAPI/model/LeadFormData';
|
|
3
3
|
import { type Participant } from '../../api/RetailAPI/updateUserTask';
|
|
4
|
+
import { countIncomeAverage } from '../../services/retail/adaptors/getFamilyStatusAndIncomeData';
|
|
4
5
|
import { type Option } from '../Select/Option';
|
|
5
6
|
|
|
6
7
|
export const enum EContactType {
|
|
@@ -61,9 +62,6 @@ export const getParticipantIncomes = (participantIncomes: Participant['participa
|
|
|
61
62
|
const mandatoryPayments = participantIncomes?.find(
|
|
62
63
|
(contact) => contact.incomeTypeCd.key === EIncomesType.MANDATORY_PAYMENTS,
|
|
63
64
|
)?.value;
|
|
64
|
-
const incomeAverage = participantIncomes?.find(
|
|
65
|
-
(contact) => contact.incomeTypeCd.key === EIncomesType.INCOME_AVERAGE,
|
|
66
|
-
)?.value;
|
|
67
65
|
const additionalIncome = participantIncomes?.find(
|
|
68
66
|
(contact) => contact.incomeTypeCd.key === EIncomesType.ADDITIONAL_INCOME,
|
|
69
67
|
)?.value;
|
|
@@ -79,6 +77,7 @@ export const getParticipantIncomes = (participantIncomes: Participant['participa
|
|
|
79
77
|
const retirementIncome = participantIncomes?.find(
|
|
80
78
|
(contact) => contact.incomeTypeCd.key === EIncomesType.RETIREMENT_INCOME,
|
|
81
79
|
)?.value;
|
|
80
|
+
const incomeAverage = countIncomeAverage(wages, retirementIncome);
|
|
82
81
|
|
|
83
82
|
return {
|
|
84
83
|
wages,
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { InputControl } from '../../Input/InputControl';
|
|
4
3
|
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
5
4
|
import { validatorObj } from '../getObjectValidator';
|
|
6
5
|
import { getValidation } from '../getValidation';
|
|
7
6
|
|
|
8
|
-
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
[currentWages],
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<InputControl
|
|
23
|
-
label="Пенсионные доходы"
|
|
24
|
-
placeholder="Введите значение"
|
|
25
|
-
isInteger={true}
|
|
26
|
-
{...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required)}
|
|
27
|
-
{...input}
|
|
28
|
-
onChange={onChange}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
7
|
+
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputControl
|
|
9
|
+
label="Пенсионные доходы"
|
|
10
|
+
placeholder="Введите значение"
|
|
11
|
+
isInteger={true}
|
|
12
|
+
{...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required)}
|
|
13
|
+
{...input}
|
|
14
|
+
/>
|
|
15
|
+
));
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { InputControl } from '../../Input/InputControl';
|
|
4
3
|
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
5
4
|
import { validatorObj } from '../getObjectValidator';
|
|
6
5
|
import { getValidation } from '../getValidation';
|
|
7
6
|
|
|
8
|
-
export const WagesField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
[currentRetirementIncome],
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<InputControl
|
|
23
|
-
label="Совокупный доход в месяц после вычета налогов (зарплата, премии)"
|
|
24
|
-
placeholder="Введите значение"
|
|
25
|
-
isInteger={true}
|
|
26
|
-
{...getValidation(field('wages'), validatorObj.wages, input?.required)}
|
|
27
|
-
{...input}
|
|
28
|
-
onChange={onChange}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
7
|
+
export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputControl
|
|
9
|
+
label="Совокупный доход в месяц после вычета налогов (зарплата, премии)"
|
|
10
|
+
placeholder="Введите значение"
|
|
11
|
+
isInteger={true}
|
|
12
|
+
{...getValidation(field('wages'), validatorObj.wages, input?.required)}
|
|
13
|
+
{...input}
|
|
14
|
+
/>
|
|
15
|
+
));
|
package/package.json
CHANGED
|
@@ -117,7 +117,6 @@ export interface LeadFormState extends FormConsents, FormStateDeliveryType {
|
|
|
117
117
|
participantDateRegistration?: Date | string;
|
|
118
118
|
retirementIncome?: number;
|
|
119
119
|
otherIncome?: number;
|
|
120
|
-
incomeAverage?: number;
|
|
121
120
|
mandatoryPayments?: number;
|
|
122
121
|
additionalIncome?: number;
|
|
123
122
|
otherPayments?: number;
|
|
@@ -8,7 +8,7 @@ import { type VNode } from '../../model/VNode';
|
|
|
8
8
|
import { FailedStatusContent } from './FailedStatusContent';
|
|
9
9
|
import { PendingStatusContent } from './PendingStatusContent';
|
|
10
10
|
import { ReworkStatusContent } from './ReworkStatusContent';
|
|
11
|
-
import {
|
|
11
|
+
import { SuccessStatusCardContent } from './SuccessStatusCardContent';
|
|
12
12
|
|
|
13
13
|
const SIGNAL_TYPES: SignalType[] = [
|
|
14
14
|
'CREATE_APPLICATION_SHORT_SIGNAL',
|
|
@@ -52,8 +52,8 @@ const renderStatus = (status: STATUS_TYPE, handleExpire: () => void) => {
|
|
|
52
52
|
CANCELLED: <FailedStatusContent />,
|
|
53
53
|
FAILED: <FailedStatusContent />,
|
|
54
54
|
DRAFT: <FailedStatusContent />,
|
|
55
|
-
APPROVED: <
|
|
56
|
-
PRE_DECISION: <
|
|
55
|
+
APPROVED: <SuccessStatusCardContent />,
|
|
56
|
+
PRE_DECISION: <SuccessStatusCardContent />,
|
|
57
57
|
REVISION: <ReworkStatusContent />,
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useRetailFormStore, type StatusInfoState } from '../../hooks/useRetailFormStore';
|
|
3
|
+
import { formatDate } from '../../utils/formatDate';
|
|
4
|
+
import { CreditCardFormStatus } from './CreditCardFormStatus';
|
|
5
|
+
|
|
6
|
+
export const SuccessStatusCardContent = JSX(() => {
|
|
7
|
+
const { statusInfo } = useRetailFormStore();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<CreditCardFormStatus
|
|
11
|
+
title="Банк одобрил вам кредит"
|
|
12
|
+
description="Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит"
|
|
13
|
+
sectionInfo={getSectionInfo(statusInfo)}
|
|
14
|
+
buttonText="Вернуться на главную"
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const getSectionInfo = (statusInfo: StatusInfoState | null) => {
|
|
20
|
+
const sectionInfo = [
|
|
21
|
+
{
|
|
22
|
+
label: 'Название продукта',
|
|
23
|
+
description: 'Кредитная карта',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Категория',
|
|
27
|
+
description: statusInfo?.cardCategory,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
if (statusInfo?.deliveryAddress && statusInfo?.deliveryDate) {
|
|
32
|
+
return sectionInfo.concat([
|
|
33
|
+
{
|
|
34
|
+
label: 'Адрес доставки',
|
|
35
|
+
description: statusInfo?.deliveryAddress,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Дата доставки',
|
|
39
|
+
description: formatDate(statusInfo?.deliveryDate),
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return sectionInfo;
|
|
45
|
+
};
|
|
@@ -40,12 +40,9 @@ export const useCreditCardFormAPI = ({
|
|
|
40
40
|
retailFormStore.statusInfo = {
|
|
41
41
|
regionRetail: leadForm?.regionRetail?.text,
|
|
42
42
|
addressRetail: leadForm?.addressRetail?.text,
|
|
43
|
+
deliveryAddress: leadForm?.addressCourier?.fullAddress,
|
|
43
44
|
cardCategory: leadForm?.cardCategory?.text,
|
|
44
|
-
|
|
45
|
-
monthsValue: leadForm?.calculator?.monthsValue,
|
|
46
|
-
moneyValue: leadForm?.calculator?.moneyValue,
|
|
47
|
-
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
48
|
-
},
|
|
45
|
+
deliveryDate: leadForm?.deliveryDate,
|
|
49
46
|
};
|
|
50
47
|
retailFormStore.leadForm = initialState;
|
|
51
48
|
}
|
|
@@ -41,7 +41,6 @@ export const useCreditFormAPI = ({
|
|
|
41
41
|
retailFormStore.statusInfo = {
|
|
42
42
|
regionRetail: leadForm?.regionRetail?.text,
|
|
43
43
|
addressRetail: leadForm?.addressRetail?.text,
|
|
44
|
-
cardCategory: leadForm?.cardCategory?.text,
|
|
45
44
|
calculator: {
|
|
46
45
|
monthsValue: leadForm?.calculator?.monthsValue,
|
|
47
46
|
moneyValue: leadForm?.calculator?.moneyValue,
|
|
@@ -11,7 +11,6 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
11
11
|
confirmationIncome,
|
|
12
12
|
wages,
|
|
13
13
|
mandatoryPayments,
|
|
14
|
-
incomeAverage,
|
|
15
14
|
additionalIncome,
|
|
16
15
|
otherIncome,
|
|
17
16
|
otherPayments,
|
|
@@ -32,7 +31,7 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
32
31
|
participantIncomes: getParticipantIncomes({
|
|
33
32
|
wages,
|
|
34
33
|
mandatoryPayments,
|
|
35
|
-
incomeAverage,
|
|
34
|
+
incomeAverage: countIncomeAverage(wages, retirementIncome),
|
|
36
35
|
additionalIncome,
|
|
37
36
|
otherIncome,
|
|
38
37
|
otherPayments,
|
|
@@ -43,3 +42,6 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
43
42
|
armyIdFlg,
|
|
44
43
|
};
|
|
45
44
|
};
|
|
45
|
+
|
|
46
|
+
export const countIncomeAverage = (wages?: number, retirementIncome?: number) =>
|
|
47
|
+
Number(wages) + Number(retirementIncome);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
2
|
import { type LeadProps } from '../../api/RetailAPI/model/LeadFormData';
|
|
3
3
|
import { type Participant } from '../../api/RetailAPI/updateUserTask';
|
|
4
|
+
import { countIncomeAverage } from '../../services/retail/adaptors/getFamilyStatusAndIncomeData';
|
|
4
5
|
import { type Option } from '../Select/Option';
|
|
5
6
|
|
|
6
7
|
export const enum EContactType {
|
|
@@ -61,9 +62,6 @@ export const getParticipantIncomes = (participantIncomes: Participant['participa
|
|
|
61
62
|
const mandatoryPayments = participantIncomes?.find(
|
|
62
63
|
(contact) => contact.incomeTypeCd.key === EIncomesType.MANDATORY_PAYMENTS,
|
|
63
64
|
)?.value;
|
|
64
|
-
const incomeAverage = participantIncomes?.find(
|
|
65
|
-
(contact) => contact.incomeTypeCd.key === EIncomesType.INCOME_AVERAGE,
|
|
66
|
-
)?.value;
|
|
67
65
|
const additionalIncome = participantIncomes?.find(
|
|
68
66
|
(contact) => contact.incomeTypeCd.key === EIncomesType.ADDITIONAL_INCOME,
|
|
69
67
|
)?.value;
|
|
@@ -79,6 +77,7 @@ export const getParticipantIncomes = (participantIncomes: Participant['participa
|
|
|
79
77
|
const retirementIncome = participantIncomes?.find(
|
|
80
78
|
(contact) => contact.incomeTypeCd.key === EIncomesType.RETIREMENT_INCOME,
|
|
81
79
|
)?.value;
|
|
80
|
+
const incomeAverage = countIncomeAverage(wages, retirementIncome);
|
|
82
81
|
|
|
83
82
|
return {
|
|
84
83
|
wages,
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { InputControl } from '../../Input/InputControl';
|
|
4
3
|
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
5
4
|
import { validatorObj } from '../getObjectValidator';
|
|
6
5
|
import { getValidation } from '../getValidation';
|
|
7
6
|
|
|
8
|
-
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
[currentWages],
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<InputControl
|
|
23
|
-
label="Пенсионные доходы"
|
|
24
|
-
placeholder="Введите значение"
|
|
25
|
-
isInteger={true}
|
|
26
|
-
{...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required)}
|
|
27
|
-
{...input}
|
|
28
|
-
onChange={onChange}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
7
|
+
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputControl
|
|
9
|
+
label="Пенсионные доходы"
|
|
10
|
+
placeholder="Введите значение"
|
|
11
|
+
isInteger={true}
|
|
12
|
+
{...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required)}
|
|
13
|
+
{...input}
|
|
14
|
+
/>
|
|
15
|
+
));
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { InputControl } from '../../Input/InputControl';
|
|
4
3
|
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
5
4
|
import { validatorObj } from '../getObjectValidator';
|
|
6
5
|
import { getValidation } from '../getValidation';
|
|
7
6
|
|
|
8
|
-
export const WagesField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
[currentRetirementIncome],
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<InputControl
|
|
23
|
-
label="Совокупный доход в месяц после вычета налогов (зарплата, премии)"
|
|
24
|
-
placeholder="Введите значение"
|
|
25
|
-
isInteger={true}
|
|
26
|
-
{...getValidation(field('wages'), validatorObj.wages, input?.required)}
|
|
27
|
-
{...input}
|
|
28
|
-
onChange={onChange}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
7
|
+
export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputControl
|
|
9
|
+
label="Совокупный доход в месяц после вычета налогов (зарплата, премии)"
|
|
10
|
+
placeholder="Введите значение"
|
|
11
|
+
isInteger={true}
|
|
12
|
+
{...getValidation(field('wages'), validatorObj.wages, input?.required)}
|
|
13
|
+
{...input}
|
|
14
|
+
/>
|
|
15
|
+
));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SuccessStatusContent: import("@redneckz/uni-jsx").UNIComponent<{}, any, any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SuccessStatusContent: import("@redneckz/uni-jsx").UNIComponent<{}, any, any>;
|