hl-core 0.0.7 → 0.0.8-beta.2

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 (65) hide show
  1. package/.prettierrc +2 -1
  2. package/api/index.ts +548 -0
  3. package/api/interceptors.ts +38 -0
  4. package/components/Button/Btn.vue +57 -0
  5. package/components/Button/BtnIcon.vue +47 -0
  6. package/components/Button/ScrollButtons.vue +6 -0
  7. package/components/Button/SortArrow.vue +21 -0
  8. package/components/Complex/Content.vue +5 -0
  9. package/components/Complex/ContentBlock.vue +5 -0
  10. package/components/Complex/Page.vue +43 -0
  11. package/components/Dialog/Dialog.vue +76 -0
  12. package/components/Dialog/FamilyDialog.vue +39 -0
  13. package/components/Form/FormBlock.vue +114 -0
  14. package/components/Form/FormSection.vue +18 -0
  15. package/components/Form/FormTextSection.vue +20 -0
  16. package/components/Form/FormToggle.vue +52 -0
  17. package/components/Form/ProductConditionsBlock.vue +68 -0
  18. package/components/Input/Datepicker.vue +41 -0
  19. package/components/Input/EmptyFormField.vue +5 -0
  20. package/components/Input/FileInput.vue +71 -0
  21. package/components/Input/FormInput.vue +174 -0
  22. package/components/Input/PanelInput.vue +133 -0
  23. package/components/Input/RoundedInput.vue +143 -0
  24. package/components/Layout/Drawer.vue +45 -0
  25. package/components/Layout/Header.vue +48 -0
  26. package/components/Layout/Loader.vue +35 -0
  27. package/components/Layout/SettingsPanel.vue +48 -0
  28. package/components/List/ListEmpty.vue +22 -0
  29. package/components/Menu/MenuNav.vue +108 -0
  30. package/components/Menu/MenuNavItem.vue +37 -0
  31. package/components/Pages/Anketa.vue +341 -0
  32. package/components/Pages/Auth.vue +91 -0
  33. package/components/Pages/Documents.vue +108 -0
  34. package/components/Pages/MemberForm.vue +1148 -0
  35. package/components/Pages/ProductAgreement.vue +18 -0
  36. package/components/Pages/ProductConditions.vue +436 -0
  37. package/components/Panel/PanelHandler.vue +231 -0
  38. package/components/Panel/PanelItem.vue +5 -0
  39. package/components/Panel/PanelSelectItem.vue +20 -0
  40. package/components/Transitions/FadeTransition.vue +5 -0
  41. package/components/Transitions/SlideTransition.vue +5 -0
  42. package/composables/axios.ts +11 -0
  43. package/composables/classes.ts +1129 -0
  44. package/composables/constants.ts +66 -0
  45. package/composables/index.ts +168 -2
  46. package/composables/styles.ts +47 -8
  47. package/layouts/clear.vue +3 -0
  48. package/layouts/default.vue +75 -0
  49. package/layouts/full.vue +6 -0
  50. package/nuxt.config.ts +31 -5
  51. package/package.json +24 -10
  52. package/pages/500.vue +85 -0
  53. package/plugins/helperFunctionsPlugins.ts +17 -2
  54. package/plugins/storePlugin.ts +6 -7
  55. package/plugins/vuetifyPlugin.ts +10 -0
  56. package/store/data.store.js +2484 -6
  57. package/store/form.store.ts +8 -0
  58. package/store/member.store.ts +291 -0
  59. package/store/messages.ts +162 -38
  60. package/store/rules.js +29 -38
  61. package/tailwind.config.js +10 -0
  62. package/types/index.ts +303 -0
  63. package/app.vue +0 -3
  64. package/components/Button/GreenBtn.vue +0 -33
  65. package/store/app.store.js +0 -12
