hl-core 0.0.7-beta.9 → 0.0.8

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 (52) hide show
  1. package/.prettierrc +2 -1
  2. package/api/index.ts +66 -47
  3. package/api/interceptors.ts +4 -4
  4. package/components/Button/Btn.vue +7 -2
  5. package/components/Button/ScrollButtons.vue +6 -0
  6. package/components/Complex/ContentBlock.vue +5 -0
  7. package/components/{Layout → Dialog}/Dialog.vue +3 -27
  8. package/components/Dialog/FamilyDialog.vue +39 -0
  9. package/components/Form/FormBlock.vue +114 -0
  10. package/components/Form/FormSection.vue +18 -0
  11. package/components/Form/FormTextSection.vue +20 -0
  12. package/components/Form/FormToggle.vue +52 -0
  13. package/components/Form/ProductConditionsBlock.vue +68 -0
  14. package/components/Input/EmptyFormField.vue +5 -0
  15. package/components/Input/FileInput.vue +71 -0
  16. package/components/Input/FormInput.vue +171 -0
  17. package/components/Input/PanelInput.vue +133 -0
  18. package/components/Input/RoundedInput.vue +35 -36
  19. package/components/Layout/Drawer.vue +18 -16
  20. package/components/Layout/Header.vue +4 -18
  21. package/components/Layout/Loader.vue +1 -7
  22. package/components/Layout/SettingsPanel.vue +17 -37
  23. package/components/List/ListEmpty.vue +22 -0
  24. package/components/Menu/MenuNav.vue +22 -20
  25. package/components/Menu/MenuNavItem.vue +6 -6
  26. package/components/Pages/Anketa.vue +333 -0
  27. package/components/Pages/Auth.vue +91 -0
  28. package/components/Pages/Documents.vue +108 -0
  29. package/components/Pages/MemberForm.vue +1138 -0
  30. package/components/Pages/ProductAgreement.vue +18 -0
  31. package/components/Pages/ProductConditions.vue +349 -0
  32. package/components/Panel/PanelItem.vue +2 -4
  33. package/components/Panel/PanelSelectItem.vue +20 -0
  34. package/components/Transitions/FadeTransition.vue +5 -0
  35. package/composables/classes.ts +299 -253
  36. package/composables/constants.ts +14 -7
  37. package/composables/index.ts +55 -60
  38. package/composables/styles.ts +31 -7
  39. package/layouts/default.vue +46 -26
  40. package/layouts/full.vue +2 -12
  41. package/nuxt.config.ts +3 -0
  42. package/package.json +13 -10
  43. package/pages/500.vue +40 -12
  44. package/plugins/helperFunctionsPlugins.ts +6 -2
  45. package/plugins/storePlugin.ts +6 -5
  46. package/store/data.store.js +781 -1880
  47. package/store/member.store.ts +291 -0
  48. package/store/messages.ts +66 -51
  49. package/store/rules.js +26 -28
  50. package/types/index.ts +250 -0
  51. package/composables/models.ts +0 -43
  52. /package/store/{form.store.js → form.store.ts} +0 -0
package/store/rules.js CHANGED
@@ -1,11 +1,8 @@
1
1
  import { t } from './messages';
2
+ import { formatDate } from '../composables';
2
3
 
