hl-core 0.0.9-beta.25 → 0.0.9-beta.26

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
@@ -377,7 +377,7 @@ export class ApiClass {
377
377
  });
378
378
  }
379
379
 
380
- async startApplication(data: StartApplicationType) {
380
+ async startApplication(data: any) {
381
381
  return await this.axiosCall<{
382
382
  processInstanceId: string;
383
383
  }>({
@@ -689,6 +689,19 @@ export class ApiClass {
689
689
  data: data,
690
690
  });
691
691
  }
692
+ async downloadTemplate() {
693
+ return this.axiosCall({
694
+ method: Methods.GET,
695
+ url: `/${this.productUrl}/api/Application/DownloadTemplate`,
696
+ });
697
+ }
698
+
699
+ async sendTemplateToEmail(email: string) {
700
+ return this.axiosCall({
701
+ method: Methods.GET,
702
+ url: `/${this.productUrl}/api/Application/SendTemplateToEmail?emailTo=${email}`,
703
+ });
704
+ }
692
705
 
693
706
  async getCalculator(data: SetApplicationRequest) {
694
707
  return await this.axiosCall<number>({
@@ -697,4 +710,60 @@ export class ApiClass {
697
710
  data: data,
698
711
  });
699
712
  }
713
+
714
+ async saveClient(processInstanceId: string | number, clientId: string | null, data: any) {
715
+ return await this.axiosCall({
716
+ method: Methods.POST,
717
+ url: `/${this.productUrl}/api/Application/saveClient/?processInstanceId=${processInstanceId}&clientId=${clientId}`,
718
+ data: data,
719
+ });
720
+ }
721
+
722
+ async saveAccidentIncidents(processInstanceId: string | number, data: any) {
723
+ return await this.axiosCall({
724
+ method: Methods.POST,
725
+ url: `/${this.productUrl}/api/Application/saveAccidentIncidentsList/?processInstance=${processInstanceId}`,
726
+ data: data,
727
+ });
728
+ }
729
+
730
+ async saveClientAcivityTypes(clientId: string | number, data: any) {
731
+ return await this.axiosCall({
732
+ method: Methods.POST,
733
+ url: `/${this.productUrl}/api/Application/saveClientAcivityTypes/?clientId=${clientId}`,
734
+ data: data,
735
+ });
736
+ }
737
+
738
+ async saveBeneficialOwnerList(processInstanceId: string | number, data: any) {
739
+ return await this.axiosCall({
740
+ method: Methods.POST,
741
+ url: `/${this.productUrl}/api/Application/saveBeneficialOwnerList/?processInstanceId=${processInstanceId}`,
742
+ data: data,
743
+ });
744
+ }
745
+
746
+ async saveBeneficialOwner(processInstanceId: string | number, benificiaryId: string | null, data: any) {
747
+ return await this.axiosCall({
748
+ method: Methods.POST,
749
+ url: `/${this.productUrl}/api/Application/saveBeneficialOwner/?processInstanceId=${processInstanceId}&benificiaryId=${benificiaryId}`,
750
+ data: data,
751
+ });
752
+ }
753
+
754
+ async saveInsuredList(processInstanceId: string | number, data: any) {
755
+ return await this.axiosCall({
756
+ method: Methods.POST,
757
+ url: `/${this.productUrl}/api/Application/saveInsuredList/?processInstanceId=${processInstanceId}`,
758
+ data: data,
759
+ });
760
+ }
761
+
762
+ async saveInsured(processInstanceId: string | number, insuredId: string | null, data: any) {
763
+ return await this.axiosCall({
764
+ method: Methods.POST,
765
+ url: `/${this.productUrl}/api/Application/saveInsured/?processInstanceId=${processInstanceId}&insuredId=${insuredId}`,
766
+ data: data,
767
+ });
768
+ }
700
769
  }
@@ -24,10 +24,10 @@ export default function (axios: AxiosInstance) {
24
24
  if (request.baseURL === 'https://products.halyklife.kz/api/v1/test/insis') {
25
25
  request.baseURL = 'http://vega:84';
26
26
  }
27
- if (request.baseURL === 'https://products.halyklife.kz/dev/efo/api') {
27
+ if (request.baseURL === 'https://products.halyklife.kz/test/efo/api') {
28
28
  request.baseURL = 'http://efo-dev.halyklife.nb/api';
29
29
  }
30
- if (request.baseURL === 'https://products.halyklife.kz/dev/aml/api') {
30
+ if (request.baseURL === 'https://products.halyklife.kz/test/aml/api') {
31
31
  request.baseURL = 'http://aml-dev.halyklife.nb/api';
32
32
  }
33
33
  }
@@ -44,7 +44,7 @@ export default function (axios: AxiosInstance) {
44
44
  request.baseURL = request.baseURL.replace('api/v1/insis', 'efo/api');
45
45
  }
46
46
  if (request.baseURL.includes('api/v1/test/insis')) {
47
- request.baseURL = request.baseURL.replace('api/v1/test/insis', 'dev/efo/api');
47
+ request.baseURL = request.baseURL.replace('api/v1/test/insis', 'test/efo/api');
48
48
  }
49
49
  }
50
50
  }
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div class="bg-primary-light-blue rounded-lg mb-2">
3
+ <div class="bg-white rounded-lg pa-3 pa-sm-6">
4
+ <div class="items-center justify-between">
5
+ <p class="text-[#009C73] text-base">{{ props.control.title }}</p>
6
+ </div>
7
+ <v-row class="mt-1">
8
+ <v-col v-for="(label, index) in visibleLabels" :key="index" :cols="label.hideInMobile !== false ? label.size : 11 / visibleLabels.length">
9
+ <p class="text-sm font-medium">
10
+ {{ label.value }}
11
+ </p>
12
+ </v-col>
13
+ <v-col cols="1"></v-col>
14
+ </v-row>
15
+ <v-row v-if="props.control.entries && props.control.entries.length">
16
+ <v-col v-for="(label, index) in visibleLabels" :key="index" :cols="label.size ?? 11 / visibleLabels.length" class="flex items-center">
17
+ <p class="text-base">{{ props.control.entries[index].value }}</p>
18
+ </v-col>
19
+ <v-col cols="1" class="flex items-end justify-end">
20
+ <button v-if="!props.control.disabled" @click="$emit('onMore', { whichForm: control.key })">
21
+ <i class="mdi mdi-dots-vertical text-xl"></i>
22
+ </button>
23
+ </v-col>
24
+ </v-row>
25
+ <v-row v-else>
26
+ <v-col cols="11" class="flex items-center">
27
+ <span class="text-primary-blue text-base">{{ $dataStore.t('clients.necessaryFillForm') }} </span>
28
+ </v-col>
29
+ <v-col cols="1" class="flex items-end justify-end">
30
+ <button v-if="!props.control.disabled" @click="$emit('onMore', { whichForm: control.key })">
31
+ <i class="mdi mdi-dots-vertical text-xl"></i>
32
+ </button>
33
+ </v-col>
34
+ </v-row>
35
+ </div>
36
+ </div>
37
+ </template>
38
+ <script setup lang="ts">
39
+ const display = useDisplayInfo();
40
+ const props = defineProps({
41
+ control: {
42
+ type: Object as PropType<FormBlock>,
43
+ required: true,
44
+ },
45
+ });
46
+ const isDesktop = computed(() => display.lgAndUp.value);
47
+ const visibleLabels = computed(() => (isDesktop.value ? props.control.labels : props.control.labels.filter(l => l.hideInMobile === false)));
48
+ </script>
@@ -44,7 +44,7 @@
44
44
  <base-form-input v-model="formStore.policyholderForm.age" :label="$dataStore.t('form.age')" :readonly="true" />
45
45
  <base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
46
46
  </base-form-section>
47
- <base-form-section v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true" :title="$dataStore.t('insuredForm')">
47
+ <base-form-section v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true && !$dataStore.isLifeBusiness" :title="$dataStore.t('insuredForm')">
48
48
  <div v-for="(insured, index) of formStore.insuredForm" :key="index">
49
49
  <base-form-input v-model="insured.longName" :label="$dataStore.t('labels.insurerLongName')" :readonly="true" />
50
50
  <base-form-input v-model="insured.job" :label="$dataStore.t('form.job')" :readonly="true" />
@@ -546,6 +546,20 @@
546
546
  </div>
547
547
  </div>
548
548
  </Teleport>
549
+ <Teleport v-if="isCoverPeriodPanelOpen" to="#panel-actions">
550
+ <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
551
+ <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
552
+ <div class="w-full flex flex-col gap-2 p-2">
553
+ <base-panel-select-item
554
+ v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
555
+ :key="index"
556
+ :text="(item.nameRu as string)"
557
+ :selected="item.code === coverPeriodValue"
558
+ @click="pickCoverPeriodValue(item)"
559
+ />
560
+ </div>
561
+ </div>
562
+ </Teleport>
549
563
  </section>
550
564
  </template>
551
565
 
@@ -577,7 +591,9 @@ export default defineComponent({
577
591
  const isPanelOpen = ref<boolean>(false);
578
592
  const isTermsPanelOpen = ref<boolean>(false);
579
593
  const isFixInsAmountPanelOpen = ref<boolean>(false);
594
+ const isCoverPeriodPanelOpen = ref<boolean>(false);
580
595
  const fixInsValue = ref<string | number>();
596
+ const coverPeriodValue = ref<string>('');
581
597
  const panelValue = ref<Value>(new Value());
582
598
  const termValue = ref<AddCover>();
583
599
  const panelList = ref<Value[]>([]);
@@ -616,6 +632,9 @@ export default defineComponent({
616
632
  if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
617
633
  return false;
618
634
  }
635
+ if (dataStore.isLifeBusiness) {
636
+ return true;
637
+ }
619
638
  return isDisabled.value;
620
639
  });
621
640
  const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
@@ -855,7 +874,7 @@ export default defineComponent({
855
874
  }
856
875
  }
857
876
  };
858
- const pickTermValue = (item: Value) => {
877
+ const pickTermValue = async (item: Value) => {
859
878
  dataStore.panel.open = false;
860
879
  isTermsPanelOpen.value = false;
861
880
  if (typeof currentIndex.value !== 'number') return;
@@ -863,10 +882,22 @@ export default defineComponent({
863
882
  additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
864
883
  if (whichProduct.value === 'lifebusiness') {
865
884
  if (item.code === 'fixedinssum') {
866
- openFixInsPanel(dataStore.t('insurers.selectInsSum'), additionalTerms.value[currentIndex.value].amount);
885
+ openFixInsPanel(dataStore.t('clients.selectInsSum'), additionalTerms.value[currentIndex.value].amount);
867
886
  } else {
868
887
  additionalTerms.value[currentIndex.value].amount = 0;
869
888
  }
889
+ if (termValue.value && termValue.value.coverTypeCode === 6) {
890
+ coverPeriodValue.value = termValue.value.coverPeriodCode as string;
891
+ isPanelOpen.value = false;
892
+ isTermsPanelOpen.value = false;
893
+ isFixInsAmountPanelOpen.value = false;
894
+ isCoverPeriodPanelOpen.value = true;
895
+ dataStore.panelAction = null;
896
+ dataStore.panel.open = true;
897
+ isMultiplePanelOpen.value = false;
898
+ const res = await dataStore.getFromApi('DicCoverTypePeriod', 'getArmDicts', 'DicCoverTypePeriod');
899
+ panelList.value = filterList(res, '');
900
+ }
870
901
  }
871
902
  };
872
903
 
@@ -887,6 +918,7 @@ export default defineComponent({
887
918
  isPanelOpen.value = true;
888
919
  isTermsPanelOpen.value = false;
889
920
  isFixInsAmountPanelOpen.value = false;
921
+ isCoverPeriodPanelOpen.value = false;
890
922
  dataStore.panelAction = null;
891
923
  dataStore.panel.open = true;
892
924
  dataStore.panel.title = title;
@@ -914,6 +946,7 @@ export default defineComponent({
914
946
  if (!isDisabled.value || !isRecalculationDisabled.value) {
915
947
  isPanelOpen.value = false;
916
948
  isFixInsAmountPanelOpen.value = false;
949
+ isCoverPeriodPanelOpen.value = false;
917
950
  isMultiplePanelOpen.value = true;
918
951
  isPanelLoading.value = true;
919
952
  let newList = list;
@@ -963,6 +996,7 @@ export default defineComponent({
963
996
  isPanelOpen.value = false;
964
997
  isMultiplePanelOpen.value = false;
965
998
  isFixInsAmountPanelOpen.value = false;
999
+ isCoverPeriodPanelOpen.value = false;
966
1000
  isTermsPanelOpen.value = true;
967
1001
  dataStore.panelAction = null;
968
1002
  dataStore.panel.open = true;
@@ -988,6 +1022,7 @@ export default defineComponent({
988
1022
  isPanelOpen.value = false;
989
1023
  isTermsPanelOpen.value = false;
990
1024
  isMultiplePanelOpen.value = false;
1025
+ isCoverPeriodPanelOpen.value = false;
991
1026
  isFixInsAmountPanelOpen.value = true;
992
1027
  dataStore.panelAction = null;
993
1028
  dataStore.panel.open = true;
@@ -1006,6 +1041,16 @@ export default defineComponent({
1006
1041
  additionalTerms.value[currentIndex.value].amount = Number(item.code);
1007
1042
  };
1008
1043
 
1044
+ const pickCoverPeriodValue = (item: Value) => {
1045
+ coverPeriodValue.value = item.code as string;
1046
+ dataStore.panel.open = false;
1047
+ isCoverPeriodPanelOpen.value = false;
1048
+ if (typeof currentIndex.value !== 'number') return;
1049
+ additionalTerms.value[currentIndex.value].coverPeriodCode = item.code as string;
1050
+ additionalTerms.value[currentIndex.value].coverPeriodId = item.id as string;
1051
+ additionalTerms.value[currentIndex.value].coverPeriodName = item.nameRu as string;
1052
+ };
1053
+
1009
1054
  const underwriterCalculate = async (type: 'sum' | 'premium') => {
1010
1055
  if (!type) return;
1011
1056
  if (type === 'sum') {
@@ -1401,7 +1446,9 @@ export default defineComponent({
1401
1446
  Value,
1402
1447
  calculatorForm,
1403
1448
  isFixInsAmountPanelOpen,
1449
+ isCoverPeriodPanelOpen,
1404
1450
  fixInsValue,
1451
+ coverPeriodValue,
1405
1452
 
1406
1453
  // Computed
1407
1454
  isTask,
@@ -1467,6 +1514,7 @@ export default defineComponent({
1467
1514
  selectOption,
1468
1515
  pickfixInsValue,
1469
1516
  openFixInsPanel,
1517
+ pickCoverPeriodValue,
1470
1518
  };
1471
1519
  },
1472
1520
  });
@@ -125,15 +125,17 @@
125
125
  <section v-if="templateAction">
126
126
  <div :class="[$styles.flexColNav]">
127
127
  <base-content-block>
128
- <base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded">
129
- {{ $dataStore.t('downloadDocument') }}
128
+ <base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded" @click.prevent="downloadTemplate">
129
+ {{ $dataStore.t('downloadTemplate') }}
130
130
  <i class="mdi mdi-download text-2xl text-[#A0B3D8]"></i
131
131
  ></base-panel-item>
132
- <v-form ref="vForm">
133
- <base-form-input v-model.trim="actionCause" :label="$dataStore.t('form.email')" :rules="$rules.required" />
132
+ </base-content-block>
133
+ <base-content-block>
134
+ <v-form ref="vForm" class="mb-3">
135
+ <base-form-input v-model.trim="email" :label="$dataStore.t('form.email')" :rules="$rules.required" />
134
136
  </v-form>
137
+ <base-btn :text="$dataStore.t('form.sendToEmail')" :loading="loading" @click="sendTemplateToEmail" />
135
138
  </base-content-block>
136
- <base-btn :text="buttonText" :loading="loading" @click="submitForm" />
137
139
  </div>
138
140
  </section>
139
141
  </template>
@@ -151,6 +153,7 @@ export default defineComponent({
151
153
  const loading = ref<boolean>(false);
152
154
  const isPaperContract = ref<boolean>(false);
153
155
  const isElectronicContract = ref<boolean>(true);
156
+ const email = ref<string>('');
154
157
 
155
158
  const vForm = ref<any>();
156
159
  const isSendNumberOpen = ref<boolean>(false);
@@ -327,6 +330,22 @@ export default defineComponent({
327
330
  }
328
331
  return true;
329
332
  });
333
+ const downloadTemplate = async () => {
334
+ dataStore.panel.open = false;
335
+ dataStore.panelAction = null;
336
+ await dataStore.downloadTemplate();
337
+ };
338
+
339
+ const sendTemplateToEmail = async () => {
340
+ await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
341
+ if (v.valid) {
342
+ dataStore.panel.open = false;
343
+ dataStore.panelAction = null;
344
+ await dataStore.sendTemplateToEmail(email.value);
345
+ }
346
+ });
347
+ };
348
+
330
349
  const handleSignAction = async (type: 'paper' | 'electronic') => {
331
350
  if (type === 'electronic') {
332
351
  await dataStore.signDocument();
@@ -336,11 +355,13 @@ export default defineComponent({
336
355
  isPaperContract.value = true;
337
356
  }
338
357
  };
358
+
339
359
  const generateDocument = async () => {
340
360
  dataStore.panel.open = false;
341
361
  dataStore.panelAction = null;
342
362
  await dataStore.generateDocument();
343
363
  };
364
+
344
365
  return {
345
366
  // State
346
367
  formStore,
@@ -351,7 +372,7 @@ export default defineComponent({
351
372
  phoneNumber,
352
373
  selectedClient,
353
374
  isPaperContract,
354
-
375
+ email,
355
376
  // Functions
356
377
  closePanel,
357
378
  submitForm,
@@ -359,7 +380,8 @@ export default defineComponent({
359
380
  openSmsPanel,
360
381
  openEpayPanel,
361
382
  onFileChange,
362
-
383
+ downloadTemplate,
384
+ sendTemplateToEmail,
363
385
  // Computed
364
386
  buttonText,
365
387
  sendingActions,