hl-core 0.0.10-beta.42 → 0.0.10-beta.43

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
@@ -221,6 +221,13 @@ export class ApiClass {
221
221
  });
222
222
  }
223
223
 
224
+ async getQuestionListSecondById(surveyType: string, processInstanceId: string | number, insuredId: number | string, id: string) {
225
+ return await this.axiosCall<Types.AnketaSecond[]>({
226
+ method: Methods.GET,
227
+ url: `/${this.productUrl}/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}/${id}`,
228
+ });
229
+ }
230
+
224
231
  async definedAnswers(filter: string) {
225
232
  return await this.axiosCall({
226
233
  method: Methods.GET,
@@ -1021,6 +1028,17 @@ export class ApiClass {
1021
1028
  });
1022
1029
  }
1023
1030
 
1031
+ async acceptDeclaration(insuredId: string, accept: boolean) {
1032
+ return await this.axiosCall<boolean>({
1033
+ method: Methods.POST,
1034
+ url: `/${this.productUrl}/api/Application/AcceptDeclaration`,
1035
+ params: {
1036
+ insuredId,
1037
+ accept,
1038
+ },
1039
+ });
1040
+ }
1041
+
1024
1042
  async getParentContractData(policyId: string) {
1025
1043
  return await this.axiosCall<{ bin: string; name: string }>({
1026
1044
  method: Methods.GET,
@@ -83,7 +83,7 @@
83
83
  />
84
84
  <div v-if="isPanelLoading === false" class="w-full">
85
85
  <div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
86
- <div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
86
+ <div v-for="(agent, index) of agentDataFiltered" :key="index">
87
87
  <div
88
88
  class="flex justify-between p-4 items-center cursor-pointer"
89
89
  :class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
@@ -199,6 +199,13 @@ export default defineComponent({
199
199
  if (dataStore.isGons) return !dataStore.isAgent();
200
200
  return true;
201
201
  });
202
+ const agentDataFiltered = computed(() => {
203
+ if (formStore.RegionPolicy?.nameRu && searchQuery.value === 'Без агента') {
204
+ return dataStore.AgentData.filter(i => String(i.officeId) === String(formStore.RegionPolicy.ids));
205
+ } else {
206
+ return dataStore.AgentData;
207
+ }
208
+ });
202
209
  const isExecutorShown = dataStore.isPension;
203
210
  const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
204
211
  searchQuery.value = '';
@@ -306,6 +313,7 @@ export default defineComponent({
306
313
  isManagerShown,
307
314
  isAgentShown,
308
315
  isExecutorShown,
316
+ agentDataFiltered,
309
317
 
310
318
  // Functions
311
319
  openPanel,
@@ -23,8 +23,8 @@
23
23
  >
24
24
  </base-content-block>
25
25
  <div class="flex flex-col gap-3" v-if="hasConditionsAction">
26
- <base-btn :text="$dataStore.t('confirm.yes')" @click="handleTask" />
27
- <base-btn :btn="$styles.blueLightBtn" :text="$dataStore.t('confirm.no')" @click="closePanel" />
26
+ <base-btn :text="$dataStore.t('confirm.yes')" :loading="loading" @click="handleTask" />
27
+ <base-btn :btn="$styles.blueLightBtn" :loading="loading" :text="$dataStore.t('confirm.no')" @click="closePanel" />
28
28
  </div>
29
29
  </div>
30
30
  </section>
@@ -31,7 +31,7 @@ export const constants = Object.freeze({
31
31
  checkcontragent: 1,
32
32
  checkcontract: 2,
33
33
  },
34
- extractedProducts: ['dso', 'uu'],
34
+ extractedProducts: ['dso', 'uu', 'lka'],
35
35
  editableStatuses: [Statuses.StartForm, Statuses.EditBeneficiaryForm, Statuses.EditForm, Statuses.InputDataForm],
36
36
  documentsLinkVisibleStatuses: [
37
37
  Statuses.Completed,
@@ -4,7 +4,7 @@ import { XMLParser } from 'fast-xml-parser';
4
4
  import { AxiosError } from 'axios';
5
5
  import { DocumentReaderApi, Scenario, TextFieldType, LCID } from '@regulaforensics/document-reader-webclient';
6
6
  import { PolicyholderClass, Value, User } from '../composables/classes';
7
- import type { EnvModes, NestedKeyOf, Projects, ResponseStructure, Utils } from '../types';
7
+ import type { EnvModes, NestedKeyOf, Projects, ResponseStructure, Utils, RouteType } from '../types';
8
8
  import { Roles, Statuses } from '../types/enum';
9
9
 
10
10
  export const useEnv = () => {
@@ -468,7 +468,8 @@ type WhichValuePerEnv =
468
468
  | 'efoBaseApi'
469
469
  | 'efoBaseApiLocal'
470
470
  | 'amlBaseApi'
471
- | 'amlBaseApiLocal';
471
+ | 'amlBaseApiLocal'
472
+ | 'lkaUrl';
472
473
 
473
474
  export const getStrValuePerEnv = (which: WhichValuePerEnv) => {
474
475
  const valuesPerEnv: {
@@ -531,6 +532,11 @@ export const getStrValuePerEnv = (which: WhichValuePerEnv) => {
531
532
  development: 'http://aml-dev.halyklife.nb/api',
532
533
  test: 'http://aml-dev.halyklife.nb/api',
533
534
  },
535
+ lkaUrl: {
536
+ production: 'https://dev.lka-web.halyklife.nb/efo',
537
+ development: 'https://dev.lka-web.halyklife.nb/efo',
538
+ test: 'https://dev.lka-web.halyklife.nb/efo',
539
+ },
534
540
  };
535
541
  return valuesPerEnv[which][import.meta.env.VITE_MODE as EnvModes];
536
542
  };
@@ -549,6 +555,83 @@ export const getMainPageRoute = () => {
549
555
  return 'index';
550
556
  };
551
557
 
558
+ export const validateToken = (to: RouteType) => {
559
+ const dataStore = useDataStore();
560
+ if (to.query) {
561
+ if ('token' in to.query) {
562
+ const token = to.query.token as string;
563
+ if (isValidToken(token)) {
564
+ localStorage.setItem('accessToken', token);
565
+ dataStore.accessToken = token;
566
+ dataStore.getUserRoles();
567
+ }
568
+ } else {
569
+ const token = localStorage.getItem('accessToken') || null;
570
+ if (token && isValidToken(token)) {
571
+ dataStore.accessToken = token;
572
+ dataStore.getUserRoles();
573
+ } else {
574
+ dataStore.sendToParent(constants.postActions.toHomePage, dataStore.t('toaster.tokenExpire'));
575
+ }
576
+ }
577
+ }
578
+ };
579
+
580
+ export const validateRoute = (to: RouteType) => {
581
+ const dataStore = useDataStore();
582
+ const token = localStorage.getItem('accessToken') || null;
583
+ if (to && to.meta && 'requiresAuth' in to.meta && to.meta.requiresAuth && (!token || (token && isValidToken(token) === false))) {
584
+ localStorage.clear();
585
+ dataStore.sendToParent(constants.postActions.toHomePage, dataStore.t('toaster.tokenExpire'));
586
+ }
587
+ };
588
+
589
+ export const validateSettingsPanel = () => {
590
+ const dataStore = useDataStore();
591
+ const formStore = useFormStore();
592
+ const hasPanelItem = (id: string) => {
593
+ return !!Object.values(dataStore.settings.items).find(i => i.id === id);
594
+ };
595
+ // Bug in getApplicationData, if there is empty member it didn't update
596
+ // if (!hasPanelItem('reload') && route.params.taskId !== '0') {
597
+ // dataStore.settings.items.push(
598
+ // new MenuItem({
599
+ // id: 'reload',
600
+ // title: dataStore.t('buttons.reload'),
601
+ // icon: 'mdi-reload',
602
+ // action: async () => await dataStore.getApplicationData(route.params.taskId),
603
+ // }),
604
+ // );
605
+ // }
606
+ if (!hasPanelItem('reject') && dataStore.isInitiator()) {
607
+ dataStore.settings.items.push(
608
+ new MenuItem({
609
+ id: 'reject',
610
+ title: dataStore.t('buttons.cancelApplication'),
611
+ icon: 'mdi-close',
612
+ action: () => (dataStore.panelAction = constants.actions.rejectclient),
613
+ show: computed(() => dataStore.isTask() && dataStore.isProcessCancel(formStore.applicationData.statusCode)),
614
+ }),
615
+ );
616
+ }
617
+ if (!hasPanelItem('return') && (dataStore.isInitiator() || dataStore.isUnderwriter())) {
618
+ dataStore.settings.items.push(
619
+ new MenuItem({
620
+ id: 'return',
621
+ title: dataStore.t('buttons.returnStatement'),
622
+ icon: 'mdi-restore',
623
+ action: () => (dataStore.panelAction = constants.actions.return),
624
+ show: computed(() => dataStore.isTask() && dataStore.isProcessReturnable(formStore.applicationData.statusCode)),
625
+ }),
626
+ );
627
+ }
628
+ };
629
+
630
+ export const isIframe = () => {
631
+ if (window.location.hostname !== 'localhost' && useEnv().isProduction) return window.self !== window.top;
632
+ return true;
633
+ };
634
+
552
635
  export const keyDeleter = <T extends object>(data: T, keys: Array<NestedKeyOf<T>>) => {
553
636
  if (typeof data === 'object' && !!data && keys && Array.isArray(keys) && keys.length) {
554
637
  keys.forEach(key => {
@@ -783,6 +866,7 @@ export class RoleController {
783
866
  return {
784
867
  invoiceInfo: this.isAdmin() || this.isSupport(),
785
868
  toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
869
+ toLKAv2: this.isAgent() || this.isManagerHalykBank() || this.isServiceManager() || baseAccessRoles,
786
870
  toAML: this.isCompliance() || baseAccessRoles,
787
871
  toAULETTI: this.isAgentAuletti() || this.isManagerAuletti() || baseAccessRoles,
788
872
  toLKA_A: this.isAgentAuletti() || baseAccessRoles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.42",
3
+ "version": "0.0.10-beta.43",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",