@redneckz/wildless-cms-uni-blocks 0.14.689 → 0.14.691

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 (157) hide show
  1. package/bundle/bundle.umd.js +72 -51
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/CreditCardForm/{getFirstStepData.d.ts → getCardData.d.ts} +1 -1
  4. package/bundle/components/CreditCardForm/getSixthStepData.d.ts +10 -2
  5. package/bundle/ui-kit/FormField/SelectField.d.ts +1 -0
  6. package/dist/components/CreditCardForm/StepsNavigationButtons.js +1 -1
  7. package/dist/components/CreditCardForm/calculateInputs.js +2 -1
  8. package/dist/components/CreditCardForm/calculateInputs.js.map +1 -1
  9. package/dist/components/CreditCardForm/creditCardFormStepsData.js +18 -9
  10. package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  11. package/dist/components/CreditCardForm/{getFirstStepData.d.ts → getCardData.d.ts} +1 -1
  12. package/{mobile/dist/components/CreditCardForm/getFirstStepData.js → dist/components/CreditCardForm/getCardData.js} +4 -4
  13. package/dist/components/CreditCardForm/getCardData.js.map +1 -0
  14. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
  15. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  16. package/dist/components/CreditCardForm/getSixthStepData.d.ts +10 -2
  17. package/dist/components/CreditCardForm/getSixthStepData.js +22 -13
  18. package/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  19. package/dist/components/CreditForm/calculateInputs.js +1 -1
  20. package/dist/components/CreditForm/calculateInputs.js.map +1 -1
  21. package/dist/components/CreditForm/creditFormStepsData.js +6 -6
  22. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  23. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +0 -1
  24. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  25. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +1 -1
  26. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  27. package/dist/ui-kit/FormField/Fields/CreditInRshbCdField.js +3 -3
  28. package/dist/ui-kit/FormField/Fields/CreditInRshbCdField.js.map +1 -1
  29. package/dist/ui-kit/FormField/Fields/LegalEntityNameField.js +1 -1
  30. package/dist/ui-kit/FormField/Fields/LegalEntityNameField.js.map +1 -1
  31. package/dist/ui-kit/FormField/SelectField.d.ts +1 -0
  32. package/dist/ui-kit/FormField/SelectField.js +4 -2
  33. package/dist/ui-kit/FormField/SelectField.js.map +1 -1
  34. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.d.ts +1 -0
  35. package/lib/components/CreditCardForm/StepsNavigationButtons.js +1 -1
  36. package/lib/components/CreditCardForm/calculateInputs.js +2 -1
  37. package/lib/components/CreditCardForm/calculateInputs.js.map +1 -1
  38. package/lib/components/CreditCardForm/creditCardFormStepsData.js +18 -9
  39. package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  40. package/lib/components/CreditCardForm/{getFirstStepData.d.ts → getCardData.d.ts} +1 -1
  41. package/lib/components/CreditCardForm/{getFirstStepData.js → getCardData.js} +2 -2
  42. package/lib/components/CreditCardForm/getCardData.js.map +1 -0
  43. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
  44. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  45. package/lib/components/CreditCardForm/getSixthStepData.d.ts +10 -2
  46. package/lib/components/CreditCardForm/getSixthStepData.js +22 -13
  47. package/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  48. package/lib/components/CreditForm/calculateInputs.js +1 -1
  49. package/lib/components/CreditForm/calculateInputs.js.map +1 -1
  50. package/lib/components/CreditForm/creditFormStepsData.js +6 -6
  51. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  52. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +0 -1
  53. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  54. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +1 -1
  55. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  56. package/lib/ui-kit/FormField/Fields/CreditInRshbCdField.js +3 -3
  57. package/lib/ui-kit/FormField/Fields/CreditInRshbCdField.js.map +1 -1
  58. package/lib/ui-kit/FormField/Fields/LegalEntityNameField.js +1 -1
  59. package/lib/ui-kit/FormField/Fields/LegalEntityNameField.js.map +1 -1
  60. package/lib/ui-kit/FormField/SelectField.d.ts +1 -0
  61. package/lib/ui-kit/FormField/SelectField.js +4 -2
  62. package/lib/ui-kit/FormField/SelectField.js.map +1 -1
  63. package/mobile/bundle/bundle.umd.js +72 -51
  64. package/mobile/bundle/bundle.umd.min.js +1 -1
  65. package/mobile/bundle/components/CreditCardForm/{getFirstStepData.d.ts → getCardData.d.ts} +1 -1
  66. package/mobile/bundle/components/CreditCardForm/getSixthStepData.d.ts +10 -2
  67. package/mobile/bundle/ui-kit/FormField/SelectField.d.ts +1 -0
  68. package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js +1 -1
  69. package/mobile/dist/components/CreditCardForm/calculateInputs.js +2 -1
  70. package/mobile/dist/components/CreditCardForm/calculateInputs.js.map +1 -1
  71. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +18 -9
  72. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  73. package/mobile/dist/components/CreditCardForm/getCardData.d.ts +3 -0
  74. package/{dist/components/CreditCardForm/getFirstStepData.js → mobile/dist/components/CreditCardForm/getCardData.js} +4 -4
  75. package/mobile/dist/components/CreditCardForm/getCardData.js.map +1 -0
  76. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
  77. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  78. package/mobile/dist/components/CreditCardForm/getSixthStepData.d.ts +10 -2
  79. package/mobile/dist/components/CreditCardForm/getSixthStepData.js +22 -13
  80. package/mobile/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  81. package/mobile/dist/components/CreditForm/calculateInputs.js +1 -1
  82. package/mobile/dist/components/CreditForm/calculateInputs.js.map +1 -1
  83. package/mobile/dist/components/CreditForm/creditFormStepsData.js +6 -6
  84. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  85. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +0 -1
  86. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  87. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +1 -1
  88. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  89. package/mobile/dist/ui-kit/FormField/Fields/CreditInRshbCdField.js +3 -3
  90. package/mobile/dist/ui-kit/FormField/Fields/CreditInRshbCdField.js.map +1 -1
  91. package/mobile/dist/ui-kit/FormField/Fields/LegalEntityNameField.js +1 -1
  92. package/mobile/dist/ui-kit/FormField/Fields/LegalEntityNameField.js.map +1 -1
  93. package/mobile/dist/ui-kit/FormField/SelectField.d.ts +1 -0
  94. package/mobile/dist/ui-kit/FormField/SelectField.js +4 -2
  95. package/mobile/dist/ui-kit/FormField/SelectField.js.map +1 -1
  96. package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js +1 -1
  97. package/mobile/lib/components/CreditCardForm/calculateInputs.js +2 -1
  98. package/mobile/lib/components/CreditCardForm/calculateInputs.js.map +1 -1
  99. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +18 -9
  100. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  101. package/mobile/lib/components/CreditCardForm/getCardData.d.ts +3 -0
  102. package/mobile/lib/components/CreditCardForm/{getFirstStepData.js → getCardData.js} +2 -2
  103. package/mobile/lib/components/CreditCardForm/getCardData.js.map +1 -0
  104. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
  105. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  106. package/mobile/lib/components/CreditCardForm/getSixthStepData.d.ts +10 -2
  107. package/mobile/lib/components/CreditCardForm/getSixthStepData.js +22 -13
  108. package/mobile/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  109. package/mobile/lib/components/CreditForm/calculateInputs.js +1 -1
  110. package/mobile/lib/components/CreditForm/calculateInputs.js.map +1 -1
  111. package/mobile/lib/components/CreditForm/creditFormStepsData.js +6 -6
  112. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  113. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +0 -1
  114. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  115. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +1 -1
  116. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  117. package/mobile/lib/ui-kit/FormField/Fields/CreditInRshbCdField.js +3 -3
  118. package/mobile/lib/ui-kit/FormField/Fields/CreditInRshbCdField.js.map +1 -1
  119. package/mobile/lib/ui-kit/FormField/Fields/LegalEntityNameField.js +1 -1
  120. package/mobile/lib/ui-kit/FormField/Fields/LegalEntityNameField.js.map +1 -1
  121. package/mobile/lib/ui-kit/FormField/SelectField.d.ts +1 -0
  122. package/mobile/lib/ui-kit/FormField/SelectField.js +4 -2
  123. package/mobile/lib/ui-kit/FormField/SelectField.js.map +1 -1
  124. package/mobile/src/components/CreditCardForm/StepsNavigationButtons.tsx +1 -1
  125. package/mobile/src/components/CreditCardForm/calculateInputs.ts +6 -3
  126. package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +18 -9
  127. package/mobile/src/components/CreditCardForm/{getFirstStepData.tsx → getCardData.tsx} +1 -1
  128. package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +3 -2
  129. package/mobile/src/components/CreditCardForm/getSixthStepData.ts +25 -13
  130. package/mobile/src/components/CreditForm/calculateInputs.ts +3 -3
  131. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +6 -6
  132. package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +0 -1
  133. package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +1 -1
  134. package/mobile/src/ui-kit/FormField/Fields/CreditInRshbCdField.tsx +3 -2
  135. package/mobile/src/ui-kit/FormField/Fields/LegalEntityNameField.tsx +1 -0
  136. package/mobile/src/ui-kit/FormField/SelectField.tsx +5 -4
  137. package/package.json +1 -1
  138. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +13 -0
  139. package/src/components/CreditCardForm/StepsNavigationButtons.tsx +1 -1
  140. package/src/components/CreditCardForm/calculateInputs.ts +6 -3
  141. package/src/components/CreditCardForm/creditCardFormStepsData.tsx +18 -9
  142. package/src/components/CreditCardForm/{getFirstStepData.tsx → getCardData.tsx} +1 -1
  143. package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +3 -2
  144. package/src/components/CreditCardForm/getSixthStepData.ts +25 -13
  145. package/src/components/CreditForm/calculateInputs.ts +3 -3
  146. package/src/components/CreditForm/creditFormStepsData.tsx +6 -6
  147. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +0 -1
  148. package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +1 -1
  149. package/src/ui-kit/FormField/Fields/CreditInRshbCdField.tsx +3 -2
  150. package/src/ui-kit/FormField/Fields/LegalEntityNameField.tsx +1 -0
  151. package/src/ui-kit/FormField/SelectField.tsx +5 -4
  152. package/dist/components/CreditCardForm/getFirstStepData.js.map +0 -1
  153. package/lib/components/CreditCardForm/getFirstStepData.js.map +0 -1
  154. package/mobile/dist/components/CreditCardForm/getFirstStepData.d.ts +0 -3
  155. package/mobile/dist/components/CreditCardForm/getFirstStepData.js.map +0 -1
  156. package/mobile/lib/components/CreditCardForm/getFirstStepData.d.ts +0 -3
  157. package/mobile/lib/components/CreditCardForm/getFirstStepData.js.map +0 -1