package/store/rules.js CHANGED
@@ -1,19 +1,9 @@
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
- ],
9
- recalculationAdditive: [
10
- v =>
11
- (v !== null && v !== '' && v <= 100 && v >= 0) ||
12
- t('toaster.valueShouldBeBetween', {
13
- floor: 0,
14
- ceil: 100,
15
- }),
16
- ],
5
+ recalculationMultiply: [v => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher').replace('{text}', '100')],
6
+ recalculationAdditive: [v => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween').replace('{floor}', '0').replace('{ceil}', '100')],
17
7
  required: [v => !!v || t('rules.required')],
18
8
  objectRequired: [
19
9
  v => {
@@ -25,18 +15,16 @@ export const rules = {
25
15
  ],
26
16
  noResident: [
27
17
  v => {
28
- if (!!v && 'nameRu' in v && v.nameRu == 'Нерезидент') {
18
+ if (!!v && 'nameRu' in v && v.nameRu === 'Нерезидент') {
29
19
  return t('rules.noResident');
30
20
  }
31
- if (!!v && 'nameRu' in v && v.nameRu != null) {
21
+ if (!!v && 'nameRu' in v && !!v.nameRu) {
32
22
  return true;
33
23
  }
34
24
  return t('rules.required');
35
25
  },
36
26
  ],
37
- cyrillic: [
38
- v => v === null || /^[\u0400-\u04FF ]+$/.test(v) || t('rules.cyrillic'),
39
- ],
27
+ cyrillic: [v => v === null || /^[\u0400-\u04FF ]+$/.test(v) || t('rules.cyrillic')],
40
28
  email: [
41
29
  v => {
42
30
  if (v === '' || v === null) {
@@ -45,9 +33,7 @@ export const rules = {
45
33
  if (
46
34
  String(v)
47
35
  .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
- )
36
+ .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
37
  ) {
52
38
  return true;
53
39
  } else {
@@ -57,9 +43,7 @@ export const rules = {
57
43
  },
58
44
  ],
59
45
  numbers: [v => /^[0-9]+$/.test(v) || t('rules.numbers')],
60
- numbersSymbols: [
61
- v => /^([0-9])|(\W|_)+$/.test(v) || t('rules.numbersSymbols'),
62
- ],
46
+ numbersSymbols: [v => /^([0-9])|(\W|_)+$/.test(v) || t('rules.numbersSymbols')],
63
47
  ageExceeds: [v => v < 50 || t('rules.ageExceeds')],
64
48
  sums: [
65
49
  v => {
@@ -72,7 +56,7 @@ export const rules = {
72
56
  ],
73
57
  iinRight: [
74
58
  v => {
75
- if (v.length !== 15) {
59
+ if (v.length !== useMask().iin.length) {
76
60
  return t('rules.iinRight');
77
61
  }
78
62
  return true;
@@ -84,7 +68,7 @@ export const rules = {
84
68
  if (v === null || v == '') {
85
69
  return true;
86
70
  }
87
- if (v && v.length === 18) {
71
+ if (v && v.length === useMask().phone.length) {
88
72
  return true;
89
73
  } else {
90
74
  return t('rules.phoneFormat');
@@ -94,11 +78,7 @@ export const rules = {
94
78
  date: [
95
79
  v => {
96
80
  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
- ) {
81
+ 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
82
  return true;
103
83
  } else {
104
84
  return t('rules.date');
@@ -108,13 +88,8 @@ export const rules = {
108
88
  age: [v => /^\d+$/.test(v) || t('rules.age')],
109
89
  birthDate: [
110
90
  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
- ) {
91
+ if (new Date(formatDate(v)) > new Date(Date.now())) return t('rules.exceedDate');
92
+ 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
93
  return true;
119
94
  } else {
120
95
  return t('rules.date');
@@ -128,6 +103,20 @@ export const rules = {
128
103
  return t('rules.coverPeriod');
129
104
  }
130
105
  return true;
106
+ } else {
107
+ return t('rules.coverPeriod');
108
+ }
109
+ },
110
+ ],
111
+ coverPeriodFrom3to20: [
112
+ v => {
113
+ if (v !== null) {
114
+ if (v < 3 || v > 20) {
115
+ return t('productConditionsForm.coverPeriodFrom3to20');
116
+ }
117
+ return true;
118
+ } else {
119
+ return t('productConditionsForm.coverPeriodFrom3to20');
131
120
  }
132
121
  },
133
122
  ],
@@ -152,4 +141,6 @@ export const rules = {
152
141
  }
153
142
  },
154
143
  ],
144
+ policyholderAgeLimit: [v => v >= 18 || t('rules.policyholderAgeLimit')],
145
+ beneficiaryAgeLimit: [v => v <= 15 || t('rules.beneficiaryAgeLimit')],
155
146
  };
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ theme: {
3
+ screens: {
4
+ sm: { min: '600px' },
5
+ md: { min: '960px' },
6
+ lg: { min: '1280px' },
7
+ xl: { min: '1920px' },
8
+ },
9
+ },
10
+ };
package/types/index.ts ADDED
@@ -0,0 +1,303 @@
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
+
251
+ type SignUrlType = {
252
+ uri: string;
253
+ shortUri: string;
254
+ iin: string | null;
255
+ longName: string | null;
256
+ phoneNumber: string | null;
257
+ signed: boolean;
258
+ };
259
+
260
+ type SignDataType = {
261
+ processInstanceId: string;
262
+ name: 'Statement' | 'Agreement';
263
+ format: 'pdf';
264
+ };
265
+
266
+ type SmsDataType = {
267
+ processInstanceId: string;
268
+ iin: string;
269
+ phoneNumber: string;
270
+ type: 'SignUrl' | 'PayUrl';
271
+ text: string;
272
+ };
273
+
274
+ type EpayShortResponse = {
275
+ id: string;
276
+ link: string;
277
+ };
278
+
279
+ type EpayResponse = {
280
+ id: string;
281
+ processInstanceId: string;
282
+ createDate: string;
283
+ number: number;
284
+ phoneNumber: string;
285
+ amount: number;
286
+ currency: string;
287
+ dueDate: string;
288
+ transactionId: string;
289
+ transactionDate: string;
290
+ status: number;
291
+ statusName: string;
292
+ description: string;
293
+ epayHtml: string | null;
294
+ epayResponse: string | null;
295
+ paymentLink: string;
296
+ };
297
+
298
+ type SendTask = {
299
+ decicion: keyof typeof constants.actions;
300
+ taskId: string;
301
+ comment?: string;
302
+ };
303
+ }
package/app.vue DELETED
@@ -1,3 +0,0 @@
1
- <template>
2
- <NuxtPage />
3
- </template>
@@ -1,33 +0,0 @@
1
- <template>
2
- <button
3
- v-if="!isLink"
4
- type="button"
5
- @click="$emit('clicked')"
6
- :class="[
7
- classes,
8
- $libStyles.greenBtn,
9
- $libStyles[`btnH${$capitalize(size)}`],
10
- ]"
11
- >
12
- {{ text }}
13
- </button>
14
- </template>
15
-
16
- <script>
17
- export default {
18
- props: {
19
- text: {
20
- type: String,
21
- default: 'Кнопка',
22
- },
23
- size: {
24
- type: String,
25
- default: 'md',
26
- },
27
- classes: {
28
- type: String,
29
- default: '',
30
- },
31
- },
32
- };
33
- </script>
@@ -1,12 +0,0 @@
1
- import { defineStore } from 'pinia';
2
-
3
- export const useAppStore = defineStore('app', {
4
- state: () => ({
5
- name: 'App Store',
6
- }),
7
- actions: {
8
- Test() {
9
- return `From ${this.name}`;
10
- },
11
- },
12
- });