hl-core 0.0.9-beta.55 → 0.0.9-beta.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/base.api.ts CHANGED
@@ -448,8 +448,7 @@ export class ApiClass {
448
448
  return await this.axiosCall<void>({
449
449
  method: Methods.POST,
450
450
  url: `/${this.productUrl}/api/Application/SetApplicationData`,
451
- data,
452
- responseType: 'blob',
451
+ data: data,
453
452
  });
454
453
  }
455
454
 
@@ -925,14 +924,6 @@ export class ApiClass {
925
924
  });
926
925
  }
927
926
 
928
- async setApplicationData(data: SetApplicationRequest) {
929
- return await this.axiosCall({
930
- method: Methods.POST,
931
- url: `/${this.productUrl}/api/Application/SetApplicationData`,
932
- data: data,
933
- });
934
- }
935
-
936
927
  async calculate(processInstanceId: string) {
937
928
  return await this.axiosCall({
938
929
  method: Methods.POST,
@@ -1,4 +1,4 @@
1
- import { AxiosError, AxiosInstance } from 'axios';
1
+ import { AxiosError, type AxiosInstance } from 'axios';
2
2
 
3
3
  export default function (axios: AxiosInstance) {
4
4
  axios.interceptors.request.use(
@@ -59,7 +59,7 @@
59
59
  </template>
60
60
 
61
61
  <script lang="ts">
62
- import { ComputedRefWithControl } from '@vueuse/core';
62
+ import { type ComputedRefWithControl } from '@vueuse/core';
63
63
  import { FormBlock } from '../../composables/fields';
64
64
 
65
65
  export default defineComponent({
@@ -28,7 +28,7 @@ export default defineComponent({
28
28
  },
29
29
  bgColor: {
30
30
  type: String,
31
- default: import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? '#1B1918' : '#009c73',
31
+ default: import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti' ? '#1B1918' : '#009c73',
32
32
  },
33
33
  },
34
34
  });
@@ -9,11 +9,15 @@
9
9
  <v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')" />
10
10
  <i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"></i
11
11
  ></base-panel-item>
12
- <base-panel-item v-if="$dataStore.isEFO && $dataStore.accessToken && $dataStore.hasAccess().toLKA" @click="changeBridge('lka', $dataStore.accessToken)" class="cursor-pointer">
12
+ <base-panel-item
13
+ v-if="$dataStore.accessToken && (($dataStore.isEFO && $dataStore.hasAccess().toLKA) || ($dataStore.isAULETTI && $dataStore.hasAccess().toLKA_A))"
14
+ @click="changeBridge('lka', $dataStore.accessToken)"
15
+ class="cursor-pointer"
16
+ >
13
17
  {{ $dataStore.t('labels.lkaLong') }}
14
18
  <i class="mdi mdi-chevron-right text-2xl text-[#A0B3D8]"></i
15
19
  ></base-panel-item>
16
- <base-panel-item v-if="$dataStore.isLKA && $dataStore.accessToken" @click="changeBridge('efo', $dataStore.accessToken)" class="cursor-pointer">
20
+ <base-panel-item v-if="($dataStore.isLKA || $dataStore.isLKA_A) && $dataStore.accessToken" @click="changeBridge('efo', $dataStore.accessToken)" class="cursor-pointer">
17
21
  {{ $dataStore.t('labels.efoLong') }}
18
22
  <i class="mdi mdi-web text-2xl text-[#A0B3D8]"></i
19
23
  ></base-panel-item>
@@ -80,7 +84,7 @@ const logoutUser = async () => {
80
84
  };
81
85
 
82
86
  const hasHistory = computed(() => {
83
- return !dataStore.isLKA;
87
+ return !dataStore.isLKA && !dataStore.isLKA_A;
84
88
  });
85
89
 
86
90
  const hasFAQ = computed(() => router.hasRoute('FAQ') && !dataStore.isAULETTI && !dataStore.isAulettiParent);
@@ -55,7 +55,7 @@
55
55
 
56
56
  <script lang="ts">
57
57
  import { MenuItem } from '../../composables/classes';
58
- import { RouteLocationNormalized } from 'vue-router';
58
+ import { type RouteLocationNormalized } from 'vue-router';
59
59
 
60
60
  export default defineComponent({
61
61
  props: {
@@ -32,7 +32,7 @@
32
32
  class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
33
33
  >
34
34
  <base-form-text-section v-for="(question, index) in firstQuestionList.filter(i => i.first.definedAnswers === 'Y')" :key="index">
35
- <base-fade-transition>
35
+ <base-animation>
36
36
  <div
37
37
  v-if="question.first.answerName === 'Да' && question.second"
38
38
  :class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
@@ -41,16 +41,16 @@
41
41
  >
42
42
  {{ $dataStore.t('questionnaireType.pleaseAnswer', { text: question.second.length }) }}
43
43
  </div>
44
- </base-fade-transition>
44
+ </base-animation>
45
45
  <span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
46
46
  {{ question.first.name }}
47
- <base-fade-transition>
47
+ <base-animation>
48
48
  <i
49
49
  v-if="question.first.answerName === 'Да' && question.second && question.second.length"
50
50
  class="mdi mdi-chevron-right text-2xl cursor-pointer"
51
51
  @click="openFirstPanel(question)"
52
52
  ></i>
53
- </base-fade-transition>
53
+ </base-animation>
54
54
  </span>
55
55
  <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
56
56
  <v-radio-group
@@ -89,7 +89,7 @@
89
89
  <v-radio label="Нет" value="Нет" />
90
90
  </v-radio-group>
91
91
  </div>
92
- <base-fade-transition>
92
+ <base-animation>
93
93
  <div v-if="question.first.answerName === 'Да'" :class="[$styles.whiteText, $styles.textSimple]">
94
94
  <base-form-input
95
95
  v-model="question.first.answerText"
@@ -98,7 +98,7 @@
98
98
  :rules="$rules.required"
99
99
  />
100
100
  </div>
101
- </base-fade-transition>
101
+ </base-animation>
102
102
  </base-form-text-section>
103
103
  </section>
104
104
  </v-form>
@@ -127,14 +127,26 @@
127
127
  @submit="submitSecondaryForm"
128
128
  >
129
129
  <base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
130
- <base-form-input
131
- v-if="question.definedAnswers === 'N'"
132
- v-model="question.answerText"
133
- class="border-t-[1px] border-t-[#F3F6FC]"
134
- :placeholder="$dataStore.t('labels.inputText')"
135
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
136
- :rules="isSecondRequired ? $rules.required : []"
137
- />
130
+ <div v-if="question.definedAnswers === 'N'">
131
+ <base-form-input
132
+ v-if="question.answerType === 'T' || question.answerType === 'N'"
133
+ v-model="question.answerText"
134
+ class="border-t-[1px] border-t-[#F3F6FC]"
135
+ :placeholder="$dataStore.t('labels.inputText')"
136
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
137
+ :rules="isSecondRequired ? $rules.required : []"
138
+ />
139
+ <base-form-input
140
+ v-if="question.answerType === 'D'"
141
+ v-model="question.answerText"
142
+ class="border-t-[1px] border-t-[#F3F6FC]"
143
+ :placeholder="$dataStore.t('form.date')"
144
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
145
+ :rules="isSecondRequired ? $rules.date : []"
146
+ :maska="$maska.date"
147
+ append-inner-icon="mdi mdi-calendar-blank-outline"
148
+ />
149
+ </div>
138
150
  <base-panel-input
139
151
  v-else
140
152
  :class="[$styles.textTitle, $styles.greenText]"
@@ -220,6 +232,11 @@ export default defineComponent({
220
232
  }
221
233
  if (formStore[whichSurvey.value] && formStore[whichSurvey.value]?.body) {
222
234
  formStore[whichSurvey.value]?.body.forEach(question => {
235
+ if (question.first.definedAnswers === 'Y' && question.first.answerName?.match(new RegExp('Да', 'i')) && question.second && question.second.length) {
236
+ question.second.forEach(second => {
237
+ if (second.answerType === 'D') second.answerText = formatDate(String(second.answerText))!.toISOString();
238
+ });
239
+ }
223
240
  if (question.first.definedAnswers === 'Y' && question.first.answerName?.match(new RegExp('Нет', 'i')) && question.second && question.second.length) {
224
241
  question.second.forEach(second => {
225
242
  if (second.definedAnswers === 'N') {
@@ -240,6 +257,13 @@ export default defineComponent({
240
257
  if (typeof anketaToken === 'string') {
241
258
  formStore[whichSurvey.value]!.id = anketaToken;
242
259
  }
260
+ await dataStore.getQuestionList(
261
+ surveyType.value,
262
+ formStore.applicationData.processInstanceId,
263
+ whichMember.value === 'insured' ? formStore.applicationData.insuredApp[0].id : formStore.applicationData.clientApp.id,
264
+ whichSurvey.value,
265
+ whichMember.value,
266
+ );
243
267
  isButtonLoading.value = false;
244
268
  } else {
245
269
  const errors = document.querySelector('.v-input--error');
@@ -181,14 +181,14 @@ export default defineComponent({
181
181
  });
182
182
  const isUnderwriterDocuments = computed(
183
183
  () =>
184
- (dataStore.isAULETTI || dataStore.isAulettiParent) &&
184
+ (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) &&
185
185
  dataStore.isInitiator() &&
186
186
  formStore.applicationData &&
187
187
  (formStore.applicationData.statusCode === 'StartForm' || formStore.applicationData.statusCode === 'EditForm'),
188
188
  );
189
189
  const canDeleteFiles = computed(() => {
190
190
  const baseCondition = dataStore.isTask() && dataStore.isInitiator() && dataStore.isProcessEditable(formStore.applicationData.statusCode);
191
- if (dataStore.isAULETTI || dataStore.isAulettiParent) {
191
+ if (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) {
192
192
  return baseCondition && (currentDocument.value ? currentDocument.value.fileTypeCode === '46' : false);
193
193
  }
194
194
  if (dataStore.isPension) return baseCondition;
@@ -168,8 +168,8 @@
168
168
  v-if="hasProcessIndexRate"
169
169
  v-model="productConditionsForm.processIndexRate"
170
170
  :value="productConditionsForm.processIndexRate?.nameRu"
171
- :readonly="isDisabled"
172
- :clearable="!isDisabled"
171
+ :readonly="isDisabled || productConditionsForm.paymentPeriod.code === 'single'"
172
+ :clearable="!isDisabled && !(productConditionsForm.paymentPeriod.code === 'single')"
173
173
  :rules="$rules.objectRequired"
174
174
  :label="$dataStore.t('productConditionsForm.processIndexRate')"
175
175
  append-inner-icon="mdi mdi-chevron-right"
@@ -282,20 +282,20 @@
282
282
  />
283
283
  </base-form-section>
284
284
  <section v-if="whichProduct === 'pensionannuitynew'">
285
- <base-btn v-if="formStore.applicationData.processCode === 19 && !isDisabled" :text="$dataStore.t('buttons.copyToClient')" class="mt-4" @click="copyRedirect"/>
285
+ <base-btn v-if="formStore.applicationData.processCode === 19 && !isDisabled" :text="$dataStore.t('buttons.copyToClient')" class="mt-4" @click="copyRedirect" />
286
286
  <base-form-section :title="$dataStore.t('pension.compulsoryAmount&Prof')">
287
287
  <base-form-input
288
288
  v-model="pensionCalculationParams.compulsoryContractAmount"
289
289
  :maska="$maska.numbers"
290
- :readonly="isDisabled"
291
- :clearable="!isDisabled"
290
+ :readonly="isDisabled || isEnpfSum"
291
+ :clearable="!isDisabled && !isEnpfSum"
292
292
  :label="$dataStore.t('pension.compulsoryContractAmount')"
293
293
  />
294
294
  <base-form-input
295
295
  v-model="pensionCalculationParams.compulsoryProfContractAmount"
296
296
  :maska="$maska.numbers"
297
- :readonly="isDisabled"
298
- :clearable="!isDisabled"
297
+ :readonly="isDisabled || isEnpfSum"
298
+ :clearable="!isDisabled && !isEnpfSum"
299
299
  :label="$dataStore.t('pension.compulsoryProfContractAmount')"
300
300
  />
301
301
  <base-animation>
@@ -303,8 +303,8 @@
303
303
  v-if="pensionCalculationParams.compulsoryProfContractAmount && pensionCalculationParams.compulsoryProfContractAmount != 0"
304
304
  v-model="pensionForm.compulsoryProfMonthCount"
305
305
  :maska="$maska.numbers"
306
- :readonly="isDisabled"
307
- :clearable="!isDisabled"
306
+ :readonly="isDisabled || isEnpfSum"
307
+ :clearable="!isDisabled && !isEnpfSum"
308
308
  :label="$dataStore.t('pension.compulsoryProfMonthCount')"
309
309
  />
310
310
  </base-animation>
@@ -732,12 +732,13 @@ export default defineComponent({
732
732
  const transferContractFirstPaymentDate = ref();
733
733
  const guaranteedPeriodList = Array.from(Array(35), (e, i) => i + 1);
734
734
  const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
735
+ const isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
735
736
 
736
737
  const isMultiplePanelOpen = ref<boolean>(false);
737
738
  const multiplePanelValue = ref<CountryValue>(new CountryValue());
738
739
  const multiplePanelList = ref<CountryValue[]>([]);
739
740
  const calculatorForm = productConditionsForm.calculatorForm;
740
-
741
+ const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
741
742
  const isShownAdditionalTerms = computed(() => {
742
743
  if (whichProduct.value === 'gons') {
743
744
  return false;
@@ -776,7 +777,11 @@ export default defineComponent({
776
777
  return isDisabled.value;
777
778
  });
778
779
  const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
779
- const fixInsSumRule = computed(() => (!!productConditionsForm.fixInsSum ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
780
+ const fixInsSumRule = computed(() =>
781
+ !!productConditionsForm.fixInsSum
782
+ ? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
783
+ : [],
784
+ );
780
785
  const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
781
786
  const hasCalculated = computed(() => {
782
787
  if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
@@ -1091,6 +1096,10 @@ export default defineComponent({
1091
1096
  } else {
1092
1097
  // @ts-ignore
1093
1098
  productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1099
+ if (currentPanel.value === 'paymentPeriod' && hasProcessIndexRate.value && item.code === 'single') {
1100
+ const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
1101
+ if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
1102
+ }
1094
1103
  }
1095
1104
  };
1096
1105
  const selectOption = (value: CountryValue) => {
@@ -1734,7 +1743,7 @@ export default defineComponent({
1734
1743
  const copyRedirect = async () => {
1735
1744
  const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
1736
1745
  dataStore.copyToClipboard(url.redirectUrl);
1737
- }
1746
+ };
1738
1747
 
1739
1748
  return {
1740
1749
  // State
@@ -1768,6 +1777,7 @@ export default defineComponent({
1768
1777
  enabled,
1769
1778
  maxDate,
1770
1779
  guaranteedPeriodList,
1780
+ isEnpfSum,
1771
1781
 
1772
1782
  // Computed
1773
1783
  isTask,
@@ -1848,7 +1858,7 @@ export default defineComponent({
1848
1858
  coverTypeName,
1849
1859
  pickSubTermValue,
1850
1860
  onInputFixInsSum,
1851
- copyRedirect
1861
+ copyRedirect,
1852
1862
  };
1853
1863
  },
1854
1864
  });
@@ -178,6 +178,7 @@
178
178
  </div>
179
179
  </base-fade-transition>
180
180
  <base-btn
181
+ v-if="$dataStore.isPension"
181
182
  :text="$dataStore.t('buttons.cancel')"
182
183
  :btn="$styles.whiteBtn"
183
184
  @click="
@@ -330,6 +331,9 @@ export default defineComponent({
330
331
  if (event.target) {
331
332
  const files = (event.target as HTMLInputElement).files;
332
333
  if (files && files.length) {
334
+ if (files[0].type !== 'application/pdf') {
335
+ return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
336
+ }
333
337
  const doc = await selectedDocument(type);
334
338
  const data = {
335
339
  processInstanceId: formStore.applicationData.processInstanceId,
@@ -14,7 +14,7 @@
14
14
  <script lang="ts">
15
15
  import VueJsonPretty from 'vue-json-pretty';
16
16
  import 'vue-json-pretty/lib/styles.css';
17
- import { JSONDataType } from 'vue-json-pretty/types/utils';
17
+ import { type JSONDataType } from 'vue-json-pretty/types/utils';
18
18
 
19
19
  export default defineComponent({
20
20
  components: { VueJsonPretty },
@@ -1,6 +1,6 @@
1
1
  import { Statuses, StoreMembers, MemberAppCodes } from '../types/enum';
2
2
  import { formatDate } from '.';
3
- import { RouteLocationNormalized, RouteLocationNormalizedLoaded } from 'vue-router';
3
+ import type { RouteLocationNormalized, RouteLocationNormalizedLoaded } from 'vue-router';
4
4
 
5
5
  type LinkType = Partial<RouteLocationNormalized> | Partial<RouteLocationNormalizedLoaded> | string | null | boolean;
6
6
 
@@ -1357,6 +1357,7 @@ export class FormStoreClass {
1357
1357
  processCode?: number;
1358
1358
  insuredApp?: any;
1359
1359
  pensionApp?: any;
1360
+ isEnpfSum?: boolean;
1360
1361
  beneficiaryApp?: any;
1361
1362
  beneficialOwnerApp?: any;
1362
1363
  spokesmanApp?: any;
@@ -1594,7 +1595,7 @@ export class PhysGroupClass extends BaseGroupClass {
1594
1595
  birthDate: string;
1595
1596
  gender: Value;
1596
1597
  placeOfBirth: Value;
1597
- workDetails: { workplace: string; position: string; jobDuties: string };
1598
+ workDetails: { workplace: string; positionRu: string; positionKz: string; jobDuties: string };
1598
1599
  hasContactPerson: boolean;
1599
1600
  authorityDetails: {
1600
1601
  basis: Value;
@@ -1609,7 +1610,7 @@ export class PhysGroupClass extends BaseGroupClass {
1609
1610
  this.birthDate = '';
1610
1611
  this.gender = new Value();
1611
1612
  this.placeOfBirth = new Value();
1612
- this.workDetails = { workplace: '', position: '', jobDuties: '' };
1613
+ this.workDetails = { workplace: '', positionRu: '', positionKz: '', jobDuties: '' };
1613
1614
  this.hasContactPerson = false;
1614
1615
  this.authorityDetails = {
1615
1616
  basis: new Value(),
@@ -87,6 +87,9 @@ export const constants = Object.freeze({
87
87
  questionnaireInsured: 35,
88
88
  invoicePayment: 36,
89
89
  },
90
+ regex: {
91
+ isoDate: /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/,
92
+ },
90
93
  fixInsAmount: [
91
94
  {
92
95
  code: '500000',
@@ -1,6 +1,6 @@
1
1
  import { i18n } from '../configs/i18n';
2
2
  import { FieldTypes } from '../types/form';
3
- import { ComputedRefWithControl } from '@vueuse/core';
3
+ import { type ComputedRefWithControl } from '@vueuse/core';
4
4
 
5
5
  const t = i18n.t;
6
6
 
@@ -423,7 +423,7 @@ export const getMainPageRoute = () => {
423
423
  if (dataStore.isEFO || dataStore.isAULETTI) {
424
424
  return 'Insurance-Product';
425
425
  }
426
- if (dataStore.isLKA) {
426
+ if (dataStore.isLKA || dataStore.isLKA_A) {
427
427
  return 'Menu';
428
428
  }
429
429
  if (dataStore.isAML) {
@@ -544,3 +544,5 @@ export const validateResponseStructure = <T>(res: ResponseStructure<T>) => {
544
544
  return null;
545
545
  }
546
546
  };
547
+
548
+ export class ApiError extends AxiosError<any, any> {}
@@ -15,12 +15,12 @@ export class Styles {
15
15
  blueTextLight: string = 'text-[#F3F6FC]';
16
16
 
17
17
  // Green
18
- greenBg: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#DEBE8C]' : 'bg-[#009C73]';
19
- greenBgHover: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#C19B5F]' : 'hover:bg-[#00a277]';
20
- greenBgLight: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#e8d2af]' : 'bg-[#EAF6EF]';
18
+ greenBg: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti' ? 'bg-[#DEBE8C]' : 'bg-[#009C73]';
19
+ greenBgHover: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti' ? 'bg-[#C19B5F]' : 'hover:bg-[#00a277]';
20
+ greenBgLight: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti' ? 'bg-[#e8d2af]' : 'bg-[#EAF6EF]';
21
21
  greenText: string ='!text-[#009C73]';
22
22
  greenTextHover: string ='hover:text-[#009C73]';
23
- greenBgLightHover: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'hover:bg-[#efdfc6]' : 'hover:bg-[#dbf0e4]';
23
+ greenBgLightHover: string = import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti' ? 'hover:bg-[#efdfc6]' : 'hover:bg-[#dbf0e4]';
24
24
 
25
25
  // Yellow
26
26
  yellowText: string = '!text-[#FAB31C]';
@@ -53,7 +53,7 @@ export class Styles {
53
53
  blueBorder: string = 'border-[1px] border-[#A0B3D8]';
54
54
  blueLightBorder: string = 'border-[1px] border-[#F3F6FC]';
55
55
  greenBorder: string =
56
- import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'border-[1px] border-[#DEBE8C]' : 'border-[1px] border-[#009C73]';
56
+ import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti' ? 'border-[1px] border-[#DEBE8C]' : 'border-[1px] border-[#009C73]';
57
57
  redBorder: string = 'border-[1px] border-[#FD2D39]';
58
58
  yellowBorder: string = 'border-[1px] border-[#FAB31C]';
59
59
 
package/configs/pwa.ts ADDED
@@ -0,0 +1,49 @@
1
+ import type { ModuleOptions } from '@vite-pwa/nuxt';
2
+
3
+ export const pwaBaseConfig: Partial<ModuleOptions> = {
4
+ registerType: 'autoUpdate',
5
+ workbox: {
6
+ globPatterns: ['**/*.{js,css,html,txt,png,ico,svg}'],
7
+ navigateFallbackDenylist: [/^\/api\//],
8
+ navigateFallback: '/',
9
+ cleanupOutdatedCaches: true,
10
+ runtimeCaching: [
11
+ {
12
+ urlPattern: /^https:\/\/fonts.googleapis.com\/.*/i,
13
+ handler: 'CacheFirst',
14
+ options: {
15
+ cacheName: 'google-fonts-cache',
16
+ expiration: {
17
+ maxEntries: 10,
18
+ maxAgeSeconds: 60 * 60 * 24 * 365,
19
+ },
20
+ cacheableResponse: {
21
+ statuses: [0, 200],
22
+ },
23
+ },
24
+ },
25
+ {
26
+ urlPattern: /^https:\/\/fonts.gstatic.com\/.*/i,
27
+ handler: 'CacheFirst',
28
+ options: {
29
+ cacheName: 'gstatic-fonts-cache',
30
+ expiration: {
31
+ maxEntries: 10,
32
+ maxAgeSeconds: 60 * 60 * 24 * 365,
33
+ },
34
+ cacheableResponse: {
35
+ statuses: [0, 200],
36
+ },
37
+ },
38
+ },
39
+ ],
40
+ },
41
+ registerWebManifestInRouteRules: true,
42
+ writePlugin: true,
43
+ devOptions: {
44
+ enabled: true,
45
+ suppressWarnings: true,
46
+ navigateFallback: '/',
47
+ type: 'module',
48
+ },
49
+ };
package/layouts/clear.vue CHANGED
@@ -14,7 +14,7 @@ const onInit = async () => {
14
14
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
15
15
  if (dataStore.projectConfig !== null && commitVersion !== dataStore.projectConfig.version) {
16
16
  //@ts-ignore
17
- await $pwa.updateServiceWorker();
17
+ await $pwa.updateServiceWorker(true);
18
18
  }
19
19
  }
20
20
  }
@@ -58,7 +58,7 @@ const onInit = async () => {
58
58
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
59
59
  if (dataStore.projectConfig !== null && commitVersion !== dataStore.projectConfig.version) {
60
60
  //@ts-ignore
61
- await $pwa.updateServiceWorker();
61
+ await $pwa.updateServiceWorker(true);
62
62
  }
63
63
  }
64
64
  }
package/layouts/full.vue CHANGED
@@ -17,7 +17,7 @@ const onInit = async () => {
17
17
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
18
18
  if (dataStore.projectConfig !== null && commitVersion !== dataStore.projectConfig.version) {
19
19
  //@ts-ignore
20
- await $pwa.updateServiceWorker();
20
+ await $pwa.updateServiceWorker(true);
21
21
  }
22
22
  }
23
23
  }
package/locales/ru.json CHANGED
@@ -42,6 +42,7 @@
42
42
  "errorSumOrPercentage": "Процент от суммы выплат не может быть меньше или больше 100",
43
43
  "fileWasDeleted": "Файл успешно удален",
44
44
  "attachManagerError": "Прикрепите заявку менеджеру",
45
+ "attachAgentError": "Нужно выбрать агента",
45
46
  "viewErrorText": "Вы сейчас находитесь в режиме просмотра или у вас нет доступа",
46
47
  "editModeText": "Вы перешли в режим редактирования",
47
48
  "viewModeText": "Вы перешли в режим просмотра",
@@ -859,7 +860,8 @@
859
860
  "agentCommission": "Агентская комиссия не должно превышать 50",
860
861
  "agePrePensionInsured": "Пороговое значение по возрасту с 55 по 63",
861
862
  "checkDate": "Укажите корректную дату",
862
- "searchQueryLen": "Поиск должности должен осуществляться по запросу не менее чем из {len} символов"
863
+ "searchQueryLen": "Поиск должности должен осуществляться по запросу не менее чем из {len} символов",
864
+ "fixInsSumLimit": "Фиксированная сумма не должна превышать {sum}тг"
863
865
  },
864
866
  "code": "КСЭ",
865
867
  "fontSize": "Размер шрифта",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.9-beta.55",
3
+ "version": "0.0.9-beta.57",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -40,6 +40,7 @@ export const useDataStore = defineStore('data', {
40
40
  isAML: state => state.product === 'aml',
41
41
  isLKA: state => state.product === 'lka',
42
42
  isAULETTI: state => state.product === 'auletti',
43
+ isLKA_A: state => state.product === 'lka-auletti',
43
44
  isAulettiParent: state => state.parentProduct === 'auletti',
44
45
  isBridge: state => state.product === 'efo' || state.product === 'aml' || state.product === 'lka' || state.product === 'auletti',
45
46
  isBaiterek: state => state.product === 'baiterek',
@@ -314,6 +315,7 @@ export const useDataStore = defineStore('data', {
314
315
  if (this.isLKA) return hasAccess.toLKA;
315
316
  if (this.isEFO) return hasAccess.toEFO;
316
317
  if (this.isAULETTI) return hasAccess.toAULETTI;
318
+ if (this.isLKA_A) return hasAccess.toLKA_A;
317
319
  return false;
318
320
  } catch (err) {
319
321
  return ErrorHandler(err);
@@ -927,7 +929,7 @@ export const useDataStore = defineStore('data', {
927
929
 
928
930
  const personId = await this.api.saveContragent(data);
929
931
  if (personId > 0) {
930
- if (this.isLKA || whichForm === 'contragent') {
932
+ if (this.isLKA || this.isLKA_A || whichForm === 'contragent') {
931
933
  return personId;
932
934
  } else {
933
935
  await this.getContragentById(personId, whichForm, false, whichIndex);
@@ -1276,7 +1278,7 @@ export const useDataStore = defineStore('data', {
1276
1278
  async getFromApi(whichField: string, whichRequest: string, parameter?: any, reset: boolean = false): Promise<Value[]> {
1277
1279
  const storageValue = JSON.parse(localStorage.getItem(whichField) || 'null');
1278
1280
  const currentHour = new Date().getHours();
1279
- const currentMinutePart = Math.ceil((new Date().getMinutes() + 1) / (this.isLKA ? 60 : 15));
1281
+ const currentMinutePart = Math.ceil((new Date().getMinutes() + 1) / (this.isLKA || this.isLKA_A ? 60 : 15));
1280
1282
 
1281
1283
  const getDataCondition = () => {
1282
1284
  if (!storageValue) return true;
@@ -1597,6 +1599,11 @@ export const useDataStore = defineStore('data', {
1597
1599
  if (i.first.definedAnswers === 'Y' && i.second === null && secondaryQuestions.value) {
1598
1600
  i.second = structuredClone(secondaryQuestions.value);
1599
1601
  }
1602
+ if (i.first.definedAnswers === 'Y' && i.second && i.second.length) {
1603
+ i.second.forEach(second => {
1604
+ if (second.answerType === 'D') second.answerText = reformatDate(String(second.answerText));
1605
+ });
1606
+ }
1600
1607
  });
1601
1608
  }
1602
1609
  }
@@ -2041,13 +2048,14 @@ export const useDataStore = defineStore('data', {
2041
2048
  priceForm.endDate = formatDate(this.formStore.productConditionsForm.calculatorForm.endDate!)!.toISOString();
2042
2049
  }
2043
2050
  }
2044
- const result = await this.api.getCalculator(priceForm);
2045
2051
  if (this.isTask() && taskId) {
2046
2052
  await this.api.setApplication(priceForm);
2053
+ await this.api.getCalculator(priceForm);
2047
2054
  const applicationData = await this.api.getApplicationData(taskId);
2048
2055
  this.formStore.applicationData = applicationData;
2049
2056
  this.formStore.productConditionsForm.calculatorForm.price = `${Math.ceil(applicationData.lifeTripApp.totalPremiumKZT)} тг`;
2050
2057
  } else {
2058
+ const result = await this.api.getCalculator(priceForm);
2051
2059
  this.formStore.productConditionsForm.calculatorForm.price = `${Math.ceil(result)} тг`;
2052
2060
  }
2053
2061
  this.showToaster('success', this.t('toaster.calculated'), 1000);
@@ -3003,6 +3011,11 @@ export const useDataStore = defineStore('data', {
3003
3011
  if (this.controls.hasAttachment) {
3004
3012
  const areValid = this.formStore.SaleChanellPolicy.nameRu && this.formStore.RegionPolicy.nameRu && this.formStore.ManagerPolicy.nameRu && this.formStore.AgentData.fullName;
3005
3013
  if (areValid) {
3014
+ if (this.isLifetrip && this.formStore.AgentData.fullName === 'Без агента') {
3015
+ this.isLoading = false;
3016
+ this.showToaster('error', this.t('toaster.attachAgentError'), 3000);
3017
+ return false;
3018
+ }
3006
3019
  if (this.isInitiator()) {
3007
3020
  await this.setINSISWorkData();
3008
3021
  }
@@ -3446,6 +3459,7 @@ export const useDataStore = defineStore('data', {
3446
3459
  if (key === 'phoneNumber') data[key] = formatPhone(data[key]);
3447
3460
  if (key === 'issuedOn' || key === 'validUntil' || key === 'birthDate' || key === 'date') data[key] = formatDate(data[key])?.toISOString() ?? '';
3448
3461
  if (key === 'nameRu' && data['ids']) data['id'] = data['ids'];
3462
+ if (key === 'positionRu') data['positionKz'] = data['positionRu'];
3449
3463
  }
3450
3464
  }
3451
3465
  });
@@ -3658,8 +3672,8 @@ export const useDataStore = defineStore('data', {
3658
3672
  },
3659
3673
  async saveInsuredList(insuredList: any) {
3660
3674
  try {
3661
- const response = await this.api.saveInsuredList(this.formStore.applicationData.processInstanceId, insuredList);
3662
- return response;
3675
+ await this.api.saveInsuredList(this.formStore.applicationData.processInstanceId, insuredList);
3676
+ return true;
3663
3677
  } catch (err) {
3664
3678
  return ErrorHandler(err);
3665
3679
  }
@@ -3679,7 +3693,7 @@ export const useDataStore = defineStore('data', {
3679
3693
  id: index,
3680
3694
  fullName: client.longName,
3681
3695
  gender: client.gender,
3682
- position: client.workDetails.position,
3696
+ position: client.workDetails.positionRu,
3683
3697
  birthDate: client.birthDate,
3684
3698
  iin: reformatIin(client.iin),
3685
3699
  insSum: client.insuredPolicyData.insSum,
@@ -3902,11 +3916,13 @@ export const useDataStore = defineStore('data', {
3902
3916
  return true;
3903
3917
  },
3904
3918
  hasAccess() {
3919
+ const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn();
3905
3920
  return {
3906
3921
  invoiceInfo: this.isAdmin(),
3907
- toLKA: this.isAgent() || this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn(),
3908
- toAML: this.isCompliance() || this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn(),
3909
- toAULETTI: this.isAgentAuletti() || this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn(),
3922
+ toLKA: this.isAgent() || baseAccessRoles,
3923
+ toAML: this.isCompliance() || baseAccessRoles,
3924
+ toAULETTI: this.isAgentAuletti() || baseAccessRoles,
3925
+ toLKA_A: this.isAgentAuletti() || baseAccessRoles,
3910
3926
  toEFO:
3911
3927
  this.isManager() ||
3912
3928
  this.isAgent() ||
@@ -3937,16 +3953,3 @@ export const useDataStore = defineStore('data', {
3937
3953
  },
3938
3954
  },
3939
3955
  });
3940
-
3941
- // Для карты клиента
3942
- // export const useContragentStore = defineStore('contragent', {
3943
- // state: () => ({
3944
- // ...new Contragent(),
3945
- // formatDate: new Contragent().formatDate,
3946
- // getDateByKey: new Contragent().getDateByKey,
3947
- // getBirthDate: new Contragent().getBirthDate,
3948
- // getDocumentExpireDate: new Contragent().getDocumentExpireDate,
3949
- // getDocumentDate: new Contragent().getDocumentDate,
3950
- // getAgeByBirthDate: new Contragent().getAgeByBirthDate,
3951
- // }),
3952
- // });
package/store/rules.ts CHANGED
@@ -248,6 +248,29 @@ export const rules = {
248
248
  }
249
249
  },
250
250
  ],
251
+ twoDayBeforeTodayDate: [
252
+ (v: any) => {
253
+ const now = new Date();
254
+ const today = new Date();
255
+ const yesterday = new Date(now.setDate(now.getDate() - 1));
256
+ const beforeYesterday = new Date(now.setDate(now.getDate() - 1));
257
+ const threeDaysAgo = new Date(now.setDate(now.getDate() - 1));
258
+ const fourDaysAgo = new Date(now.setDate(now.getDate() - 1));
259
+ const yourDate = new Date(formatDate(v)!);
260
+
261
+ if (
262
+ yourDate.toDateString() === today.toDateString() ||
263
+ yourDate.toDateString() === yesterday.toDateString() ||
264
+ yourDate.toDateString() === beforeYesterday.toDateString() ||
265
+ yourDate.toDateString() === threeDaysAgo.toDateString() ||
266
+ yourDate.toDateString() === fourDaysAgo.toDateString()
267
+ ) {
268
+ return true;
269
+ } else {
270
+ return t('rules.checkDate');
271
+ }
272
+ },
273
+ ],
251
274
  fileRequired: [(v: any) => !!v || t('rules.fileRequired'), (v: any) => (v && v.length > 0) || t('rules.fileRequired')],
252
275
  guaranteedPeriodLimit(v: any, termAnnuityPayments: any) {
253
276
  if (Number(v) > Number(termAnnuityPayments)) {
@@ -255,4 +278,10 @@ export const rules = {
255
278
  }
256
279
  return true;
257
280
  },
281
+ fixInsSumLimit(v: any, sum: any) {
282
+ if (Number(v) > Number(sum)) {
283
+ return t('rules.fixInsSumLimit', { sum }) as any;
284
+ }
285
+ return true;
286
+ },
258
287
  };
package/store/toast.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vt from 'vue-toastification';
2
- import { PluginOptions, POSITION, TYPE } from 'vue-toastification';
2
+ import { type PluginOptions, POSITION, TYPE } from 'vue-toastification';
3
3
  import 'vue-toastification/dist/index.css';
4
4
 
5
5
  export const Types = TYPE;
package/types/index.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { CountryValue, Value } from '../composables/classes';
2
- import { RouteLocationNormalizedLoaded, RouteLocationNormalized } from 'vue-router';
3
- import { AxiosRequestConfig } from 'axios';
1
+ import { Value } from '../composables/classes';
2
+ import type { RouteLocationNormalizedLoaded, RouteLocationNormalized } from 'vue-router';
3
+ import type { AxiosRequestConfig } from 'axios';
4
4
  import { Methods } from './enum';
5
5
 
6
6
  export {};
@@ -29,6 +29,7 @@ declare global {
29
29
  | 'dso'
30
30
  | 'uu'
31
31
  | 'auletti'
32
+ | 'lka-auletti'
32
33
  | 'prepensionannuity';
33
34
  type MemberKeys = keyof ReturnType<typeof useFormStore>;
34
35
  type MemberFormTypes = 'policyholderForm' | 'insuredForm' | 'beneficiaryForm' | 'beneficialOwnerForm' | 'policyholdersRepresentativeForm' | 'productConditionsForm';