hl-core 0.0.8-beta.20 → 0.0.8-beta.22

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/index.ts CHANGED
@@ -13,7 +13,10 @@ export class ApiClass {
13
13
 
14
14
  private async axiosCall<T>(config: AxiosRequestConfig): Promise<T> {
15
15
  const dataStore = useDataStore();
16
- if ((dataStore.isBridge && !this.baseURL) || (!dataStore.isEFO && !dataStore.isAML && !dataStore.isLKA && (!this.baseURL || !this.productUrl))) {
16
+ if (dataStore.isBridge && !this.baseURL) {
17
+ console.error('No Axios baseURL');
18
+ }
19
+ if (!dataStore.isBridge && !dataStore.isCalculator && (!this.baseURL || !this.productUrl)) {
17
20
  console.error('No Axios baseURL or productURL');
18
21
  }
19
22
  const { data } = await useAxios(this.baseURL).request<T>(config);
@@ -455,18 +458,18 @@ export class ApiClass {
455
458
  });
456
459
  }
457
460
 
458
- async calculateWithoutApplication(data: RecalculationDataType): Promise<RecalculationResponseType> {
461
+ async calculateWithoutApplication(data: RecalculationDataType, product = this.productUrl): Promise<RecalculationResponseType> {
459
462
  return this.axiosCall({
460
463
  method: Methods.POST,
461
- url: `/${this.productUrl}/api/Application/Calculate`,
464
+ url: `/${product}/api/Application/Calculate`,
462
465
  data: data,
463
466
  });
464
467
  }
465
468
 
466
- async getDefaultCalculationData(): Promise<RecalculationDataType> {
469
+ async getDefaultCalculationData(product = this.productUrl): Promise<RecalculationDataType> {
467
470
  return this.axiosCall({
468
471
  method: Methods.GET,
469
- url: `/${this.productUrl}/api/Application/DefaultCalculatorValues`,
472
+ url: `/${product}/api/Application/DefaultCalculatorValues`,
470
473
  });
471
474
  }
472
475
 
@@ -4,7 +4,9 @@ export default function (axios: AxiosInstance) {
4
4
  axios.interceptors.request.use(
5
5
  request => {
6
6
  const dataStore = useDataStore();
7
- request.headers.Authorization = `Bearer ${dataStore.accessToken}`;
7
+ if (dataStore.accessToken) {
8
+ request.headers.Authorization = `Bearer ${dataStore.accessToken}`;
9
+ }
8
10
  return request;
9
11
  },
10
12
  error => {
@@ -17,19 +19,21 @@ export default function (axios: AxiosInstance) {
17
19
  },
18
20
  error => {
19
21
  const dataStore = useDataStore();
20
- const router = useRouter();
21
- if (error.response.status === 401) {
22
- dataStore.$reset();
23
- localStorage.clear();
24
- if (dataStore.isBridge) {
25
- router.push({ name: 'Auth', query: { error: 401 } });
26
- } else {
27
- dataStore.sendToParent(constants.postActions.Error401, 401);
22
+ if (!dataStore.isCalculator) {
23
+ const router = useRouter();
24
+ if (error.response.status === 401) {
25
+ dataStore.$reset();
26
+ localStorage.clear();
27
+ if (dataStore.isBridge) {
28
+ router.push({ name: 'Auth', query: { error: 401 } });
29
+ } else {
30
+ dataStore.sendToParent(constants.postActions.Error401, 401);
31
+ }
28
32
  }
29
- }
30
- if (error.response.status >= 500) {
31
- if (router.currentRoute.value.name !== 'Auth') {
32
- dataStore.showToaster('error', error.stack, 5000);
33
+ if (error.response.status >= 500) {
34
+ if (router.currentRoute.value.name !== 'Auth') {
35
+ dataStore.showToaster('error', error.stack, 5000);
36
+ }
33
37
  }
34
38
  }
35
39
  return Promise.reject(error);
@@ -9,16 +9,16 @@
9
9
  <div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
10
10
  <span v-if="hasSum" :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.requestedSumInsured') }}</span>
11
11
  <span v-if="hasPremium" :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.insurancePremiumPerMonth') }}</span>
12
- <span v-if="hasPolicyNumber" :class="[$libStyles.textSimple]" class="font-medium">{{ $t('buttons.InsuranceContract') }}</span>
13
- <span v-if="hasContractDate" :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.contractDate') }}</span>
12
+ <span v-if="hasPolicyNumber" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('buttons.InsuranceContract') }}</span>
13
+ <span v-if="hasContractDate" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.contractDate') }}</span>
14
14
  <span v-if="hasCoverPeriod" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.coverPeriod') }}</span>
15
15
  <span v-if="hasPayPeriod" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.payPeriod') }}</span>
16
16
  </div>
17
17
  <div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
18
18
  <span v-if="hasSum" :class="[amount === null && $libStyles.emptyBlockCol]">{{ amount }} </span>
19
19
  <span v-if="hasPremium" :class="[premium === null && $libStyles.emptyBlockCol]"> {{ premium }}</span>
20
- <span v-if="hasPolicyNumber" :class="[policyNumber === null && $libStyles.emptyBlockCol]"> {{ policyNumber }}</span>
21
- <span v-if="hasContractDate" :class="[policyNumber === null && $libStyles.emptyBlockCol]"> {{ contractDate }}</span>
20
+ <span v-if="hasPolicyNumber" :class="[policyNumber === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
21
+ <span v-if="hasContractDate" :class="[policyNumber === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
22
22
  <span v-if="hasCoverPeriod" :class="[coverPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
23
23
  <span v-if="hasPayPeriod" :class="[paymentPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
24
24
  {{ paymentPeriod }}
@@ -9,7 +9,7 @@
9
9
  model-type="dd.MM.yyyy"
10
10
  position="left"
11
11
  menu-class-name="!left-[30vw] md:!left-[70vw] lg:!left-[75vw]"
12
- teleport=".v-form"
12
+ :teleport="teleport"
13
13
  :offset="-50"
14
14
  :close-on-scroll="true"
15
15
  :enable-time-picker="false"
@@ -36,6 +36,10 @@ export default defineComponent({
36
36
  type: Boolean,
37
37
  default: false,
38
38
  },
39
+ teleport: {
40
+ type: String,
41
+ default: '.v-form',
42
+ },
39
43
  },
40
44
  });
41
45
  </script>
@@ -29,8 +29,12 @@
29
29
  @update:modelValue="$emit('update:modelValue', $event)"
30
30
  >
31
31
  <template v-if="appendInnerIcon && appendInnerIcon.length" v-slot:append-inner>
32
- <v-icon v-if="appendInnerIcon !== 'mdi mdi-calendar-blank-outline'" :icon="appendInnerIcon" @click="!props.readonly && $emit('append')"></v-icon>
33
- <base-datepicker v-else :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)"></base-datepicker>
32
+ <v-icon
33
+ v-if="appendInnerIcon !== 'mdi mdi-calendar-blank-outline'"
34
+ :icon="appendInnerIcon"
35
+ @click="appendInnerIcon.includes('mdi-magnify') ? $emit('append') : !props.readonly && $emit('append')"
36
+ ></v-icon>
37
+ <base-datepicker v-else :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :teleport="teleport"></base-datepicker>
34
38
  </template>
35
39
  <template v-if="loading" #loader>
36
40
  <v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
@@ -116,6 +120,9 @@ export default defineComponent({
116
120
  appendInnerIcon: {
117
121
  type: String,
118
122
  },
123
+ teleport: {
124
+ type: String,
125
+ },
119
126
  bgColor: {
120
127
  type: String,
121
128
  },
@@ -64,7 +64,7 @@ const hasHistory = computed(() => {
64
64
  });
65
65
 
66
66
  const openHistory = async () => {
67
- dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.product);
67
+ dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.isBridge ? '' : dataStore.product);
68
68
  };
69
69
 
70
70
  const changeBridge = async (toBridge: 'efo' | 'lka') => {
@@ -32,7 +32,7 @@
32
32
  <slot name="end"></slot>
33
33
  <slot name="actions"></slot>
34
34
  <base-fade-transition>
35
- <div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[30%] w-full pr-4">
35
+ <div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[10%] w-full pr-4">
36
36
  <div v-for="(item, index) of $dataStore.buttons" :key="index">
37
37
  <transition enter-active-class="animate__animated animate__fadeIn animate__faster" leave-active-class="animate__animated animate__fadeOut animate__faster">
38
38
  <base-btn
@@ -71,22 +71,22 @@
71
71
  </v-form>
72
72
  <base-btn class="my-[14px] self-center" :loading="isButtonLoading" :disabled="formStore.isDisabled[whichSurvey]" @click="submitForm" :text="$t('buttons.save')"></base-btn>
73
73
  </section>
74
+ <v-btn
75
+ v-if="secondQuestionList && secondQuestionList.length && firstPanel"
76
+ icon="mdi mdi-close"
77
+ class="ml-3 !absolute z-10"
78
+ @click="
79
+ firstPanel = false;
80
+ secondPanel = false;
81
+ "
82
+ ></v-btn>
74
83
  <section
75
84
  ref="firstPanelSection"
76
85
  v-if="secondQuestionList && secondQuestionList.length && firstPanel"
77
- class="flex flex-col px-[10px] py-[14px]"
86
+ class="flex flex-col px-[10px] pb-[14px]"
78
87
  :class="[$libStyles.scrollPage]"
79
88
  >
80
- <v-btn
81
- icon="mdi mdi-close"
82
- variant="text"
83
- size="large"
84
- @click="
85
- firstPanel = false;
86
- secondPanel = false;
87
- "
88
- ></v-btn>
89
- <section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
89
+ <section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4">
90
90
  <base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
91
91
  <base-form-input
92
92
  v-if="question.definedAnswers === 'N'"
@@ -2,16 +2,6 @@
2
2
  <section class="flex flex-col gap-4 px-[10px]">
3
3
  <v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
4
4
  <base-form-section :title="$t('form.personalData')">
5
- <base-form-input
6
- v-model="member.iin"
7
- :label="$t('form.iin')"
8
- :maska="$maska.iin"
9
- :readonly="isDisabled || isIinPhoneDisabled"
10
- :clearable="!isDisabled"
11
- :append-inner-icon="showSaveButton ? 'mdi mdi-magnify' : ''"
12
- @append="searchMember"
13
- :rules="$rules.required.concat($rules.iinRight)"
14
- ></base-form-input>
15
5
  <base-form-input
16
6
  v-model="member.phoneNumber"
17
7
  :label="$t('form.phoneNumber')"
@@ -23,6 +13,16 @@
23
13
  @keyup.enter.prevent="otpCondition ? openCustomPanel('otp') : null"
24
14
  :rules="phoneRule"
25
15
  ></base-form-input>
16
+ <base-form-input
17
+ v-model="member.iin"
18
+ :label="$t('form.iin')"
19
+ :maska="$maska.iin"
20
+ :readonly="isDisabled || isIinPhoneDisabled"
21
+ :clearable="!isDisabled"
22
+ :append-inner-icon="showSaveButton ? 'mdi mdi-magnify' : ''"
23
+ @append="searchMember"
24
+ :rules="$rules.required.concat($rules.iinRight)"
25
+ ></base-form-input>
26
26
  <base-form-input
27
27
  v-model="member.lastName"
28
28
  :readonly="isDisabled || isFromGBD"
@@ -543,7 +543,7 @@ export default {
543
543
  const hasOtp = computed(() => member.value.otpCode && member.value.otpCode.length === useMask().otp.length);
544
544
  const isDisabled = computed(() => !memberStore.isStatementEditible(whichForm.value as string));
545
545
  const isTask = computed(() => route.params.taskId === '0' || dataStore.isTask());
546
- const isIinPhoneDisabled = computed(() => formStore.applicationData && 'regNumber' in formStore.applicationData && whichForm.value === formStore.policyholderFormKey);
546
+ const isIinPhoneDisabled = computed(() => member.value.hasAgreement);
547
547
  const isFromGBD = computed(() => !!member.value.gosPersonData);
548
548
  const showSaveButton = computed(() => {
549
549
  const generalCondition = !isDisabled.value && !!isTask.value && !!dataStore.isInitiator();
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <section class="flex flex-col gap-4 px-[10px]">
3
3
  <v-form ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
4
- <base-form-section v-if="$dataStore.isGons" :title="$t('productConditionsForm.requestedProductConditions')" :class="[$libStyles.textSimple]">
4
+ <base-form-section v-if="whichProduct === 'gons'" :title="$t('productConditionsForm.requestedProductConditions')" :class="[$libStyles.textSimple]">
5
5
  <base-form-text-section
6
6
  class="mb-4"
7
7
  title="Инвалидность I или II группы по причине несчастного случая, начиная с третьего года по любой причине, с освобождением от уплаты страховых взносов"
@@ -87,7 +87,7 @@
87
87
  ></base-panel-input>
88
88
  </base-form-section>
89
89
  <base-form-section :title="$t('generalConditions')">
90
- <div v-if="isRecalculation && $route.params.taskId === '0'">
90
+ <div v-if="isRecalculation && ($route.params.taskId === '0' || $dataStore.isCalculator)">
91
91
  <base-form-input
92
92
  v-model="productConditionsForm.signDate"
93
93
  :maska="$maska.date"
@@ -122,7 +122,7 @@
122
122
  :readonly="isDisabled"
123
123
  :clearable="!isDisabled"
124
124
  :rules="coverPeriodRule"
125
- :label="$t($dataStore.isGons ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
125
+ :label="$t(whichProduct === 'gons' ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
126
126
  ></base-form-input>
127
127
  <base-panel-input
128
128
  v-if="hasPaymentPeriod"
@@ -207,9 +207,9 @@
207
207
  </div>
208
208
  </base-form-section>
209
209
  </v-form>
210
- <base-btn v-if="isRecalculation && hasCalculated" :btn="$libStyles.greenLightBtn" :text="$t('buttons.toStatement')" @click="toStatement"></base-btn>
210
+ <base-btn v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated" :btn="$libStyles.greenLightBtn" :text="$t('buttons.toStatement')" @click="toStatement"></base-btn>
211
211
  <base-btn
212
- v-if="!isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
212
+ v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
213
213
  :loading="isCalculating"
214
214
  :text="$t('buttons.calculate')"
215
215
  @click="submitForm"
@@ -261,6 +261,10 @@ export default defineComponent({
261
261
  type: Boolean,
262
262
  default: false,
263
263
  },
264
+ product: {
265
+ type: String,
266
+ default: false,
267
+ },
264
268
  },
265
269
  setup(props) {
266
270
  const vForm = ref<any>();
@@ -270,6 +274,7 @@ export default defineComponent({
270
274
  const dataStore = useDataStore();
271
275
  const memberStore = useMemberStore();
272
276
 
277
+ const whichProduct = ref<string>(dataStore.isCalculator ? props.product : dataStore.product!);
273
278
  const isCalculating = ref<boolean>(false);
274
279
  const isPanelLoading = ref<boolean>(false);
275
280
  const isPanelOpen = ref<boolean>(false);
@@ -291,7 +296,7 @@ export default defineComponent({
291
296
  return formStore.applicationData.statusCode === 'UnderwriterForm';
292
297
  }
293
298
  });
294
- const isDisabled = computed(() => !memberStore.isStatementEditible(formStore.productConditionsFormKey));
299
+ const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible(formStore.productConditionsFormKey)));
295
300
  const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
296
301
  const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
297
302
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
@@ -299,65 +304,65 @@ export default defineComponent({
299
304
  const requestedSumInsured = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
300
305
  const hasCalculated = computed(() => !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth);
301
306
  const hasProcessIndexRate = computed(() => {
302
- if (dataStore.isGons || dataStore.isKazyna) {
307
+ if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna') {
303
308
  return false;
304
309
  }
305
310
  return true;
306
311
  });
307
312
  const hasPaymentPeriod = computed(() => {
308
- if (dataStore.isKazyna) {
313
+ if (whichProduct.value === 'halykkazyna') {
309
314
  return false;
310
315
  }
311
316
  return true;
312
317
  });
313
318
  const hasRequestedSumInsuredInDollar = computed(() => {
314
- if (dataStore.isKazyna) {
319
+ if (whichProduct.value === 'halykkazyna') {
315
320
  return true;
316
321
  }
317
322
  return false;
318
323
  });
319
324
  const hasInsurancePremiumPerMonthInDollar = computed(() => {
320
- if (dataStore.isKazyna) {
325
+ if (whichProduct.value === 'halykkazyna') {
321
326
  return true;
322
327
  }
323
328
  return false;
324
329
  });
325
330
  const hasCurrency = computed(() => {
326
- if (dataStore.isKazyna) {
331
+ if (whichProduct.value === 'halykkazyna') {
327
332
  return true;
328
333
  }
329
334
  return false;
330
335
  });
331
336
  const hasAdbMultiply = computed(() => {
332
- if (dataStore.isGons) {
337
+ if (whichProduct.value === 'gons') {
333
338
  return false;
334
339
  }
335
340
  return true;
336
341
  });
337
342
  const hasAdbAdditive = computed(() => {
338
- if (dataStore.isGons) {
343
+ if (whichProduct.value === 'gons') {
339
344
  return false;
340
345
  }
341
346
  return true;
342
347
  });
343
348
  const hasRiskGroup = computed(() => {
344
- if (dataStore.isGons) {
349
+ if (whichProduct.value === 'gons') {
345
350
  return false;
346
351
  }
347
352
  return true;
348
353
  });
349
354
  const coverPeriodRule = computed(() => {
350
355
  const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
351
- if (dataStore.isGons) {
356
+ if (whichProduct.value === 'gons') {
352
357
  return baseCondition.concat(dataStore.rules.coverPeriodFrom3to20);
353
358
  }
354
- if (dataStore.isKazyna) {
359
+ if (whichProduct.value === 'halykkazyna') {
355
360
  return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
356
361
  }
357
362
  return baseCondition;
358
363
  });
359
364
  const currencySymbolsAddTerm = computed(() => {
360
- if (dataStore.isKazyna) {
365
+ if (whichProduct.value === 'halykkazyna') {
361
366
  return constants.currencySymbols.usd;
362
367
  }
363
368
  return constants.currencySymbols.kzt;
@@ -593,8 +598,13 @@ export default defineComponent({
593
598
 
594
599
  onMounted(async () => {
595
600
  if (props.isRecalculation === true) {
596
- if (route.params.taskId === '0' && productConditionsForm.requestedSumInsured === null && productConditionsForm.insurancePremiumPerMonth === null) {
597
- const defaultData = await dataStore.getDefaultCalculationData(true);
601
+ if (
602
+ (dataStore.isCalculator || route.params.taskId === '0') &&
603
+ productConditionsForm.requestedSumInsured === null &&
604
+ productConditionsForm.insurancePremiumPerMonth === null
605
+ ) {
606
+ // @ts-ignore
607
+ const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
598
608
  if (!defaultData) {
599
609
  dataStore.showToaster('error', 'Отсутствуют базовые данные');
600
610
  return;
@@ -616,7 +626,7 @@ export default defineComponent({
616
626
  if (!!productConditionsForm.requestedSumInsured) {
617
627
  whichSum.value = 'requestedSumInsured';
618
628
  }
619
- if (dataStore.isKazyna) {
629
+ if (whichProduct.value === 'halykkazyna') {
620
630
  const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
621
631
  if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
622
632
  await dataStore.getCurrencies();
@@ -666,6 +676,7 @@ export default defineComponent({
666
676
  // State
667
677
  formStore,
668
678
  vForm,
679
+ whichProduct,
669
680
  productConditionsForm,
670
681
  additionalTerms,
671
682
  isCalculating,
@@ -828,6 +828,7 @@ export class DataStoreClass {
828
828
  beneficialOwnerApp: MemberSettings;
829
829
  spokesmanApp: MemberSettings;
830
830
  };
831
+ iframeLoading: boolean;
831
832
  hasLayoutMargins: boolean;
832
833
  readonly product: string | null;
833
834
  showNav: boolean;
@@ -952,6 +953,7 @@ export class DataStoreClass {
952
953
  hasAttachment: true,
953
954
  hasAffiliation: true,
954
955
  };
956
+ this.iframeLoading = false;
955
957
  this.hasLayoutMargins = true;
956
958
  this.processIndexRate = [];
957
959
  this.processPaymentPeriod = [];
@@ -60,6 +60,7 @@ export const constants = Object.freeze({
60
60
  postActions: {
61
61
  font: 'font',
62
62
  route: 'route',
63
+ onRouteChange: 'onRouteChange',
63
64
  applicationCreated: 'applicationCreated',
64
65
  clipboard: 'clipboard',
65
66
  toHomePage: 'toHomePage',
@@ -68,6 +69,7 @@ export const constants = Object.freeze({
68
69
  DOMevent: 'DOMevent',
69
70
  Error401: 'Error401',
70
71
  Error500: 'Error500',
72
+ iframeLoaded: 'iframeLoaded',
71
73
  },
72
74
  currencySymbols: {
73
75
  kzt: '₸',
@@ -165,7 +165,11 @@ export const ErrorHandler = (err: unknown, errorText?: string) => {
165
165
  console.log(err);
166
166
  if (err instanceof AxiosError) {
167
167
  if ('response' in err && err.response && err.response.data) {
168
- useDataStore().showToaster('error', errorText ? errorText : err.response.data, 10000);
168
+ if ('status' in err.response && err.response.status === 403) {
169
+ useDataStore().showToaster('error', useDataStore().t('toaster.noPermission'), 10000);
170
+ } else if (err.response.data) {
171
+ useDataStore().showToaster('error', errorText ? errorText : err.response.data, 10000);
172
+ }
169
173
  }
170
174
  }
171
175
  return false;
package/locales/en.json CHANGED
@@ -95,9 +95,11 @@
95
95
  "insured": "застрахованный",
96
96
  "beneficiary": "выгодоприобретатель",
97
97
  "beneficialOwner": "бенефициарный собственник",
98
- "spokesman": "представитель страхователя"
98
+ "spokesman": "представитель страхователя",
99
+ "noPermission": "You have no permission on {text}"
99
100
  },
100
101
  "buttons": {
102
+ "dataInput": "Input",
101
103
  "createStatement": "Create Statement",
102
104
  "add": "Add",
103
105
  "userLogin": "Login",
@@ -261,7 +263,7 @@
261
263
  "riskGroup": "Risk Group",
262
264
  "requestedProductConditions": "Requested Insurance Conditions",
263
265
  "coverPeriodFrom3to20": "Insurance Period (from 3 to 20 years)",
264
- "insurancePremiumAmount": "Insurance Premium Amount",
266
+ "insurancePremiumAmount": "Insurance Premium Amount in tenge",
265
267
  "insurancePremiumAmountInDollar": "Amount of the Insurance premium (insurance fee) in dollars",
266
268
  "coverPeriodFrom2to22": "Cover Period (from 2y to 20y)",
267
269
  "dollarExchangeRateNBRK": "NBRK dollar exchange rate",
package/locales/kz.json CHANGED
@@ -95,9 +95,11 @@
95
95
  "insured": "застрахованный",
96
96
  "beneficiary": "выгодоприобретатель",
97
97
  "beneficialOwner": "бенефициарный собственник",
98
- "spokesman": "представитель страхователя"
98
+ "spokesman": "представитель страхователя",
99
+ "noPermission": "Сұрау салуға рұқсатыңыз жоқ {text}"
99
100
  },
100
101
  "buttons": {
102
+ "dataInput": "Енгізу",
101
103
  "createStatement": "Заявка жасау",
102
104
  "add": "Қосу",
103
105
  "userLogin": "Кіру",
@@ -262,7 +264,7 @@
262
264
  "requestedProductConditions": "Талап етілетін сақтандыру шарттары",
263
265
  "coverPeriodFrom3to20": "Страховық мерзім (3-тен 20 жылға дейін)",
264
266
  "coverPeriodFrom2to20": "Страховық мерзім (2-тен 20 жылға дейін)",
265
- "insurancePremiumAmount": "Сақтандыру сыйлықақысы өлшемі (страховой взнос)",
267
+ "insurancePremiumAmount": "Сақтандыру сыйлықақысы өлшемі (страховой взнос) в тенге",
266
268
  "insurancePremiumAmountInDollar": "Сақтандыру сыйлықақысы өлшемі доллармен (страховой взнос)",
267
269
  "dollarExchangeRateNBRK": "Доллардың НБРК айырымы",
268
270
  "contractDate": "Контракт күні"
package/locales/ru.json CHANGED
@@ -95,9 +95,11 @@
95
95
  "insured": "застрахованный",
96
96
  "beneficiary": "выгодоприобретатель",
97
97
  "beneficialOwner": "бенефициарный собственник",
98
- "spokesman": "представитель страхователя"
98
+ "spokesman": "представитель страхователя",
99
+ "noPermission": "У вас нет привилегии на запрос {text}"
99
100
  },
100
101
  "buttons": {
102
+ "dataInput": "Ввод данных",
101
103
  "createStatement": "Создать заявку",
102
104
  "add": "Добавить",
103
105
  "userLogin": "Логин",
@@ -262,7 +264,7 @@
262
264
  "requestedProductConditions": "Запрашиваемые условия страхования",
263
265
  "coverPeriodFrom3to20": "Срок страхования (от 3-х до 20 лет)",
264
266
  "coverPeriodFrom2to22": "Срок страхования (от 2-х до 20 лет)",
265
- "insurancePremiumAmount": "Размер Страховой премии (страховой взнос)",
267
+ "insurancePremiumAmount": "Размер Страховой премии (страховой взнос) в тенге",
266
268
  "insurancePremiumAmountInDollar": "Размер Страховой премии (страховой взнос) в долларах",
267
269
  "dollarExchangeRateNBRK": "Курс доллара НБРК",
268
270
  "contractDate": "Дата контракта"
@@ -504,7 +506,7 @@
504
506
  "firstName": "Имя",
505
507
  "middleName": "Отчество",
506
508
  "birthDate": "Дата рождения",
507
- "signDate": "Дата расчета",
509
+ "signDate": "Дата",
508
510
  "age": "Возраст",
509
511
  "gender": "Пол",
510
512
  "familyStatus": "Семейное положение",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8-beta.20",
3
+ "version": "0.0.8-beta.22",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -50,6 +50,6 @@
50
50
  "vue-json-pretty": "^2.2.4",
51
51
  "vue-toastification": "^2.0.0-rc.5",
52
52
  "vue-uuid": "^3.0.0",
53
- "vuetify": "^3.3.1"
53
+ "vuetify": "^3.3.4"
54
54
  }
55
55
  }
@@ -8,7 +8,9 @@ import * as directives from 'vuetify/directives';
8
8
  export default defineNuxtPlugin(nuxtApp => {
9
9
  const vuetify = createVuetify({
10
10
  ssr: false,
11
- components,
11
+ components: {
12
+ ...components,
13
+ },
12
14
  directives,
13
15
  defaults: {
14
16
  VForm: {
@@ -42,6 +42,7 @@ export const useDataStore = defineStore('data', {
42
42
  isPension: state => state.product === 'pension',
43
43
  isGons: state => state.product === 'gons',
44
44
  isKazyna: state => state.product === 'halykkazyna',
45
+ isCalculator: state => state.product === 'calculator',
45
46
  isComplianceWindow: state => state.product === 'compliance',
46
47
  isEveryFormDisabled: state => Object.values(state.formStore.isDisabled).every(i => i === true),
47
48
  },
@@ -168,6 +169,9 @@ export const useDataStore = defineStore('data', {
168
169
  }
169
170
  }
170
171
  },
172
+ getUserData() {
173
+ return this.accessToken ? jwtDecode(this.accessToken) : null;
174
+ },
171
175
  isRole(whichRole) {
172
176
  if (this.user.roles.length === 0) {
173
177
  this.getUserRoles();
@@ -1328,10 +1332,10 @@ export const useDataStore = defineStore('data', {
1328
1332
  console.log(err);
1329
1333
  }
1330
1334
  },
1331
- async getDefaultCalculationData(showLoader = false) {
1335
+ async getDefaultCalculationData(showLoader = false, product = null) {
1332
1336
  this.isLoading = showLoader;
1333
1337
  try {
1334
- const calculationData = await this.api.getDefaultCalculationData();
1338
+ const calculationData = await this.api.getDefaultCalculationData(this.isCalculator ? product : undefined);
1335
1339
  return calculationData;
1336
1340
  } catch (err) {
1337
1341
  ErrorHandler(err);
@@ -1339,7 +1343,7 @@ export const useDataStore = defineStore('data', {
1339
1343
  this.isLoading = false;
1340
1344
  }
1341
1345
  },
1342
- async calculateWithoutApplication(showLoader = false) {
1346
+ async calculateWithoutApplication(showLoader = false, product = null) {
1343
1347
  this.isLoading = showLoader;
1344
1348
  try {
1345
1349
  const calculationData = {
@@ -1356,16 +1360,16 @@ export const useDataStore = defineStore('data', {
1356
1360
  paymentPeriodId: this.formStore.productConditionsForm.paymentPeriod.id,
1357
1361
  addCovers: this.formStore.additionalInsuranceTermsWithout,
1358
1362
  };
1359
- if (this.isKazyna) {
1363
+ if (this.isKazyna || product === 'halykkazyna') {
1360
1364
  calculationData.premiumInCurrency = getNumber(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar);
1361
1365
  calculationData.amountInCurrency = getNumber(this.formStore.productConditionsForm.requestedSumInsuredInDollar);
1362
1366
  calculationData.currencyExchangeRate = this.currencies.usd;
1363
1367
  }
1364
- const calculationResponse = await this.api.calculateWithoutApplication(calculationData);
1368
+ const calculationResponse = await this.api.calculateWithoutApplication(calculationData, this.isCalculator ? product : undefined);
1365
1369
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.amount);
1366
1370
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.premium);
1367
1371
  this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
1368
- if (this.isKazyna) {
1372
+ if (this.isKazyna || product === 'halykkazyna') {
1369
1373
  this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(calculationResponse.amountInCurrency);
1370
1374
  this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(calculationResponse.premiumInCurrency);
1371
1375
  }
@@ -1860,7 +1864,7 @@ export const useDataStore = defineStore('data', {
1860
1864
  const data = {
1861
1865
  processInstanceId: this.formStore.applicationData.processInstanceId,
1862
1866
  regNumber: this.formStore.finCenterData.regNumber,
1863
- date: this.formStore.finCenterData.date,
1867
+ date: formatDate(this.formStore.finCenterData.date),
1864
1868
  };
1865
1869
  const result = await this.api.registerNumber(data);
1866
1870
  return result;