@@ -5,25 +5,37 @@ import { getParticipantAddresses } from '../CreditForm/utils';
5
5
  export const getDeliveryData = (formData: FormState) => {
6
6
  const { methodObtain, deliveryDate = '' } = formData;
7
7
 
8
- return {
9
- courierDeliveryFlg: methodObtain === 'courier',
10
- deliveryDate: dateToISO(deliveryDate),
11
- deliveryTimeCd: { value: 'TIME_2' },
12
- };
8
+ const isCourierDelivery = methodObtain === 'courier';
9
+
10
+ return isCourierDelivery
11
+ ? {
12
+ courierDeliveryFlg: isCourierDelivery,
13
+ deliveryDate: dateToISO(deliveryDate),
14
+ deliveryTimeCd: { value: 'TIME_2' },
15
+ }
16
+ : {};
13
17
  };
14
18
 
15
19
  export const getOfficeCode = (formData: FormState) => {
16
- const { addressRetail } = formData;
20
+ const { addressRetail, methodObtain } = formData;
21
+
22
+ const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
17
23
 
18
- return {
19
- office: addressRetail?.key ? { id: addressRetail.key } : undefined,
20
- };
24
+ return isOfficeObtain
25
+ ? {
26
+ office: { id: addressRetail.key },
27
+ }
28
+ : {};
21
29
  };
