hl-core 0.0.10-beta.19 → 0.0.10-beta.20

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
@@ -1109,19 +1109,19 @@ export class ApiClass {
1109
1109
  });
1110
1110
  }
1111
1111
 
1112
- integration = {
1113
- base: '/integration',
1114
- onlineAccess: async (data: { iin: string; documentType: string }) => {
1112
+ externalServices = {
1113
+ base: '/externalservices',
1114
+ onlineAccess: async (data: { iinBin: string; documentType: string }) => {
1115
1115
  return await this.axiosCall<void>({
1116
1116
  method: Methods.POST,
1117
- url: `${this.integration.base}/api/External/OnlineAccess`,
1117
+ url: `${this.externalServices.base}/api/ExternalServices/GetOnlineAccess`,
1118
1118
  data: data,
1119
1119
  });
1120
1120
  },
1121
1121
  digitalDocuments: async (data: { iin: string; processInstanceId: string; code: string }) => {
1122
1122
  return await this.axiosCall<void>({
1123
1123
  method: Methods.POST,
1124
- url: `${this.integration.base}/api/External/DigitalDocuments`,
1124
+ url: `${this.externalServices.base}/api/ExternalServices/DigitalDocuments`,
1125
1125
  data: data,
1126
1126
  });
1127
1127
  },
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <section v-if="member" class="mb-2">
2
+ <section v-if="member && member.iin" class="mb-2">
3
3
  <base-form-section :title="`${title} ${number === 0 ? '' : number}`" class="mx-[10px] mt-[14px] d-flex">
4
4
  <base-form-input v-model="member.iin" :label="$dataStore.t('form.iin')" :readonly="true" />
5
5
  <base-form-input v-model.trim="member.longName" :label="$dataStore.t('labels.userFullName')" :readonly="true" />
@@ -17,7 +17,7 @@
17
17
  <base-form-input v-model="formStore.contractDate" :label="$dataStore.t('form.date')" :readonly="true" append-inner-icon="mdi mdi-calendar-blank-outline" />
18
18
  <base-file-input :readonly="isDisabled" @input.prevent="onFileChange($event)" />
19
19
  </base-content-block>
20
- <base-content-block v-for="document of !useEnv().isProduction ? documentListFiltered : formStore.signedDocumentList" :key="document.id" :class="[$styles.textSimple]">
20
+ <base-content-block v-for="document of documentListFiltered" :key="document.id" :class="[$styles.textSimple]">
21
21
  <h5 class="text-center font-medium mb-4">
22
22
  {{ document.fileTypeName }}
23
23
  </h5>
@@ -217,7 +217,7 @@ export default defineComponent({
217
217
  const contractDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Договор страхования' || i.nameRu === 'Договор'));
218
218
  const processCode = formStore.applicationData.processCode;
219
219
 
220
- const hasDigitalDocuments = computed(() => !useEnv().isProduction && dataStore.isEfoParent && !dataStore.isGns && !dataStore.isLifeBusiness && !!formStore.applicationData);
220
+ const hasDigitalDocuments = computed(() => dataStore.isEfoParent && !dataStore.isGns && !dataStore.isLifeBusiness && !!formStore.applicationData);
221
221
  const isDigitalDocDisabled = computed(
222
222
  () => !dataStore.isTask() || route.params.taskId === '0' || !dataStore.isInitiator() || !dataStore.isProcessEditable(formStore.applicationData.statusCode),
223
223
  );
@@ -347,7 +347,7 @@
347
347
  />
348
348
  <base-form-input v-model.trim="member.jobPlace" :label="$dataStore.t('form.jobPlace')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required" />
349
349
  </base-form-section>
350
- <base-form-section :title="$dataStore.t('form.placeRegistration')" v-if="$dataStore.hasPlaceSection(whichForm)">
350
+ <base-form-section :title="$dataStore.t('form.placeRegistration')">
351
351
  <base-form-toggle v-if="hasSameAddressToggle" v-model="sameAddress" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('form.sameAddress')" />
352
352
  <base-panel-input
353
353
  v-model="member.registrationCountry"
@@ -447,7 +447,7 @@
447
447
  @append="openPanel($dataStore.t('form.Region'), [], 'birthRegion', $dataStore.getRegions)"
448
448
  /> -->
449
449
  </base-form-section>
450
- <base-form-section :title="$dataStore.t('form.documentData')" v-if="$dataStore.hasDocumentSection(whichForm)">
450
+ <base-form-section :title="$dataStore.t('form.documentData')">
451
451
  <base-panel-input
452
452
  v-if="gbdDocuments && gbdDocuments.length"
453
453
  value="Список документов из ГБДФЛ"
@@ -36,7 +36,14 @@
36
36
  <base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
37
37
  </base-form-section>
38
38
  <base-form-section
39
- v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew'"
39
+ v-if="
40
+ isUnderwriterRole &&
41
+ $dataStore.members.insuredApp.has === true &&
42
+ whichProduct !== 'lifebusiness' &&
43
+ whichProduct !== 'gns' &&
44
+ whichProduct !== 'pensionannuitynew' &&
45
+ whichProduct !== 'lifetrip'
46
+ "
40
47
  :title="$dataStore.t('insuredForm')"
41
48
  >
42
49
  <div v-for="(insured, index) of formStore.insuredForm" :key="index">
@@ -1080,7 +1080,6 @@ export class DataStoreClass {
1080
1080
  fontSize: number;
1081
1081
  isFontChangerOpen: boolean = false;
1082
1082
  isLoading: boolean = false;
1083
- user: User;
1084
1083
  accessToken: string | null = null;
1085
1084
  refreshToken: string | null = null;
1086
1085
  processIndexRate: Value[];
@@ -1264,7 +1263,6 @@ export class DataStoreClass {
1264
1263
  this.fontSize = 14;
1265
1264
  this.isFontChangerOpen = false;
1266
1265
  this.isLoading = false;
1267
- this.user = new User();
1268
1266
  this.accessToken = null;
1269
1267
  this.refreshToken = null;
1270
1268
  this.taskList = [];
@@ -3,8 +3,9 @@ import { jwtDecode as jwt_decode } from 'jwt-decode';
3
3
  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
- import { PolicyholderClass, Value } from '../composables/classes';
6
+ import { PolicyholderClass, Value, User } from '../composables/classes';
7
7
  import type { EnvModes, NestedKeyOf, ResponseStructure, Utils } from '../types';
8
+ import { Roles, Statuses } from '../types/enum';
8
9
 
9
10
  export const useEnv = () => {
10
11
  return {
@@ -151,6 +152,12 @@ export const formatProcents = (val: string | number) => (val ? Number(((val as n
151
152
 
152
153
  export const sanitizeURL = (text: string) => (text ? text.replace(/\r?\n|\r|\\|"/g, '') : '');
153
154
 
155
+ export const sanitize = (text: string) =>
156
+ String(text)
157
+ .replace(/\r?\n|\r/g, '')
158
+ .replace(/\\/g, '')
159
+ .replace(/"/g, '');
160
+
154
161
  export const yearEnding = (number: number, titles: string[], cases: number[]) => {
155
162
  return titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[number % 10 < 5 ? number % 10 : 5]];
156
163
  };
@@ -628,3 +635,190 @@ export const isEveryFormDisabled = (isDisabledForm: any) => {
628
635
  };
629
636
 
630
637
  export class ApiError extends AxiosError<any, any> {}
638
+
639
+ export class ProcessController {
640
+ isProcessEditable = (statusCode?: keyof typeof Statuses) => {
641
+ const getEditibleStatuses = () => {
642
+ const defaultStatuses = constants.editableStatuses;
643
+ return defaultStatuses;
644
+ };
645
+ return !!getEditibleStatuses().find(status => status === statusCode);
646
+ };
647
+ isProcessReturnable = (statusCode?: keyof typeof Statuses) => {
648
+ const getReturnableStatuses = () => {
649
+ const defaultStatuses = constants.returnStatementStatuses;
650
+ return defaultStatuses;
651
+ };
652
+ return !!getReturnableStatuses().find(status => status === statusCode);
653
+ };
654
+ isProcessCancel = (statusCode?: keyof typeof Statuses) => {
655
+ const getCanceleStatuses = () => {
656
+ const defaultStatuses = constants.cancelApplicationStatuses;
657
+ return defaultStatuses;
658
+ };
659
+ return !!getCanceleStatuses().find(status => status === statusCode);
660
+ };
661
+ isProcessReject = (statusCode?: keyof typeof Statuses) => {
662
+ const getRejectStatuses = () => {
663
+ const defaultStatuses = constants.rejectApplicationStatuses;
664
+ return defaultStatuses;
665
+ };
666
+ return !!getRejectStatuses().find(status => status === statusCode);
667
+ };
668
+ }
669
+
670
+ export class RoleController {
671
+ user: User = new User();
672
+
673
+ isRole = (whichRole: keyof typeof Roles) => {
674
+ if (this.user.roles.length === 0) {
675
+ const token = localStorage.getItem('accessToken') || null;
676
+ if (token) {
677
+ const decoded = jwtDecode(token);
678
+ if (decoded) {
679
+ this.user.id = String(decoded.sub);
680
+ this.user.fullName = `${decoded.lastName} ${decoded.firstName} ${decoded.middleName ?? ''}`;
681
+ this.user.code = decoded.code;
682
+ this.user.branchCode = decoded.branchCode;
683
+ const key = getKeyWithPattern(decoded, 'role');
684
+ if (key) {
685
+ const roles = decoded[key as keyof Utils.JwtToken];
686
+ if (typeof roles === 'string') {
687
+ this.user.roles.push(roles);
688
+ } else if (typeof roles === 'object') {
689
+ this.user.roles = roles;
690
+ }
691
+ }
692
+ }
693
+ }
694
+ }
695
+ return !!this.user.roles.find(i => i === whichRole);
696
+ };
697
+ isInitiator = () => {
698
+ return this.isManager() || this.isAgent() || this.isAgentMycar() || this.isManagerHalykBank() || this.isServiceManager() || this.isAgentAuletti();
699
+ };
700
+ isManager = () => {
701
+ return this.isRole(constants.roles.Manager);
702
+ };
703
+ isCompliance = () => {
704
+ return this.isRole(constants.roles.Compliance);
705
+ };
706
+ isAdmin = () => {
707
+ return this.isRole(constants.roles.Admin);
708
+ };
709
+ isJurist = () => {
710
+ return this.isRole(constants.roles.Jurist);
711
+ };
712
+ isAgent = () => {
713
+ return this.isRole(constants.roles.Agent);
714
+ };
715
+ isManagerHalykBank = () => {
716
+ return this.isRole(constants.roles.ManagerHalykBank);
717
+ };
718
+ isServiceManager = () => {
719
+ return this.isRole(constants.roles.ServiceManager);
720
+ };
721
+ isUnderwriter = () => {
722
+ return this.isRole(constants.roles.Underwriter);
723
+ };
724
+ isActuary = () => {
725
+ return this.isRole(constants.roles.Actuary);
726
+ };
727
+ isAgentMycar = () => {
728
+ return this.isRole(constants.roles.AgentMycar);
729
+ };
730
+ isAgentAuletti = () => {
731
+ return this.isRole(constants.roles.AgentAuletti);
732
+ };
733
+ isManagerAuletti = () => {
734
+ return this.isRole(constants.roles.ManagerAuletti);
735
+ };
736
+ isAnalyst = () => {
737
+ return this.isRole(constants.roles.Analyst);
738
+ };
739
+ isUpk = () => {
740
+ return this.isRole(constants.roles.UPK);
741
+ };
742
+ isUrp = () => {
743
+ return this.isRole(constants.roles.URP);
744
+ };
745
+ isUsns = () => {
746
+ return this.isRole(constants.roles.USNS);
747
+ };
748
+ isAccountant = () => {
749
+ return this.isRole(constants.roles.Accountant);
750
+ };
751
+ isDrn = () => {
752
+ return this.isRole(constants.roles.DRNSJ);
753
+ };
754
+ isSupport = () => {
755
+ return this.isRole(constants.roles.Support);
756
+ };
757
+ isFinCenter = () => {
758
+ return this.isRole(constants.roles.FinCenter);
759
+ };
760
+ isSupervisor = () => {
761
+ return this.isRole(constants.roles.Supervisor);
762
+ };
763
+ isHeadManager = () => {
764
+ return this.isRole(constants.roles.HeadManager);
765
+ };
766
+ isBranchDirector = () => {
767
+ return this.isRole(constants.roles.BranchDirector);
768
+ };
769
+ isUSNSACCINS = () => {
770
+ return this.isRole(constants.roles.USNSACCINS);
771
+ };
772
+ isDsuio = () => {
773
+ return this.isRole(constants.roles.Dsuio);
774
+ };
775
+ isAdjuster = () => {
776
+ return this.isRole(constants.roles.SettlementLosses);
777
+ };
778
+ isHeadAdjuster = () => {
779
+ return this.isRole(constants.roles.HeadSettlementLosses);
780
+ };
781
+ isDsoDirector = () => {
782
+ return this.isRole(constants.roles.DsoDirector);
783
+ };
784
+ isAccountantDirector = () => {
785
+ return this.isRole(constants.roles.AccountantDirector);
786
+ };
787
+ hasAccess = () => {
788
+ const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn();
789
+ return {
790
+ invoiceInfo: this.isAdmin(),
791
+ toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
792
+ toAML: this.isCompliance() || baseAccessRoles,
793
+ toAULETTI: this.isAgentAuletti() || this.isManagerAuletti() || baseAccessRoles,
794
+ toLKA_A: this.isAgentAuletti() || baseAccessRoles,
795
+ toEFO:
796
+ this.isManager() ||
797
+ this.isAgent() ||
798
+ this.isAgentMycar() ||
799
+ this.isManagerHalykBank() ||
800
+ this.isHeadManager() ||
801
+ this.isServiceManager() ||
802
+ this.isUnderwriter() ||
803
+ this.isActuary() ||
804
+ this.isAdmin() ||
805
+ this.isCompliance() ||
806
+ this.isAnalyst() ||
807
+ this.isUpk() ||
808
+ this.isFinCenter() ||
809
+ this.isSupervisor() ||
810
+ this.isSupport() ||
811
+ this.isDrn() ||
812
+ this.isUrp() ||
813
+ this.isUsns() ||
814
+ this.isAccountant() ||
815
+ this.isBranchDirector() ||
816
+ this.isUSNSACCINS() ||
817
+ this.isDsuio() ||
818
+ this.isAdjuster() ||
819
+ this.isDsoDirector() ||
820
+ this.isAccountantDirector() ||
821
+ this.isHeadAdjuster(),
822
+ };
823
+ };
824
+ }
package/configs/pwa.ts CHANGED
@@ -3,7 +3,7 @@ import type { ModuleOptions } from '@vite-pwa/nuxt';
3
3
  export const pwaBaseConfig: Partial<ModuleOptions> = {
4
4
  registerType: 'autoUpdate',
5
5
  workbox: {
6
- globPatterns: ['**/*.{js,css,html,txt,png,ico,svg}'],
6
+ globPatterns: ['**/*.{js,css,html,txt,png,ico,svg,json}'],
7
7
  navigateFallbackDenylist: [/^\/api\//],
8
8
  navigateFallback: '/',
9
9
  cleanupOutdatedCaches: true,
package/locales/ru.json CHANGED
@@ -141,7 +141,8 @@
141
141
  "requiredFieldsLB": "Обязательные поля: №, Ф.И.О, Пол, Должность, Дата рождения, ИИН, Страховая сумма",
142
142
  "duplicateClient": "В списке присутствуют повторяющиеся клиенты",
143
143
  "notParsedDocument": "Не удалось получить данные",
144
- "errorOsns": "По данному БИН на дату заключения заявления не найден договор ОСНС. Просим проверить БИН Страхователя."
144
+ "errorOsns": "По данному БИН на дату заключения заявления не найден договор ОСНС. Просим проверить БИН Страхователя.",
145
+ "needDigDoc": "Нужно получить цифровой документ {text}"
145
146
  },
146
147
  "notSignedContract": "Неподписанный Договор",
147
148
  "Contract": "Договор страхования",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.19",
3
+ "version": "0.0.10-beta.20",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -2,12 +2,12 @@ import { defineStore } from 'pinia';
2
2
  import { rules } from './rules';
3
3
  import { i18n } from '../configs/i18n';
4
4
  import { Toast, Types as ToastTypes, Positions, ToastOptions } from './toast';
5
- import { isValidGUID, yearEnding, jwtDecode, ErrorHandler, getKeyWithPattern, getNumber, getAgeByBirthDate } from '../composables';
5
+ import { isValidGUID, yearEnding, jwtDecode, ErrorHandler, getKeyWithPattern, getNumber, getAgeByBirthDate, RoleController, ProcessController, sanitize } from '../composables';
6
6
  import { DataStoreClass, DocumentItem, Member, Value, CountryValue, PolicyholderActivity, BeneficialOwner, PolicyholderClass } from '../composables/classes';
7
7
  import { ApiClass } from '../api';
8
8
  import { useFormStore } from './form.store';
9
9
  import { AxiosError } from 'axios';
10
- import { PostActions, StoreMembers, Roles, Statuses, MemberCodes, MemberAppCodes, CoreEnums } from '../types/enum';
10
+ import { PostActions, StoreMembers, MemberCodes, MemberAppCodes, CoreEnums } from '../types/enum';
11
11
  import type * as Types from '../types';
12
12
  //@ts-ignore
13
13
  import { NCALayerClient } from 'ncalayer-js-client';
@@ -15,11 +15,14 @@ import { NCALayerClient } from 'ncalayer-js-client';
15
15
  export const useDataStore = defineStore('data', {
16
16
  state: () => ({
17
17
  ...new DataStoreClass(),
18
+ ...new RoleController(),
19
+ ...new ProcessController(),
18
20
  t: i18n.t,
19
21
  rules: rules,
20
22
  toast: Toast,
21
23
  toastTypes: ToastTypes,
22
24
  toastPositions: Positions,
25
+ sanitize: sanitize,
23
26
  isValidGUID: isValidGUID,
24
27
  router: useRouter(),
25
28
  formStore: useFormStore(),
@@ -177,9 +180,6 @@ export const useDataStore = defineStore('data', {
177
180
  }
178
181
  }
179
182
  },
180
- getUserData() {
181
- return jwtDecode(this.accessToken);
182
- },
183
183
  async getUserGroups() {
184
184
  try {
185
185
  this.isLoading = true;
@@ -190,143 +190,17 @@ export const useDataStore = defineStore('data', {
190
190
  this.isLoading = false;
191
191
  }
192
192
  },
193
- isRole(whichRole: keyof typeof Roles) {
194
- if (this.user.roles.length === 0) {
195
- this.getUserRoles();
196
- }
197
- const isRole = this.user.roles.find(i => i === whichRole);
198
- return !!isRole;
199
- },
200
- isInitiator() {
201
- return this.isManager() || this.isAgent() || this.isAgentMycar() || this.isManagerHalykBank() || this.isServiceManager() || this.isAgentAuletti();
202
- },
203
- isManager() {
204
- return this.isRole(constants.roles.Manager);
205
- },
206
- isCompliance() {
207
- return this.isRole(constants.roles.Compliance);
208
- },
209
- isAdmin() {
210
- return this.isRole(constants.roles.Admin);
211
- },
212
- isJurist() {
213
- return this.isRole(constants.roles.Jurist);
214
- },
215
- isAgent() {
216
- return this.isRole(constants.roles.Agent);
217
- },
218
- isManagerHalykBank() {
219
- return this.isRole(constants.roles.ManagerHalykBank);
220
- },
221
- isServiceManager() {
222
- return this.isRole(constants.roles.ServiceManager);
223
- },
224
- isUnderwriter() {
225
- return this.isRole(constants.roles.Underwriter);
226
- },
227
- isActuary() {
228
- return this.isRole(constants.roles.Actuary);
229
- },
230
- isAgentMycar() {
231
- return this.isRole(constants.roles.AgentMycar);
232
- },
233
- isAgentAuletti() {
234
- return this.isRole(constants.roles.AgentAuletti);
235
- },
236
- isAnalyst() {
237
- return this.isRole(constants.roles.Analyst);
238
- },
239
- isUpk() {
240
- return this.isRole(constants.roles.UPK);
241
- },
242
- isUrp() {
243
- return this.isRole(constants.roles.URP);
244
- },
245
- isUsns() {
246
- return this.isRole(constants.roles.USNS);
247
- },
248
- isAccountant() {
249
- return this.isRole(constants.roles.Accountant);
250
- },
251
- isDrn() {
252
- return this.isRole(constants.roles.DRNSJ);
253
- },
254
- isSupport() {
255
- return this.isRole(constants.roles.Support);
256
- },
257
- isFinCenter() {
258
- return this.isRole(constants.roles.FinCenter);
259
- },
260
- isSupervisor() {
261
- return this.isRole(constants.roles.Supervisor);
262
- },
263
- isHeadManager() {
264
- return this.isRole(constants.roles.HeadManager);
265
- },
266
- isBranchDirector() {
267
- return this.isRole(constants.roles.BranchDirector);
268
- },
269
- isUSNSACCINS() {
270
- return this.isRole(constants.roles.USNSACCINS);
271
- },
272
- isDsuio() {
273
- return this.isRole(constants.roles.Dsuio);
274
- },
275
- isAdjuster() {
276
- return this.isRole(constants.roles.SettlementLosses);
277
- },
278
- isHeadAdjuster() {
279
- return this.isRole(constants.roles.HeadSettlementLosses);
280
- },
281
- isDsoDirector() {
282
- return this.isRole(constants.roles.DsoDirector);
283
- },
284
- isAccountantDirector() {
285
- return this.isRole(constants.roles.AccountantDirector);
286
- },
287
- isProcessEditable(statusCode?: keyof typeof Statuses) {
288
- const getEditibleStatuses = () => {
289
- const defaultStatuses = constants.editableStatuses;
290
- return defaultStatuses;
291
- };
292
- return !!getEditibleStatuses().find(status => status === statusCode);
293
- },
294
- isProcessReturnable(statusCode?: keyof typeof Statuses) {
295
- const getReturnableStatuses = () => {
296
- const defaultStatuses = constants.returnStatementStatuses;
297
- return defaultStatuses;
298
- };
299
- return !!getReturnableStatuses().find(status => status === statusCode);
300
- },
301
- isProcessCancel(statusCode?: keyof typeof Statuses) {
302
- const getCanceleStatuses = () => {
303
- const defaultStatuses = constants.cancelApplicationStatuses;
304
- return defaultStatuses;
305
- };
306
- return !!getCanceleStatuses().find(status => status === statusCode);
307
- },
308
- isProcessReject(statusCode?: keyof typeof Statuses) {
309
- const getRejectStatuses = () => {
310
- const defaultStatuses = constants.rejectApplicationStatuses;
311
- return defaultStatuses;
312
- };
313
- return !!getRejectStatuses().find(status => status === statusCode);
314
- },
315
193
  isTask() {
316
194
  return this.formStore.applicationData.processInstanceId !== 0 && this.formStore.applicationData.isTask;
317
195
  },
318
196
  validateAccess() {
319
- try {
320
- const hasAccess = this.hasAccess();
321
- if (this.isAML) return hasAccess.toAML;
322
- if (this.isLKA) return hasAccess.toLKA;
323
- if (this.isEFO) return hasAccess.toEFO;
324
- if (this.isAULETTI) return hasAccess.toAULETTI;
325
- if (this.isLKA_A) return hasAccess.toLKA_A;
326
- return false;
327
- } catch (err) {
328
- return ErrorHandler(err);
329
- }
197
+ const hasAccess = this.hasAccess();
198
+ if (this.isAML) return hasAccess.toAML;
199
+ if (this.isLKA) return hasAccess.toLKA;
200
+ if (this.isEFO) return hasAccess.toEFO;
201
+ if (this.isAULETTI) return hasAccess.toAULETTI;
202
+ if (this.isLKA_A) return hasAccess.toLKA_A;
203
+ return false;
330
204
  },
331
205
  async loginUser(login: string, password: string, numAttempt: number) {
332
206
  try {
@@ -652,7 +526,7 @@ export const useDataStore = defineStore('data', {
652
526
  if (qData && qData.from && qData.from.length && qData.field) {
653
527
  const qResult = qData.from.find((i: Value) => i.ids === searchIt.questAnswer);
654
528
  //@ts-ignore
655
- member[qData.field] = qResult ? qResult : new Value();
529
+ member[qData.field] = qResult ?? new Value();
656
530
  }
657
531
  },
658
532
  async alreadyInInsis(member: Member) {
@@ -1672,7 +1546,7 @@ export const useDataStore = defineStore('data', {
1672
1546
  column: column,
1673
1547
  direction: direction,
1674
1548
  groupCode: groupCode,
1675
- processCodes: Object.values(constants.products),
1549
+ processCodes: this.isEFO ? Object.values(constants.products) : [constants.products.baiterek],
1676
1550
  };
1677
1551
  if (byOneProcess !== null) {
1678
1552
  delete query.processCodes;
@@ -2860,12 +2734,6 @@ export const useDataStore = defineStore('data', {
2860
2734
  this.isLoading = false;
2861
2735
  }
2862
2736
  },
2863
- sanitize(text: string) {
2864
- return text
2865
- .replace(/\r?\n|\r/g, '')
2866
- .replace(/\\/g, '')
2867
- .replace(/"/g, '');
2868
- },
2869
2737
  async getSignedDocList(processInstanceId: string | number) {
2870
2738
  if (processInstanceId !== 0) {
2871
2739
  try {
@@ -2954,6 +2822,9 @@ export const useDataStore = defineStore('data', {
2954
2822
  return true;
2955
2823
  },
2956
2824
  async validateAllMembers(taskId: string, localCheck: boolean = false) {
2825
+ const policyholderDoc = this.formStore.signedDocumentList.find(
2826
+ i => i.iin === String(this.formStore.policyholderForm.iin).replaceAll('-', '') && (i.fileTypeCode === '1' || i.fileTypeCode === '2'),
2827
+ );
2957
2828
  if (taskId === '0') {
2958
2829
  this.showToaster('error', this.t('toaster.needToRunStatement'), 2000);
2959
2830
  return false;
@@ -2962,6 +2833,10 @@ export const useDataStore = defineStore('data', {
2962
2833
  this.showToaster('error', this.t('toaster.notSavedMember', { text: 'страхователя' }), 3000);
2963
2834
  return false;
2964
2835
  }
2836
+ if (this.isInitiator() && this.isEfoParent && this.formStore.policyholderForm.iin && !policyholderDoc) {
2837
+ this.showToaster('error', this.t('toaster.needDigDoc', { text: 'страхователя' }));
2838
+ return false;
2839
+ }
2965
2840
  if (this.members.insuredApp.has) {
2966
2841
  if (this.validateMultipleMembers(this.formStore.insuredFormKey, 'insuredApp', 'застрахованных') === false) {
2967
2842
  return false;
@@ -3817,12 +3692,10 @@ export const useDataStore = defineStore('data', {
3817
3692
  async onlineAccess(iin: string, documentType: string) {
3818
3693
  try {
3819
3694
  const data = {
3820
- userName: this.user.code,
3821
- branchName: this.user.branchCode,
3822
- iin: iin.replaceAll('-', ''),
3695
+ iinBin: iin.replaceAll('-', ''),
3823
3696
  documentType: documentType,
3824
3697
  };
3825
- await this.api.integration.onlineAccess(data);
3698
+ await this.api.externalServices.onlineAccess(data);
3826
3699
  return true;
3827
3700
  } catch (err) {
3828
3701
  ErrorHandler(err);
@@ -3832,13 +3705,11 @@ export const useDataStore = defineStore('data', {
3832
3705
  async digitalDocuments(iin: string, processInstanceId: string, code: string) {
3833
3706
  try {
3834
3707
  const data = {
3835
- userName: this.user.code,
3836
- branchName: this.user.branchCode,
3837
3708
  iin: iin.replaceAll('-', ''),
3838
3709
  processInstanceId: processInstanceId,
3839
3710
  code: code.replace(/\s/g, ''),
3840
3711
  };
3841
- await this.api.integration.digitalDocuments(data);
3712
+ await this.api.externalServices.digitalDocuments(data);
3842
3713
  return true;
3843
3714
  } catch (err) {
3844
3715
  ErrorHandler(err);
@@ -3914,18 +3785,6 @@ export const useDataStore = defineStore('data', {
3914
3785
  return true;
3915
3786
  }
3916
3787
  },
3917
- hasPlaceSection(whichForm: keyof typeof StoreMembers) {
3918
- switch (whichForm) {
3919
- default:
3920
- return true;
3921
- }
3922
- },
3923
- hasDocumentSection(whichForm: keyof typeof StoreMembers) {
3924
- switch (whichForm) {
3925
- default:
3926
- return true;
3927
- }
3928
- },
3929
3788
  hasContactSection(whichForm: keyof typeof StoreMembers) {
3930
3789
  if (this.isGons || this.isPension) return false;
3931
3790
  switch (whichForm) {
@@ -3962,45 +3821,5 @@ export const useDataStore = defineStore('data', {
3962
3821
  return false;
3963
3822
  }
3964
3823
  },
3965
- hasPercentageOfPayoutAmount() {
3966
- return true;
3967
- },
3968
- hasAccess() {
3969
- const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn();
3970
- return {
3971
- invoiceInfo: this.isAdmin(),
3972
- toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
3973
- toAML: this.isCompliance() || baseAccessRoles,
3974
- toAULETTI: this.isAgentAuletti() || baseAccessRoles,
3975
- toLKA_A: this.isAgentAuletti() || baseAccessRoles,
3976
- toEFO:
3977
- this.isManager() ||
3978
- this.isAgent() ||
3979
- this.isAgentMycar() ||
3980
- this.isManagerHalykBank() ||
3981
- this.isHeadManager() ||
3982
- this.isServiceManager() ||
3983
- this.isUnderwriter() ||
3984
- this.isActuary() ||
3985
- this.isAdmin() ||
3986
- this.isCompliance() ||
3987
- this.isAnalyst() ||
3988
- this.isUpk() ||
3989
- this.isFinCenter() ||
3990
- this.isSupervisor() ||
3991
- this.isSupport() ||
3992
- this.isDrn() ||
3993
- this.isUrp() ||
3994
- this.isUsns() ||
3995
- this.isAccountant() ||
3996
- this.isBranchDirector() ||
3997
- this.isUSNSACCINS() ||
3998
- this.isDsuio() ||
3999
- this.isAdjuster() ||
4000
- this.isDsoDirector() ||
4001
- this.isAccountantDirector() ||
4002
- this.isHeadAdjuster(),
4003
- };
4004
- },
4005
3824
  },
4006
3825
  });
package/types/enum.ts CHANGED
@@ -99,6 +99,7 @@ export enum Roles {
99
99
  HeadSettlementLosses = 'HeadSettlementLosses',
100
100
  DsoDirector = 'DsoDirector',
101
101
  AccountantDirector = 'AccountantDirector',
102
+ ManagerAuletti = 'ManagerAuletti',
102
103
  }
103
104
 
104
105
  export enum Statuses {