@redneckz/wildless-cms-uni-blocks 0.14.235 → 0.14.237

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 (110) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +16 -7
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  5. package/bundle/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  6. package/dist/api/LeadServiceAPI.js +2 -1
  7. package/dist/api/LeadServiceAPI.js.map +1 -1
  8. package/dist/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  9. package/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  10. package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  11. package/dist/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  12. package/dist/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  13. package/dist/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  14. package/dist/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  15. package/dist/components/ApplicationFormCustom/VedField.js +7 -0
  16. package/dist/components/ApplicationFormCustom/VedField.js.map +1 -1
  17. package/dist/components/ApplicationFormCustom/getField.js +1 -0
  18. package/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  19. package/dist/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  20. package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  21. package/dist/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  22. package/{mobile/dist/hooks/usePremiumBranchesByRegions.js → dist/hooks/useBranchesByRegions.js} +5 -5
  23. package/dist/hooks/useBranchesByRegions.js.map +1 -0
  24. package/lib/api/LeadServiceAPI.js +2 -1
  25. package/lib/api/LeadServiceAPI.js.map +1 -1
  26. package/lib/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  27. package/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  28. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.fixture.d.ts +1 -0
  29. package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  30. package/lib/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  31. package/lib/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  32. package/lib/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  33. package/lib/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  34. package/lib/components/ApplicationFormCustom/VedField.js +7 -0
  35. package/lib/components/ApplicationFormCustom/VedField.js.map +1 -1
  36. package/lib/components/ApplicationFormCustom/getField.js +1 -0
  37. package/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  38. package/lib/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  39. package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  40. package/lib/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  41. package/lib/hooks/{usePremiumBranchesByRegions.js → useBranchesByRegions.js} +3 -3
  42. package/lib/hooks/useBranchesByRegions.js.map +1 -0
  43. package/mobile/bundle/bundle.umd.js +16 -7
  44. package/mobile/bundle/bundle.umd.min.js +1 -1
  45. package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  46. package/mobile/bundle/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  47. package/mobile/dist/api/LeadServiceAPI.js +2 -1
  48. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  49. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  50. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  51. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  52. package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  53. package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  54. package/mobile/dist/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  55. package/mobile/dist/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  56. package/mobile/dist/components/ApplicationFormCustom/VedField.js +7 -0
  57. package/mobile/dist/components/ApplicationFormCustom/VedField.js.map +1 -1
  58. package/mobile/dist/components/ApplicationFormCustom/getField.js +1 -0
  59. package/mobile/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  60. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  61. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  62. package/mobile/dist/hooks/useBranchesByRegions.d.ts +8 -0
  63. package/{dist/hooks/usePremiumBranchesByRegions.js → mobile/dist/hooks/useBranchesByRegions.js} +5 -5
  64. package/mobile/dist/hooks/useBranchesByRegions.js.map +1 -0
  65. package/mobile/lib/api/LeadServiceAPI.js +2 -1
  66. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  67. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  68. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  69. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  70. package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  71. package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  72. package/mobile/lib/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  73. package/mobile/lib/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  74. package/mobile/lib/components/ApplicationFormCustom/VedField.js +7 -0
  75. package/mobile/lib/components/ApplicationFormCustom/VedField.js.map +1 -1
  76. package/mobile/lib/components/ApplicationFormCustom/getField.js +1 -0
  77. package/mobile/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  78. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  79. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  80. package/mobile/lib/hooks/useBranchesByRegions.d.ts +8 -0
  81. package/mobile/lib/hooks/{usePremiumBranchesByRegions.js → useBranchesByRegions.js} +3 -3
  82. package/mobile/lib/hooks/useBranchesByRegions.js.map +1 -0
  83. package/mobile/src/api/LeadServiceAPI.ts +5 -1
  84. package/mobile/src/components/ApplicationFormCustom/AddressBranchField.tsx +2 -2
  85. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +33 -0
  86. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +4 -2
  87. package/mobile/src/components/ApplicationFormCustom/PosTerminalField.tsx +1 -1
  88. package/mobile/src/components/ApplicationFormCustom/RegionPremiumField.tsx +2 -2
  89. package/mobile/src/components/ApplicationFormCustom/VedField.tsx +7 -0
  90. package/mobile/src/components/ApplicationFormCustom/getField.tsx +6 -0
  91. package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +1 -0
  92. package/mobile/src/hooks/{usePremiumBranchesByRegions.ts → useBranchesByRegions.ts} +2 -2
  93. package/package.json +1 -1
  94. package/src/api/LeadServiceAPI.ts +5 -1
  95. package/src/components/ApplicationFormCustom/AddressBranchField.tsx +2 -2
  96. package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +33 -0
  97. package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +28 -0
  98. package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +4 -2
  99. package/src/components/ApplicationFormCustom/PosTerminalField.tsx +1 -1
  100. package/src/components/ApplicationFormCustom/RegionPremiumField.tsx +2 -2
  101. package/src/components/ApplicationFormCustom/VedField.tsx +7 -0
  102. package/src/components/ApplicationFormCustom/getField.tsx +6 -0
  103. package/src/components/ApplicationFormCustom/getInitialFormState.tsx +1 -0
  104. package/src/hooks/{usePremiumBranchesByRegions.ts → useBranchesByRegions.ts} +2 -2
  105. package/dist/hooks/usePremiumBranchesByRegions.js.map +0 -1
  106. package/lib/hooks/usePremiumBranchesByRegions.js.map +0 -1
  107. package/mobile/dist/hooks/usePremiumBranchesByRegions.d.ts +0 -8
  108. package/mobile/dist/hooks/usePremiumBranchesByRegions.js.map +0 -1
  109. package/mobile/lib/hooks/usePremiumBranchesByRegions.d.ts +0 -8
  110. package/mobile/lib/hooks/usePremiumBranchesByRegions.js.map +0 -1