22
30
 
23
31
  export const getSixthStepData = (formData: FormState) => {
24
- const { addressCourier } = formData;
32
+ const { addressCourier, methodObtain } = formData;
33
+
34
+ const isCourierDelivery = methodObtain === 'courier';
25
35
 
26
- return {
27
- participantAddresses: getParticipantAddresses({ addressCourier }),
28
- };
36
+ return isCourierDelivery
37
+ ? {
38
+ participantAddresses: getParticipantAddresses({ addressCourier }),
39
+ }
40
+ : {};
29
41
  };
@@ -30,9 +30,6 @@ const checkIsRetiree = (step: number, getValue: GetValue) =>
30
30
  const checkBusinessOwner = ({ name }: FieldDef, getValue: GetValue) =>
31
31
  name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
32
32
 
33
- const checkConsentPfrFlg = ({ name }: FieldDef, getValue: GetValue) =>
34
- name === 'snils' && isSnilsRequired(getValue);
35
-
36
33
  const checkAddressFillFromESIA = ({ name, filledByEsia }: FieldDef, getValue: GetValue) =>
37
34
  name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
38
35
 
@@ -47,5 +44,8 @@ export const checkCondition = ({ condition }: FieldDef, getValue: GetValue) =>
47
44
  return _ !== ((dataValue as Option)?.key ?? dataValue);