3
4
  export const rules = {
4
- recalculationMultiply: [
5
- v =>
6
- (v !== null && v !== '' && v >= 100) ||
7
- t('toaster.valueShouldBeHigher', { text: 100 }),
8
- ],
5
+ recalculationMultiply: [v => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher').replace('{text}', '100')],
9
6
  recalculationAdditive: [
10
7
  v =>
11
8
  (v !== null && v !== '' && v <= 100 && v >= 0) ||
@@ -34,9 +31,7 @@ export const rules = {
34
31
  return t('rules.required');
35
32
  },
36
33
  ],
37
- cyrillic: [
38
- v => v === null || /^[\u0400-\u04FF ]+$/.test(v) || t('rules.cyrillic'),
39
- ],
34
+ cyrillic: [v => v === null || /^[\u0400-\u04FF ]+$/.test(v) || t('rules.cyrillic')],
40
35
  email: [
41
36
  v => {
42
37
  if (v === '' || v === null) {
@@ -45,9 +40,7 @@ export const rules = {
45
40
  if (
46
41
  String(v)
47
42
  .toLowerCase()
48
- .match(
49
- /^(([^<>()[\]\\.,;=\s@"]+(\.[^<>()[\]\\.,;=\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
50
- )
43
+ .match(/^(([^<>()[\]\\.,;=\s@"]+(\.[^<>()[\]\\.,;=\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)
51
44
  ) {
52
45
  return true;
53
46
  } else {
@@ -57,9 +50,7 @@ export const rules = {
57
50
  },
58
51
  ],
59
52
  numbers: [v => /^[0-9]+$/.test(v) || t('rules.numbers')],
60
- numbersSymbols: [
61
- v => /^([0-9])|(\W|_)+$/.test(v) || t('rules.numbersSymbols'),
62
- ],
53
+ numbersSymbols: [v => /^([0-9])|(\W|_)+$/.test(v) || t('rules.numbersSymbols')],
63
54
  ageExceeds: [v => v < 50 || t('rules.ageExceeds')],
64
55
  sums: [
65
56
  v => {
@@ -72,7 +63,7 @@ export const rules = {
72
63
  ],
73
64
  iinRight: [
74
65
  v => {
75
- if (v.length !== 15) {
66
+ if (v.length !== useMask().iin.length) {
76
67
  return t('rules.iinRight');
77
68
  }
78
69
  return true;
@@ -84,7 +75,7 @@ export const rules = {
84
75
  if (v === null || v == '') {
85
76
  return true;
86
77
  }
87
- if (v && v.length === 18) {
78
+ if (v && v.length === useMask().phone.length) {
88
79
  return true;
89
80
  } else {
90
81
  return t('rules.phoneFormat');
@@ -94,11 +85,7 @@ export const rules = {
94
85
  date: [
95
86
  v => {
96
87
  if (v === null || v == '') return true;
97
- if (
98
- /^(0[1-9]|1[0-9]|2[0-9]|3[0-1])(-|\.)(0[1-9]|1[0-2])(-|\.)(19[0-9]{2}|20[0-9][0-9])$/.test(
99
- v,
100
- )
101
- ) {
88
+ if (/^(0[1-9]|1[0-9]|2[0-9]|3[0-1])(-|\.)(0[1-9]|1[0-2])(-|\.)(19[0-9]{2}|20[0-9][0-9])$/.test(v)) {
102
89
  return true;
103
90
  } else {
104
91
  return t('rules.date');
@@ -108,13 +95,8 @@ export const rules = {
108
95
  age: [v => /^\d+$/.test(v) || t('rules.age')],
109
96
  birthDate: [
110
97
  v => {
111
- if (new Date(formatDate(v)) > new Date(Date.now()))
112
- return t('rules.exceedDate');
113
- if (
114
- /^(0[1-9]|1[0-9]|2[0-9]|3[0-1])(-|\.)(0[1-9]|1[0-2])(-|\.)(19[0-9]{2}|20[0-9][0-9])$/.test(
115
- v,
116
- )
117
- ) {
98
+ if (new Date(formatDate(v)) > new Date(Date.now())) return t('rules.exceedDate');
99
+ if (/^(0[1-9]|1[0-9]|2[0-9]|3[0-1])(-|\.)(0[1-9]|1[0-2])(-|\.)(19[0-9]{2}|20[0-9][0-9])$/.test(v)) {
118
100
  return true;
119
101
  } else {
120
102
  return t('rules.date');
@@ -128,6 +110,20 @@ export const rules = {
128
110
  return t('rules.coverPeriod');
129
111
  }
130
112
  return true;
113
+ } else {
114
+ return t('rules.coverPeriod');
115
+ }
116
+ },
117
+ ],
118
+ coverPeriodFrom3to20: [
119
+ v => {
120
+ if (v !== null) {
121
+ if (v < 3 || v > 20) {
122
+ return t('productConditionsForm.coverPeriodFrom3to20');
123
+ }
124
+ return true;
125
+ } else {
126
+ return t('productConditionsForm.coverPeriodFrom3to20');
131
127
  }
132
128
  },
133
129
  ],
@@ -152,4 +148,6 @@ export const rules = {
152
148
  }
153
149
  },
154
150
  ],
151
+ policyholderAgeLimit: [v => v >= 18 || t('rules.policyholderAgeLimit')],
152
+ beneficiaryAgeLimit: [v => v <= 15 || t('rules.beneficiaryAgeLimit')],
155
153
  };
package/types/index.ts ADDED
@@ -0,0 +1,250 @@
1
+ export {};
2
+
3
+ declare global {
4
+ type MemberKeys = keyof ReturnType<typeof useFormStore>;
5
+ type MemberFormTypes = 'policyholderForm' | 'insuredForm' | 'beneficiaryForm' | 'beneficialOwnerForm' | 'policyholdersRepresentativeForm' | 'productConditionsForm';
6
+ type PanelTypes = 'settings' | 'panel';
7
+ type FileActions = 'view' | 'download';
8
+ type InputVariants = 'solo' | 'filled' | 'outlined' | 'plain' | 'underlined';
9
+ type InputTypes =
10
+ | 'button'
11
+ | 'checkbox'
12
+ | 'color'
13
+ | 'date'
14
+ | 'datetime-local'
15
+ | 'email'
16
+ | 'file'
17
+ | 'hidden'
18
+ | 'image'
19
+ | 'month'
20
+ | 'number'
21
+ | 'password'
22
+ | 'radio'
23
+ | 'range'
24
+ | 'reset'
25
+ | 'search'
26
+ | 'submit'
27
+ | 'tel'
28
+ | 'text'
29
+ | 'time'
30
+ | 'url'
31
+ | 'week';
32
+ type TaskListItem = {
33
+ addRegNumber: string | number;
34
+ applicationTaskId: string;
35
+ dateCreated: string;
36
+ historyStatus: string;
37
+ historyStatusTitle: string;
38
+ id: string;
39
+ iin: string;
40
+ insurerIin: string;
41
+ insurerLongName: string;
42
+ isTask: boolean | number;
43
+ longName: string;
44
+ number: string;
45
+ processCode: number;
46
+ processCodeTitle: string;
47
+ status: string;
48
+ userId: string;
49
+ userName: string;
50
+ };
51
+ type TaskHistory = {
52
+ appointmentDate: string | null;
53
+ comment: string | null;
54
+ dateCreated: string;
55
+ decisionCode: string | null;
56
+ decisionNameRu: string | null;
57
+ factEndDate: string;
58
+ id: string;
59
+ number: string;
60
+ planEndDate: string;
61
+ statusCode: string;
62
+ statusTitle: string;
63
+ userFullName: string | null;
64
+ userId: string | null;
65
+ violationText: string | null;
66
+ };
67
+
68
+ type Item = {
69
+ itemCode: string;
70
+ itemId: number;
71
+ itemName: string;
72
+ };
73
+
74
+ type GBDFLResponse = {
75
+ status: string;
76
+ statusName: string;
77
+ content: string;
78
+ };
79
+
80
+ type FamilyInfoGKB = {
81
+ infoList: InfoListGKB;
82
+ status: string;
83
+ statusName: string;
84
+ content: null;
85
+ };
86
+
87
+ type InfoListGKB = {
88
+ birthInfos: BirthInfoGKB[];
89
+ };
90
+
91
+ type BirthInfoGKB = {
92
+ actDate?: string;
93
+ actNumber?: string;
94
+ childBirthDate?: string;
95
+ childIIN?: string;
96
+ childLifeStatus?: number;
97
+ childName?: string;
98
+ childPatronymic?: string;
99
+ childSurName?: string;
100
+ fatherBirthDate?: string;
101
+ fatherLifeStatus?: number;
102
+ fatherIIN?: string;
103
+ fatherName?: string;
104
+ fatherPatronymic?: string;
105
+ fatherSurName?: string;
106
+ marriageActDate?: string;
107
+ marriageActNumber?: string;
108
+ marriageActPlace?: string;
109
+ motherApplication?: number;
110
+ motherBirthDate?: string;
111
+ motherLifeStatus?: string | null;
112
+ motherIIN?: string | null;
113
+ motherName?: string | null;
114
+ motherPatronymic?: string | null;
115
+ motherSurName?: string | null;
116
+ zagsCode?: string;
117
+ zagsNameKZ?: string;
118
+ zagsNameRU?: string;
119
+ };
120
+
121
+ type AnketaBody = {
122
+ first: EachAnketa;
123
+ second: any[] | null;
124
+ };
125
+
126
+ type EachAnketa = {
127
+ id: string;
128
+ name: string;
129
+ answerType: AnswerType;
130
+ definedAnswers: DefinedAnswers;
131
+ defaultAnswer: string;
132
+ questOrder: number;
133
+ answerId: null | string;
134
+ answerName: AnswerName | null;
135
+ answerText: null | string;
136
+ };
137
+
138
+ enum AnswerName {
139
+ Нет = 'Нет',
140
+ Да = 'Да',
141
+ }
142
+
143
+ enum AnswerType {
144
+ N = 'N',
145
+ T = 'T',
146
+ D = 'D',
147
+ }
148
+
149
+ enum DefinedAnswers {
150
+ N = 'N',
151
+ Y = 'Y',
152
+ }
153
+
154
+ type AnketaFirst = {
155
+ id: string;
156
+ insuredId: string | null;
157
+ body: AnketaBody[];
158
+ type: 'health' | 'critical';
159
+ clientId: string | null;
160
+ };
161
+
162
+ type AnketaSecond = {
163
+ id: string;
164
+ name: string;
165
+ answerType: AnswerType;
166
+ definedAnswers: DefinedAnswers;
167
+ defaultAnswer: string | null;
168
+ questOrder: number;
169
+ answerId: string | null;
170
+ answerName: string | null;
171
+ answerText: string | null;
172
+ };
173
+
174
+ type SendOtpResponse = {
175
+ tokenId?: string;
176
+ errMessage?: string | null;
177
+ result?: string | null;
178
+ status?: string | number | null;
179
+ statusName?: string | null;
180
+ };
181
+
182
+ type OtpDataType = { iin: string; phoneNumber: string; type: string; processInstanceId?: string | number };
183
+
184
+ type StartApplicationType = {
185
+ clientId: string | number | null;
186
+ iin: string;
187
+ longName: string;
188
+ processCode: number;
189
+ policyId: number;
190
+ };
191
+
192
+ type ESBDValidationType = {
193
+ personType: number;
194
+ iin: string;
195
+ lastName: string;
196
+ firstName: string;
197
+ middleName: string;
198
+ birthDate: string;
199
+ sex: number;
200
+ docType: number;
201
+ docNumber: string;
202
+ docIssuedDate: string;
203
+ docIssuedBy: string;
204
+ activityKindId: number;
205
+ economicsSectorId: number;
206
+ resident: number;
207
+ countryId: number;
208
+ };
209
+
210
+ type ESBDResponseType = {
211
+ errorCode: number;
212
+ errorMsg: string;
213
+ esbdClientID: number;
214
+ verifiedDate: string;
215
+ };
216
+
217
+ type RecalculationDataType = {
218
+ signDate: string;
219
+ birthDate: string;
220
+ gender: number;
221
+ amount: number | null;
222
+ premium: number | null;
223
+ coverPeriod: string;
224
+ payPeriod: string;
225
+ indexRateId: string;
226
+ paymentPeriodId: string;
227
+ addCovers: AddCover[];
228
+ };
229
+
230
+ type RecalculationResponseType = {
231
+ amount: number;
232
+ premium: number;
233
+ mainCoverPremium: number;
234
+ addCovers: AddCover[];
235
+ };
236
+
237
+ type AddCover = {
238
+ id: string | null;
239
+ processInstanceId: string;
240
+ coverTypeId: string;
241
+ coverTypeName: string;
242
+ coverTypeCode: number;
243
+ coverSumId: string;
244
+ coverSumName: string;
245
+ coverSumCode: string;
246
+ amount: number;
247
+ premium: number;
248
+ isMigrate: boolean;
249
+ };
250
+ }
@@ -1,43 +0,0 @@
1
- export type InputTypes =
2
- | 'button'
3
- | 'checkbox'
4
- | 'color'
5
- | 'date'
6
- | 'datetime-local'
7
- | 'email'
8
- | 'file'
9
- | 'hidden'
10
- | 'image'
11
- | 'month'
12
- | 'number'
13
- | 'password'
14
- | 'radio'
15
- | 'range'
16
- | 'reset'
17
- | 'search'
18
- | 'submit'
19
- | 'tel'
20
- | 'text'
21
- | 'time'
22
- | 'url'
23
- | 'week';
24
-
25
- export type TaskListItem = {
26
- addRegNumber: string | number;
27
- applicationTaskId: string;
28
- dateCreated: string;
29
- historyStatus: string;
30
- historyStatusTitle: string;
31
- id: string;
32
- iin: string;
33
- insurerIin: string;
34
- insurerLongName: string;
35
- isTask: boolean | number;
36
- longName: string;
37
- number: string;
38
- processCode: number;
39
- processCodeTitle: string;
40
- status: string;
41
- userId: string;
42
- userName: string;
43
- };
File without changes