@@ -40,6 +40,39 @@
40
40
  }
41
41
  }
42
42
  ],
43
+ [
44
+ "Аналитика ФЛ",
45
+ {
46
+ "content": {
47
+ "title": "Подпишитесь на аналитику",
48
+ "typeForm": "ANALITIC",
49
+ "endpoint": "lead",
50
+ "sections": [
51
+ {
52
+ "title": "Получайте аналитические материалы для начинающих и профессиональных инвесторов на почту",
53
+ "inputs": []
54
+ },
55
+ {
56
+ "inputs": [
57
+ { "name": "name", "required": true },
58
+ { "name": "email", "required": true },
59
+ { "name": "consentToReceiveMaterials" },
60
+ { "name": "consentDataProcessing", "required": true }
61
+ ]
62
+ }
63
+ ],
64
+ "button": {
65
+ "text": "Отправить заявку",
66
+ "version": "primary"
67
+ },
68
+ "link": {
69
+ "text": "Согласен на обработку персональных данных",
70
+ "href": "/privacy-policy",
71
+ "target": "_blank"
72
+ }
73
+ }
74
+ }
75
+ ],
43
76
  [
44
77
  "Предупреждение о мошенничестве ФЛ",
45
78
  {
@@ -21,7 +21,7 @@ export interface SubmitButtonProps {
21
21
  /**
22
22
  * @title Название поля ввода
23
23
  * @required
24
- * @enumNames ["Фамилия", "Имя", "Отчество", "Email", "Телефон", "ФИО", "ИНН", "Комментарий", "Регион", "Адрес", "Тип формы", "День рождения", "Клиент банка", "Тип эквайринга", "Онлайн касса", "POS-терминал", "Ультра/Премиум", "ВЭД", "Срок (месяцев)", "Сумма ₽", "Годовой доход", "Количество объектов инкассации", "Комментарий партнёров", "Согласие на обработку"]
24
+ * @enumNames ["Фамилия", "Имя", "Отчество", "Email", "Телефон", "ФИО", "ИНН", "Комментарий", "Регион", "Адрес", "Тип формы", "День рождения", "Клиент банка", "Согласие на получение материалов", "Тип эквайринга", "Онлайн касса", "POS-терминал", "Ультра/Премиум", "ВЭД", "Срок (месяцев)", "Сумма ₽", "Годовой доход", "Количество объектов инкассации", "Комментарий партнёров", "Согласие на обработку"]
25
25
  */
26
26
  export type NameFieldDef =
27
27
  | 'surname'
@@ -37,6 +37,7 @@ export type NameFieldDef =
37
37
  | 'typeForm'
38
38
  | 'birthday'
39
39
  | 'isClient'
40
+ | 'consentToReceiveMaterials'
40
41
  | 'acquiringType'
41
42
  | 'onlineCheckout'
42
43
  | 'posTerminal'
@@ -65,10 +66,11 @@ export type FieldDef = Required &
65
66
  /**
66
67
  * @title Тип формы
67
68
  * @required
68
- * @enumNames ["Эквайринг ЮЛ", "Мошенничество ФЛ", "Бизнес-карта ЮЛ", "Брокерское обслуживание ЮЛ", "Брокерский счет ФЛ", "Инкассация ЮЛ", "Факты коррупции ФЛ", "Кредит ЮЛ", "Депозит ЮЛ", "Консультация по продукту ФЛ", "Самоинкассация ЮЛ", "ВЭД ЮЛ", "Ультра ФЛ", "Премиум ФЛ"]
69
+ * @enumNames ["Эквайринг ЮЛ", "Аналитика ФЛ", "Мошенничество ФЛ", "Бизнес-карта ЮЛ", "Брокерское обслуживание ЮЛ", "Брокерский счет ФЛ", "Инкассация ЮЛ", "Факты коррупции ФЛ", "Кредит ЮЛ", "Депозит ЮЛ", "Консультация по продукту ФЛ", "Самоинкассация ЮЛ", "ВЭД ЮЛ", "Ультра ФЛ", "Премиум ФЛ"]
69
70
  */
70
71
  type TypeFormFieldDef =
71
72
  | 'ACQR'
73
+ | 'ANALITIC'
72
74
  | 'ANTIFRAUD'
73
75
  | 'BCRD'
74
76
  | 'BROK'
@@ -5,6 +5,6 @@ import { type CustomFieldProps } from './CustomFieldProps';
5
5
 
6
6
  export const PosTerminalField = JSX<CustomFieldProps>(({ field }) =>
7
7
  isAcquiringTrade(field('acquiringType')?.value?.key as string) ? (
8
- <SlideCheckbox type="radio" text="Хочу купить POS-терминал" {...field('posTerminal')} />
8
+ <SlideCheckbox type="radio" text="Хочу POS-терминал" {...field('posTerminal')} />
9
9
  ) : null,
10
10
  );
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
- import { usePremiumBranchesByRegions } from '../../hooks/usePremiumBranchesByRegions';
3
+ import { useBranchesByRegions } from '../../hooks/useBranchesByRegions';
4
4
  import { type Option } from '../../ui-kit/Select/Option';
5
5
  import { SelectControl } from '../../ui-kit/Select/SelectControl';
6
6
  import { type CustomFieldProps } from './CustomFieldProps';
@@ -8,7 +8,7 @@ import { validatorObj } from './getObjectValidator';
8
8
  import { getValidation } from './getValidation';
9
9
 
10
10
  export const RegionPremiumField = JSX<CustomFieldProps>(({ field, input }) => {
11
- const branchByRegions = usePremiumBranchesByRegions();
11
+ const branchByRegions = useBranchesByRegions();
12
12
  const regions = useMemo(
13
13
  () =>
14
14
  branchByRegions?.map(({ region }) => ({
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { Radio } from '../../ui-kit/Radio/Radio';
3
4
  import { type CustomFieldProps } from './CustomFieldProps';
4
5
 
@@ -11,6 +12,12 @@ export const VED_TYPES: string[] = [
11
12
 
12
13
  export const VedField = JSX<CustomFieldProps>(({ field }) => {
13
14
  const { value, onChange } = field('vedTypes');
15
+ useEffect(() => {
16
+ if (value !== 'currencyControl') {
17
+ field?.('inn')?.onChange?.('');
18
+ field?.('region')?.onChange?.('');
19
+ }
20
+ }, [value]);
14
21
 
15
22
  return (
16
23
  <div className="py-m space-x-m grid @xl:flex @xl:items-center">
@@ -86,6 +86,12 @@ export const getField =
86
86
  text='Являюсь клиентом банка АО "Россельхозбанк"'
87
87
  />
88
88
  ),
89
+ consentToReceiveMaterials: (
90
+ <CheckboxWithError
91
+ {...field('consentToReceiveMaterials')}
92
+ text="Согласен на получение информационных и аналитических материалов по электронной почте"
93
+ />
94
+ ),
89
95
  partnerComments: (
90
96
  <InputControl
91
97
  {...getValidation(field('partnerComments'), validatorObj.partnerComments, required)}
@@ -43,6 +43,7 @@ const initialFormState = {
43
43
  isClient: false,
44
44
  onlineCheckout: false,
45
45
  posTerminal: false,
46
+ consentToReceiveMaterials: false,
46
47
  consentDataProcessing: false,
47
48
  };
48
49
 
@@ -1,7 +1,7 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
2
  import { fetchJSONUnsafe, type FetchJSONUnsafeType } from '../utils/fetchJSON';
3
3
 
4
- const REGIONS_URL = '/api/v1/premiumBranchesByRegions';
4
+ const REGIONS_URL = '/api/v1/branchesByRegions';
5
5
 
6
6
  export interface Region {
7
7
  region: string;
@@ -11,7 +11,7 @@ export interface Region {
11
11
  }[];
12
12
  }
13
13
 
14
- export function usePremiumBranchesByRegions(): Region[] {
14
+ export function useBranchesByRegions(): Region[] {
15
15
  const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe as FetchJSONUnsafeType<Region[]>);
16
16
 
17
17
  return Array.isArray(data) ? data : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.235",
3
+ "version": "0.14.237",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -45,8 +45,8 @@ export function LeadServiceAPI() {
45
45
  const submitBody = {
46
46
  typeForm,
47
47
  [isIndividualType ? 'regionBranch' : 'region']: region,
48
- [isIndividualType ? 'phoneNumber' : 'phone']: formatPhone(phone),
49
48
  [isIndividualType ? 'email' : 'mail']: email,
49
+ ...getPhone(phone),
50
50
  ...(isIndividualType ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
51
51
  ...(typeForm === 'FEEDBACK'
52
52
  ? {}
@@ -58,6 +58,7 @@ export function LeadServiceAPI() {
58
58
  }),
59
59
  ...staticBody,
60
60
  };
61
+
61
62
  try {
62
63
  const response = await fetch(url, {
63
64
  method: 'POST',
@@ -83,6 +84,9 @@ export function LeadServiceAPI() {
83
84
  };
84
85
  }
85
86
 
87
+ const getPhone = (phone?: string, isIndividual?: boolean) =>
88
+ phone ? { [isIndividual ? 'phoneNumber' : 'phone']: formatPhone(phone) } : {};
89
+
86
90
  const getSecondaryPhone = (secondaryPhone?: string) =>
87
91
  !secondaryPhone || secondaryPhone === '+7 ('
88
92
  ? {}
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useBranches } from '../../hooks/useBranches';
4
- import { usePremiumBranchesByRegions } from '../../hooks/usePremiumBranchesByRegions';
4
+ import { useBranchesByRegions } from '../../hooks/useBranchesByRegions';
5
5
  import { SelectControl } from '../../ui-kit/Select/SelectControl';
6
6
  import type { CustomFieldProps } from './CustomFieldProps';
7
7
  import { validatorObj } from './getObjectValidator';
@@ -15,7 +15,7 @@ export const AddressBranchField = JSX<RegionFieldProps>(({ field, input, isPremi
15
15
  const regionKey = field('region')?.value?.key as string;
16
16
  const regionText = field('region')?.value?.text as string;
17
17
  const addressBranch = isPremium
18
- ? usePremiumBranchesByRegions()?.find((_) => _?.region === regionText)?.branches
18
+ ? useBranchesByRegions()?.find((_) => _?.region === regionText)?.branches
19
19
  : useBranches(regionKey)?.filter((branch) => branch?.address);
20
20
  useEffect(() => {
21
21
  if (field('region')?.value?.key !== '') {
@@ -40,6 +40,39 @@
40
40
  }
41
41
  }
42
42
  ],
43
+ [
44
+ "Аналитика ФЛ",
45
+ {
46
+ "content": {
47
+ "title": "Подпишитесь на аналитику",
48
+ "typeForm": "ANALITIC",
49
+ "endpoint": "lead",
50
+ "sections": [
51
+ {
52
+ "title": "Получайте аналитические материалы для начинающих и профессиональных инвесторов на почту",
53
+ "inputs": []
54
+ },
55
+ {
56
+ "inputs": [
57
+ { "name": "name", "required": true },
58
+ { "name": "email", "required": true },
59
+ { "name": "consentToReceiveMaterials" },
60
+ { "name": "consentDataProcessing", "required": true }
61
+ ]
62
+ }
63
+ ],
64
+ "button": {
65
+ "text": "Отправить заявку",
66
+ "version": "primary"
67
+ },
68
+ "link": {
69
+ "text": "Согласен на обработку персональных данных",
70
+ "href": "/privacy-policy",
71
+ "target": "_blank"
72
+ }
73
+ }
74
+ }
75
+ ],
43
76
  [
44
77
  "Предупреждение о мошенничестве ФЛ",
45
78
  {
@@ -80,6 +80,34 @@ export default {
80
80
  <PopupManager />
81
81
  </div>
82
82
  ),
83
+ analytics: (
84
+ <div className="container grid grid-cols-12">
85
+ <ApplicationFormCustom
86
+ className="col-span-12"
87
+ title="Подпишитесь на аналитику"
88
+ typeForm="ANALITIC"
89
+ endpoint="lead"
90
+ sections={[
91
+ {
92
+ title:
93
+ 'Получайте аналитические материалы для начинающих и профессиональных инвесторов на почту',
94
+ inputs: [],
95
+ },
96
+ {
97
+ inputs: [
98
+ { name: 'name', required: true },
99
+ { name: 'email', required: true },
100
+ { name: 'consentToReceiveMaterials' },
101
+ { name: 'consentDataProcessing', required: true },
102
+ ],
103
+ },
104
+ ]}
105
+ button={button}
106
+ link={link}
107
+ />
108
+ <PopupManager />
109
+ </div>
110
+ ),
83
111
  antiFraud: (
84
112
  <div className="container grid grid-cols-12">
85
113
  <ApplicationFormCustom
@@ -21,7 +21,7 @@ export interface SubmitButtonProps {
21
21
  /**
22
22
  * @title Название поля ввода
23
23
  * @required
24
- * @enumNames ["Фамилия", "Имя", "Отчество", "Email", "Телефон", "ФИО", "ИНН", "Комментарий", "Регион", "Адрес", "Тип формы", "День рождения", "Клиент банка", "Тип эквайринга", "Онлайн касса", "POS-терминал", "Ультра/Премиум", "ВЭД", "Срок (месяцев)", "Сумма ₽", "Годовой доход", "Количество объектов инкассации", "Комментарий партнёров", "Согласие на обработку"]
24
+ * @enumNames ["Фамилия", "Имя", "Отчество", "Email", "Телефон", "ФИО", "ИНН", "Комментарий", "Регион", "Адрес", "Тип формы", "День рождения", "Клиент банка", "Согласие на получение материалов", "Тип эквайринга", "Онлайн касса", "POS-терминал", "Ультра/Премиум", "ВЭД", "Срок (месяцев)", "Сумма ₽", "Годовой доход", "Количество объектов инкассации", "Комментарий партнёров", "Согласие на обработку"]
25
25
  */
26
26
  export type NameFieldDef =
27
27
  | 'surname'
@@ -37,6 +37,7 @@ export type NameFieldDef =
37
37
  | 'typeForm'
38
38
  | 'birthday'
39
39
  | 'isClient'
40
+ | 'consentToReceiveMaterials'
40
41
  | 'acquiringType'
41
42
  | 'onlineCheckout'
42
43
  | 'posTerminal'
@@ -65,10 +66,11 @@ export type FieldDef = Required &
65
66
  /**
66
67
  * @title Тип формы
67
68
  * @required
68
- * @enumNames ["Эквайринг ЮЛ", "Мошенничество ФЛ", "Бизнес-карта ЮЛ", "Брокерское обслуживание ЮЛ", "Брокерский счет ФЛ", "Инкассация ЮЛ", "Факты коррупции ФЛ", "Кредит ЮЛ", "Депозит ЮЛ", "Консультация по продукту ФЛ", "Самоинкассация ЮЛ", "ВЭД ЮЛ", "Ультра ФЛ", "Премиум ФЛ"]
69
+ * @enumNames ["Эквайринг ЮЛ", "Аналитика ФЛ", "Мошенничество ФЛ", "Бизнес-карта ЮЛ", "Брокерское обслуживание ЮЛ", "Брокерский счет ФЛ", "Инкассация ЮЛ", "Факты коррупции ФЛ", "Кредит ЮЛ", "Депозит ЮЛ", "Консультация по продукту ФЛ", "Самоинкассация ЮЛ", "ВЭД ЮЛ", "Ультра ФЛ", "Премиум ФЛ"]
69
70
  */
70
71
  type TypeFormFieldDef =
71
72
  | 'ACQR'
73
+ | 'ANALITIC'
72
74
  | 'ANTIFRAUD'
73
75
  | 'BCRD'
74
76
  | 'BROK'
@@ -5,6 +5,6 @@ import { type CustomFieldProps } from './CustomFieldProps';
5
5
 
6
6
  export const PosTerminalField = JSX<CustomFieldProps>(({ field }) =>
7
7
  isAcquiringTrade(field('acquiringType')?.value?.key as string) ? (
8
- <SlideCheckbox type="radio" text="Хочу купить POS-терминал" {...field('posTerminal')} />
8
+ <SlideCheckbox type="radio" text="Хочу POS-терминал" {...field('posTerminal')} />
9
9
  ) : null,
10
10
  );
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
- import { usePremiumBranchesByRegions } from '../../hooks/usePremiumBranchesByRegions';
3
+ import { useBranchesByRegions } from '../../hooks/useBranchesByRegions';
4
4
  import { type Option } from '../../ui-kit/Select/Option';
5
5
  import { SelectControl } from '../../ui-kit/Select/SelectControl';
6
6
  import { type CustomFieldProps } from './CustomFieldProps';
@@ -8,7 +8,7 @@ import { validatorObj } from './getObjectValidator';
8
8
  import { getValidation } from './getValidation';
9
9
 
10
10
  export const RegionPremiumField = JSX<CustomFieldProps>(({ field, input }) => {
11
- const branchByRegions = usePremiumBranchesByRegions();
11
+ const branchByRegions = useBranchesByRegions();
12
12
  const regions = useMemo(
13
13
  () =>
14
14
  branchByRegions?.map(({ region }) => ({
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { Radio } from '../../ui-kit/Radio/Radio';
3
4
  import { type CustomFieldProps } from './CustomFieldProps';
4
5
 
@@ -11,6 +12,12 @@ export const VED_TYPES: string[] = [
11
12
 
12
13
  export const VedField = JSX<CustomFieldProps>(({ field }) => {
13
14
  const { value, onChange } = field('vedTypes');
15
+ useEffect(() => {
16
+ if (value !== 'currencyControl') {
17
+ field?.('inn')?.onChange?.('');
18
+ field?.('region')?.onChange?.('');
19
+ }
20
+ }, [value]);
14
21
 
15
22
  return (
16
23
  <div className="py-m space-x-m grid @xl:flex @xl:items-center">
@@ -86,6 +86,12 @@ export const getField =
86
86
  text='Являюсь клиентом банка АО "Россельхозбанк"'
87
87
  />
88
88
  ),
89
+ consentToReceiveMaterials: (
90
+ <CheckboxWithError
91
+ {...field('consentToReceiveMaterials')}
92
+ text="Согласен на получение информационных и аналитических материалов по электронной почте"
93
+ />
94
+ ),
89
95
  partnerComments: (
90
96
  <InputControl
91
97
  {...getValidation(field('partnerComments'), validatorObj.partnerComments, required)}
@@ -43,6 +43,7 @@ const initialFormState = {
43
43
  isClient: false,
44
44
  onlineCheckout: false,
45
45
  posTerminal: false,
46
+ consentToReceiveMaterials: false,
46
47
  consentDataProcessing: false,
47
48
  };
48
49
 
@@ -1,7 +1,7 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
2
  import { fetchJSONUnsafe, type FetchJSONUnsafeType } from '../utils/fetchJSON';
3
3
 
4
- const REGIONS_URL = '/api/v1/premiumBranchesByRegions';
4
+ const REGIONS_URL = '/api/v1/branchesByRegions';
5
5
 
6
6
  export interface Region {
7
7
  region: string;
@@ -11,7 +11,7 @@ export interface Region {
11
11
  }[];
12
12
  }
13
13
 
14
- export function usePremiumBranchesByRegions(): Region[] {
14
+ export function useBranchesByRegions(): Region[] {
15
15
  const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe as FetchJSONUnsafeType<Region[]>);
16
16
 
17
17
  return Array.isArray(data) ? data : [];
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePremiumBranchesByRegions.js","sourceRoot":"","sources":["../../src/hooks/usePremiumBranchesByRegions.ts"],"names":[],"mappings":";;AAAA,2EAAwE;AACxE,kDAA+E;AAE/E,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAUvD,SAAgB,2BAA2B;IACzC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,2BAAY,EAAC,WAAW,EAAE,2BAAgD,CAAC,CAAC;IAE7F,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAJD,kEAIC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePremiumBranchesByRegions.js","sourceRoot":"","sources":["../../src/hooks/usePremiumBranchesByRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAE/E,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAUvD,MAAM,UAAU,2BAA2B;IACzC,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE,eAAgD,CAAC,CAAC;IAE7F,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC"}
@@ -1,8 +0,0 @@
1
- export interface Region {
2
- region: string;
3
- branches: {
4
- address: string;
5
- branchCode?: string;
6
- }[];
7
- }
8
- export declare function usePremiumBranchesByRegions(): Region[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePremiumBranchesByRegions.js","sourceRoot":"","sources":["../../src/hooks/usePremiumBranchesByRegions.ts"],"names":[],"mappings":";;AAAA,2EAAwE;AACxE,kDAA+E;AAE/E,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAUvD,SAAgB,2BAA2B;IACzC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,2BAAY,EAAC,WAAW,EAAE,2BAAgD,CAAC,CAAC;IAE7F,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAJD,kEAIC"}
@@ -1,8 +0,0 @@
1
- export interface Region {
2
- region: string;
3
- branches: {
4
- address: string;
5
- branchCode?: string;
6
- }[];
7
- }
8
- export declare function usePremiumBranchesByRegions(): Region[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePremiumBranchesByRegions.js","sourceRoot":"","sources":["../../src/hooks/usePremiumBranchesByRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAE/E,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAUvD,MAAM,UAAU,2BAA2B;IACzC,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE,eAAgD,CAAC,CAAC;IAE7F,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC"}