48
45
  });
49
46
 
47
+ const checkConsentPfrFlg = ({ name }: FieldDef, getValue: GetValue) =>
48
+ name === 'snils' && isSnilsRequired(getValue);
49
+
50
50
  const isSnilsRequired = (getValue: GetValue) =>
51
51
  getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
@@ -116,7 +116,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
116
116
  },
117
117
  {
118
118
  inputs: [
119
- { fieldType: 'common', name: 'employment' },
119
+ { fieldType: 'common', name: 'employment', required: true },
120
120
  { fieldType: 'common', name: 'organizationName', required: true, dadata: true },
121
121
  ],
122
122
  },
@@ -129,15 +129,15 @@ export const stepsSectionsMap: SectionsProps[][] = [
129
129
  },
130
130
  {
131
131
  inputs: [
132
- { fieldType: 'common', name: 'organization', required: false },
133
- { fieldType: 'common', name: 'amountWorkers', required: false },
132
+ { fieldType: 'common', name: 'organization', required: true },
133
+ { fieldType: 'common', name: 'amountWorkers', required: true },
134
134
  ],
135
135
  },
136
136
  {
137
137
  columns: 2,
138
138
  inputs: [
139
- { fieldType: 'common', name: 'employerActivities', required: false },
140
- { fieldType: 'common', name: 'employerOrganization', required: false },
139
+ { fieldType: 'common', name: 'employerActivities', required: true },
140
+ { fieldType: 'common', name: 'employerOrganization', required: true },
141
141
  { fieldType: 'common', name: 'generalSeniority', required: true },
142
142
  { fieldType: 'common', name: 'lastJobExperience', required: true },
143
143
  { fieldType: 'common', name: 'experience5Years', required: true },
@@ -158,7 +158,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
158
158
  {
159
159
  columns: 2,
160
160
  inputs: [
161
- { fieldType: 'common', name: 'positionOrganization', required: false },
161
+ { fieldType: 'common', name: 'positionOrganization', required: true },
162
162
  {
163
163
  fieldType: 'common',
164
164
  name: 'partInBusiness',
@@ -39,7 +39,6 @@ export const ConsentBkiDialog = JSX<ConsentBkiDialogProps>(
39
39
 
40
40
  const handleSubmit = useCallback(() => {
41
41
  onSubmit(confirmStatus);
42
- onClose();
43
42
  }, [onSubmit, confirmStatus]);
44
43
 
45
44
  const handleConfirmChange = useCallback((value: string) => {
@@ -31,7 +31,7 @@ export const useConsentBkiDialog = (onClose: () => void) => {
31
31
  if (confirmStatus === 'SIGNED' && phone) {
32
32
  verifyPhoneDialog.open({
33
33
  ...verifyPhoneContent(phone),
34
- onClose: handleSuccessVerify(profileId),
34
+ onSuccess: handleSuccessVerify(profileId),
35
35
  });
36
36
  } else {
37
37
  onClose();
@@ -3,8 +3,8 @@ import { useLeadFormData } from '../../../hooks/useLeadFormData';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { SelectField } from '../SelectField';
5
5
 
6
- const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
7
- вкладчиком с долей участия более 20% уставного капитала руководителем,
6
+ const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
7
+ вкладчиком с долей участия более 20% уставного капитала руководителем,
8
8
  которого Вы являетесь, кредит в АО «Россельхозбанк»`;
9
9
 
10
10
  export const CreditInRshbCdField = JSX<CustomFieldProps>(({ field, input }) => {
@@ -17,6 +17,7 @@ export const CreditInRshbCdField = JSX<CustomFieldProps>(({ field, input }) => {
17
17
  label={LABEL_TEXT}
18
18
  fieldName="creditInRshbCd"
19
19
  input={input}
20
+ disabled={!field?.('shareholderFlg')?.value}
20
21
  />
21
22
  );
22
23
  });
@@ -10,6 +10,7 @@ export const LegalEntityNameField = JSX<CustomFieldProps>(({ field, input }) =>
10
10
  label="Наименование юридического лица"
11
11
  {...input}
12
12
  {...getValidation(field('legalEntityName'), validatorObj.legalEntityName, input?.required)}
13
+ disabled={!field?.('shareholderFlg')?.value}
13
14
  />
14
15
  );
15
16
  });
@@ -20,17 +20,19 @@ export interface SelectFieldProps extends CustomFieldProps, UniBlockProps {
20
20
  fieldName: string;
21
21
  placeholder?: string;
22
22
  isSearch?: boolean;
23
+ disabled?: boolean;
23
24
  }
24
25
 
25
26
  export const SelectField = UniBlock<SelectFieldProps>(
26
27
  ({
27
28
  field,
28
29
  source,
29
- label,
30
30
  fieldName,
31
31
  input,
32
32
  placeholder = 'Выберите из списка',
33
- isSearch = false,
33
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
+ options,
35
+ ...rest
34
36
  }) => {
35
37
  const leadOptions: Option[] =
36
38
  source?.map((_: LeadProps) => ({
@@ -41,10 +43,9 @@ export const SelectField = UniBlock<SelectFieldProps>(
41
43
  return (
42
44
  <SelectControl
43
45
  placeholder={placeholder}
44
- label={label}
45
46
  options={leadOptions}
46
- isSearch={isSearch}
47
47
  {...getValidation(field(fieldName), validatorObj[fieldName], input?.required)}
48
+ {...rest}
48
49
  />
49
50
  );
50
51
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.689",
3
+ "version": "0.14.691",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -23,4 +23,17 @@ export default {
23
23
  <DialogManager />
24
24
  </div>
25
25
  ),
26
+
27
+ creditCard: (
28
+ <div className="container grid grid-cols-12">
29
+ <ApplicationLeadForm
30
+ className="col-span-12"
31
+ title="Заявка на кредит"
32
+ programId="13"
33
+ button={button}
34
+ />
35
+ <PopupManager />
36
+ <DialogManager />
37
+ </div>
38
+ ),
26
39
  };
@@ -8,7 +8,7 @@ export interface StepsNavigationButtonsProps {
8
8
 
9
9
  export const StepsNavigationButtons = JSX<StepsNavigationButtonsProps>(({ step, onPrevStep }) => {
10
10
  const isFirstStep = step === 0;
11
- const isFinalStep = step === 6;
11
+ const isFinalStep = step === 5;
12
12
 
13
13
  return (
14
14
  <div className="flex justify-between gap-m">
@@ -30,9 +30,6 @@ const checkIsRetiree = (step: number, getValue: GetValue) =>
30
30
  const checkBusinessOwner = ({ name }: FieldDef, getValue: GetValue) =>
31
31
  name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
32
32
 
33
- const checkConsentPfrFlg = ({ name }: FieldDef, getValue: GetValue) =>
34
- name === 'snils' && !getValue('consentPfrFlg');
35
-
36
33
  const checkAddressFillFromESIA = ({ name, filledByEsia }: FieldDef, getValue: GetValue) =>
37
34
  name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
38
35
 
@@ -46,3 +43,9 @@ export const checkCondition = ({ condition }: FieldDef, getValue: GetValue) =>
46
43
 
47
44
  return _ !== ((dataValue as Option)?.key ?? dataValue);
48
45
  });
46
+
47
+ const checkConsentPfrFlg = ({ name }: FieldDef, getValue: GetValue) =>
48
+ name === 'snils' && isSnilsRequired(getValue);
49
+
50
+ const isSnilsRequired = (getValue: GetValue) =>
51
+ getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
@@ -34,8 +34,8 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
34
34
  { fieldType: 'common', name: 'middleName', dadata: true, filledByEsia: true },
35
35
  { fieldType: 'common', name: 'sex', required: true },
36
36
  { fieldType: 'common', name: 'limitedBirthday', required: true, filledByEsia: true },
37
- { fieldType: 'common', name: 'birthPlace', required: true },
38
- { fieldType: 'common', name: 'phone', required: true },
37
+ { fieldType: 'common', name: 'birthPlace', required: true, filledByEsia: true },
38
+ { fieldType: 'common', name: 'phone', required: true, filledByEsia: true },
39
39
  { fieldType: 'common', name: 'email', required: true, dadata: true },
40
40
  ],
41
41
  },
@@ -119,7 +119,7 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
119
119
  },
120
120
  {
121
121
  inputs: [
122
- { fieldType: 'common', name: 'employment' },
122
+ { fieldType: 'common', name: 'employment', required: true },
123
123
  { fieldType: 'common', name: 'organizationName', required: true, dadata: true },
124
124
  ],
125
125
  },
@@ -132,15 +132,15 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
132
132
  },
133
133
  {
134
134
  inputs: [
135
- { fieldType: 'common', name: 'organization', required: false },
136
- { fieldType: 'common', name: 'amountWorkers', required: false },
135
+ { fieldType: 'common', name: 'organization', required: true },
136
+ { fieldType: 'common', name: 'amountWorkers', required: true },
137
137
  ],
138
138
  },
139
139
  {
140
140
  columns: 2,
141
141
  inputs: [
142
- { fieldType: 'common', name: 'employerActivities', required: false },
143
- { fieldType: 'common', name: 'employerOrganization', required: false },
142
+ { fieldType: 'common', name: 'employerActivities', required: true },
143
+ { fieldType: 'common', name: 'employerOrganization', required: true },
144
144
  { fieldType: 'common', name: 'generalSeniority', required: true },
145
145
  { fieldType: 'common', name: 'lastJobExperience', required: true },
146
146
  { fieldType: 'common', name: 'experience5Years', required: true },
@@ -161,7 +161,7 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
161
161
  {
162
162
  columns: 2,
163
163
  inputs: [
164
- { fieldType: 'common', name: 'positionOrganization', required: false },
164
+ { fieldType: 'common', name: 'positionOrganization', required: true },
165
165
  {
166
166
  fieldType: 'common',
167
167
  name: 'partInBusiness',
@@ -208,6 +208,10 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
208
208
  },
209
209
  ],
210
210
  },
211
+ {
212
+ columns: 1,
213
+ inputs: [{ fieldType: 'common', name: 'confirmationIncome', required: true }],
214
+ },
211
215
  {
212
216
  columns: 1,
213
217
  inputs: [{ fieldType: 'common', name: 'wages', required: true }],
@@ -245,7 +249,12 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
245
249
  inputs: [{ fieldType: 'common', name: 'shareholderFlg' }],
246
250
  },
247
251
  {
248
- inputs: [{ fieldType: 'common', name: 'legalEntityName' }],
252
+ inputs: [
253
+ {
254
+ fieldType: 'common',
255
+ name: 'legalEntityName',
256
+ },
257
+ ],
249
258
  },
250
259
  {
251
260
  inputs: [{ fieldType: 'common', name: 'creditInRshbCd' }],
@@ -1,7 +1,7 @@
1
1
  import { type Participant } from '../../api/RetailAPI/updateUserTask';
2
2
  import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
3
3
 
4
- export const getFirstStepData = (formData: FormState): Partial<Participant> => {
4
+ export const getCardData = (formData: FormState): Partial<Participant> => {
5
5
  const { currency, paymentSystem, cardCategory, codeWord } = formData;
6
6
 
7
7
  return {
@@ -1,8 +1,8 @@
1
1
  import { type Participant, type UpdateUserTaskBody } from '../../api/RetailAPI/updateUserTask';
2
2
  import { locationNavigator } from '../../external/locationNavigator';
3
3
  import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
4
+ import { getCardData } from './getCardData';
4
5
  import { getFifthStepData } from './getFifthStepData';
5
- import { getFirstStepData } from './getFirstStepData';
6
6
  import { getFourthStepData } from './getFourthStepData';
7
7
  import { getSecondStepData } from './getSecondStepData';
8
8
  import { getDeliveryData, getOfficeCode, getSixthStepData } from './getSixthStepData';
@@ -46,6 +46,7 @@ export const getCreditCardFormTaskData = ({
46
46
  ...getCurrentStepData(step, formData),
47
47
  },
48
48
  ],
49
+ ...getCardData(formData),
49
50
  ...getDeliveryData(formData),
50
51
  },
51
52
  };
@@ -54,7 +55,7 @@ export const getCreditCardFormTaskData = ({
54
55
  const getCurrentStepData = (step: number, formData: FormState): Partial<Participant> => {
55
56
  switch (step) {
56
57
  case 0:
57
- return getFirstStepData(formData);
58
+ return {};
58
59
  case 1:
59
60
  return getSecondStepData(formData);
60
61
  case 2:
@@ -5,25 +5,37 @@ import { getParticipantAddresses } from '../CreditForm/utils';
5
5
  export const getDeliveryData = (formData: FormState) => {
6
6
  const { methodObtain, deliveryDate = '' } = formData;
7
7
 
8
- return {
9
- courierDeliveryFlg: methodObtain === 'courier',
10
- deliveryDate: dateToISO(deliveryDate),
11
- deliveryTimeCd: { value: 'TIME_2' },
12
- };
8
+ const isCourierDelivery = methodObtain === 'courier';
9
+
10
+ return isCourierDelivery
11
+ ? {
12
+ courierDeliveryFlg: isCourierDelivery,
13
+ deliveryDate: dateToISO(deliveryDate),
14
+ deliveryTimeCd: { value: 'TIME_2' },
15
+ }
16
+ : {};
13
17
  };
14
18
 
15
19
  export const getOfficeCode = (formData: FormState) => {
16
- const { addressRetail } = formData;
20
+ const { addressRetail, methodObtain } = formData;
21
+
22
+ const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
17
23
 
18
- return {
19
- office: addressRetail?.key ? { id: addressRetail.key } : undefined,
20
- };
24
+ return isOfficeObtain
25
+ ? {
26
+ office: { id: addressRetail.key },
27
+ }
28
+ : {};
21
29
  };
22
30
 
23
31
  export const getSixthStepData = (formData: FormState) => {
24
- const { addressCourier } = formData;
32
+ const { addressCourier, methodObtain } = formData;
33
+
34
+ const isCourierDelivery = methodObtain === 'courier';
25
35
 
26
- return {
27
- participantAddresses: getParticipantAddresses({ addressCourier }),
28
- };
36
+ return isCourierDelivery
37
+ ? {
38
+ participantAddresses: getParticipantAddresses({ addressCourier }),
39
+ }
40
+ : {};
29
41
  };
@@ -30,9 +30,6 @@ const checkIsRetiree = (step: number, getValue: GetValue) =>
30
30
  const checkBusinessOwner = ({ name }: FieldDef, getValue: GetValue) =>
31
31
  name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
32
32
 
33
- const checkConsentPfrFlg = ({ name }: FieldDef, getValue: GetValue) =>
34
- name === 'snils' && isSnilsRequired(getValue);
35
-
36
33
  const checkAddressFillFromESIA = ({ name, filledByEsia }: FieldDef, getValue: GetValue) =>
37
34
  name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
38
35
 
@@ -47,5 +44,8 @@ export const checkCondition = ({ condition }: FieldDef, getValue: GetValue) =>
47
44
  return _ !== ((dataValue as Option)?.key ?? dataValue);
48
45
  });
49
46
 
47
+ const checkConsentPfrFlg = ({ name }: FieldDef, getValue: GetValue) =>
48
+ name === 'snils' && isSnilsRequired(getValue);
49
+
50
50
  const isSnilsRequired = (getValue: GetValue) =>
51
51
  getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
@@ -116,7 +116,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
116
116
  },
117
117
  {
118
118
  inputs: [
119
- { fieldType: 'common', name: 'employment' },
119
+ { fieldType: 'common', name: 'employment', required: true },
120
120
  { fieldType: 'common', name: 'organizationName', required: true, dadata: true },
121
121
  ],
122
122
  },
@@ -129,15 +129,15 @@ export const stepsSectionsMap: SectionsProps[][] = [
129
129
  },
130
130
  {
131
131
  inputs: [
132
- { fieldType: 'common', name: 'organization', required: false },
133
- { fieldType: 'common', name: 'amountWorkers', required: false },
132
+ { fieldType: 'common', name: 'organization', required: true },
133
+ { fieldType: 'common', name: 'amountWorkers', required: true },
134
134
  ],
135
135
  },
136
136
  {
137
137
  columns: 2,
138
138
  inputs: [
139
- { fieldType: 'common', name: 'employerActivities', required: false },
140
- { fieldType: 'common', name: 'employerOrganization', required: false },
139
+ { fieldType: 'common', name: 'employerActivities', required: true },
140
+ { fieldType: 'common', name: 'employerOrganization', required: true },
141
141
  { fieldType: 'common', name: 'generalSeniority', required: true },
142
142
  { fieldType: 'common', name: 'lastJobExperience', required: true },
143
143
  { fieldType: 'common', name: 'experience5Years', required: true },
@@ -158,7 +158,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
158
158
  {
159
159
  columns: 2,
160
160
  inputs: [
161
- { fieldType: 'common', name: 'positionOrganization', required: false },
161
+ { fieldType: 'common', name: 'positionOrganization', required: true },
162
162
  {
163
163
  fieldType: 'common',
164
164
  name: 'partInBusiness',
@@ -39,7 +39,6 @@ export const ConsentBkiDialog = JSX<ConsentBkiDialogProps>(
39
39
 
40
40
  const handleSubmit = useCallback(() => {
41
41
  onSubmit(confirmStatus);
42
- onClose();
43
42
  }, [onSubmit, confirmStatus]);
44
43
 
45
44
  const handleConfirmChange = useCallback((value: string) => {
@@ -31,7 +31,7 @@ export const useConsentBkiDialog = (onClose: () => void) => {
31
31
  if (confirmStatus === 'SIGNED' && phone) {
32
32
  verifyPhoneDialog.open({
33
33
  ...verifyPhoneContent(phone),
34
- onClose: handleSuccessVerify(profileId),
34
+ onSuccess: handleSuccessVerify(profileId),
35
35
  });
36
36
  } else {
37
37
  onClose();
@@ -3,8 +3,8 @@ import { useLeadFormData } from '../../../hooks/useLeadFormData';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { SelectField } from '../SelectField';
5
5
 
6
- const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
7
- вкладчиком с долей участия более 20% уставного капитала руководителем,
6
+ const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
7
+ вкладчиком с долей участия более 20% уставного капитала руководителем,
8
8
  которого Вы являетесь, кредит в АО «Россельхозбанк»`;
9
9
 
10
10
  export const CreditInRshbCdField = JSX<CustomFieldProps>(({ field, input }) => {
@@ -17,6 +17,7 @@ export const CreditInRshbCdField = JSX<CustomFieldProps>(({ field, input }) => {
17
17
  label={LABEL_TEXT}
18
18
  fieldName="creditInRshbCd"
19
19
  input={input}
20
+ disabled={!field?.('shareholderFlg')?.value}
20
21
  />
21
22
  );
22
23
  });
@@ -10,6 +10,7 @@ export const LegalEntityNameField = JSX<CustomFieldProps>(({ field, input }) =>
10
10
  label="Наименование юридического лица"
11
11
  {...input}
12
12
  {...getValidation(field('legalEntityName'), validatorObj.legalEntityName, input?.required)}
13
+ disabled={!field?.('shareholderFlg')?.value}
13
14
  />
14
15
  );
15
16
  });
@@ -20,17 +20,19 @@ export interface SelectFieldProps extends CustomFieldProps, UniBlockProps {
20
20
  fieldName: string;
21
21
  placeholder?: string;
22
22
  isSearch?: boolean;
23
+ disabled?: boolean;
23
24
  }
24
25
 
25
26
  export const SelectField = UniBlock<SelectFieldProps>(
26
27
  ({
27
28
  field,
28
29
  source,
29
- label,
30
30
  fieldName,
31
31
  input,
32
32
  placeholder = 'Выберите из списка',
33
- isSearch = false,
33
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
+ options,
35
+ ...rest
34
36
  }) => {
35
37
  const leadOptions: Option[] =
36
38
  source?.map((_: LeadProps) => ({
@@ -41,10 +43,9 @@ export const SelectField = UniBlock<SelectFieldProps>(
41
43
  return (
42
44
  <SelectControl
43
45
  placeholder={placeholder}
44
- label={label}
45
46
  options={leadOptions}
46
- isSearch={isSearch}
47
47
  {...getValidation(field(fieldName), validatorObj[fieldName], input?.required)}
48
+ {...rest}
48
49
  />
49
50
  );
50
51
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFirstStepData.js","sourceRoot":"","sources":["../../../src/components/CreditCardForm/getFirstStepData.tsx"],"names":[],"mappings":";;AAGO,MAAM,gBAAgB,GAAG,CAAC,QAAmB,EAAwB,EAAE;IAC5E,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAErE,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,aAAa;QAClC,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,gBAAgB,oBAS3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFirstStepData.js","sourceRoot":"","sources":["../../../src/components/CreditCardForm/getFirstStepData.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAmB,EAAwB,EAAE;IAC5E,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAErE,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,aAAa;QAClC,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type Participant } from '../../api/RetailAPI/updateUserTask';
2
- import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
3
- export declare const getFirstStepData: (formData: FormState) => Partial<Participant>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFirstStepData.js","sourceRoot":"","sources":["../../../src/components/CreditCardForm/getFirstStepData.tsx"],"names":[],"mappings":";;AAGO,MAAM,gBAAgB,GAAG,CAAC,QAAmB,EAAwB,EAAE;IAC5E,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAErE,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,aAAa;QAClC,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,gBAAgB,oBAS3B"}
@@ -1,3 +0,0 @@
1
- import { type Participant } from '../../api/RetailAPI/updateUserTask';
2
- import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
3
- export declare const getFirstStepData: (formData: FormState) => Partial<Participant>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFirstStepData.js","sourceRoot":"","sources":["../../../src/components/CreditCardForm/getFirstStepData.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAmB,EAAwB,EAAE;IAC5E,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAErE,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,aAAa;QAClC,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC,CAAC"}