hl-core 0.0.10-beta.24 → 0.0.10-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
@@ -984,10 +984,10 @@ export class ApiClass {
984
984
  url: `${this.pensionannuityNew.base}/GetEnpfRedirectUrl?id=${id}`,
985
985
  });
986
986
  },
987
- setEnpfSharedId: async (sharedId: string, infoId: string) => {
987
+ setEnpfSharedId: async (sharedId: string, infoId: string, isProd: boolean) => {
988
988
  return await this.axiosCall<void>({
989
989
  method: Methods.POST,
990
- baseURL: getStrValuePerEnv('efoBaseApi'),
990
+ baseURL: isProd === false ? getStrValuePerEnv('efoBaseApi').replace('kz/efo', 'kz/test/efo') : getStrValuePerEnv('efoBaseApi'),
991
991
  url: `${this.pensionannuityNew.base}/SetEnpfSharedId/${sharedId}/${infoId}`,
992
992
  });
993
993
  },
@@ -995,14 +995,14 @@ export class ApiClass {
995
995
 
996
996
  externalServices = {
997
997
  base: '/externalservices',
998
- onlineAccess: async (data: { iinBin: string; documentType: string }) => {
999
- return await this.axiosCall<void>({
998
+ getOnlineAccess: async (data: { iinBin: string; documentType: string }) => {
999
+ return await this.axiosCall<{ code: string; message: string }>({
1000
1000
  method: Methods.POST,
1001
1001
  url: `${this.externalServices.base}/api/ExternalServices/GetOnlineAccess`,
1002
1002
  data: data,
1003
1003
  });
1004
1004
  },
1005
- digitalDocuments: async (data: { iin: string; processInstanceId: string; code: string }) => {
1005
+ getDigitalDocuments: async (data: { iin: string; processInstanceId: string; code: string }) => {
1006
1006
  return await this.axiosCall<void>({
1007
1007
  method: Methods.POST,
1008
1008
  url: `${this.externalServices.base}/api/ExternalServices/DigitalDocuments`,
@@ -202,8 +202,8 @@ import type { Base, FileActions } from '../../types';
202
202
 
203
203
  export default defineComponent({
204
204
  setup() {
205
- type DigitalDocNames = 'Удостоверение личности' | 'Паспорт';
206
- type DigitalDocTypes = 'IdentityCard' | 'Passport';
205
+ type DigitalDocNames = 'Удостоверение личности' | 'Паспорт' | 'Вид на жительство иностранного гражданина';
206
+ type DigitalDocTypes = 'IdentityCard' | 'Passport' | 'Vnzh';
207
207
 
208
208
  const route = useRoute();
209
209
  const dataStore = useDataStore();
@@ -224,10 +224,11 @@ export default defineComponent({
224
224
  const documentType = ref<DigitalDocNames | null>(null);
225
225
  const otpCode = ref<string>('');
226
226
  const currentIin = ref<string>('');
227
- const deleteFilesId = ['1', '2', '46'];
227
+ const deleteFilesId = ['1', '2', '4', '46'];
228
228
  const documentItems: Array<{ title: DigitalDocNames; value: DigitalDocTypes }> = [
229
229
  { title: 'Удостоверение личности', value: 'IdentityCard' },
230
230
  { title: 'Паспорт', value: 'Passport' },
231
+ { title: 'Вид на жительство иностранного гражданина', value: 'Vnzh' },
231
232
  ];
232
233
  const signedContract = reactive<{
233
234
  processInstanceId: string | number;
@@ -293,7 +294,7 @@ export default defineComponent({
293
294
  const policyholderForm = computed(() => formStore.policyholderForm as Base.Document.Digital);
294
295
  const insuredFiltered = computed(() => formStore.insuredForm.filter(i => i.iin !== formStore.policyholderForm.iin) as Base.Document.Digital[]);
295
296
  const beneficiaryFiltered = computed(() => formStore.beneficiaryForm.filter(i => i.iin !== formStore.policyholderForm.iin) as Base.Document.Digital[]);
296
- const documentListFiltered = computed(() => formStore.signedDocumentList.filter(i => !['1', '2'].includes(String(i.fileTypeCode))));
297
+ const documentListFiltered = computed(() => formStore.signedDocumentList.filter(i => !['1', '2', '4'].includes(String(i.fileTypeCode))));
297
298
 
298
299
  const openPanel = async (document: DocumentItem) => {
299
300
  dataStore.rightPanel.title = document.fileTypeName!;
@@ -414,7 +415,7 @@ export default defineComponent({
414
415
  dataStore.rightPanel.open = false;
415
416
  dataStore.panelAction = null;
416
417
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
417
- if (hasDigitalDocuments.value && (currentDocument.value.fileTypeCode === '1' || currentDocument.value.fileTypeCode === '2')) {
418
+ if (hasDigitalDocuments.value && (currentDocument.value.fileTypeCode === '1' || currentDocument.value.fileTypeCode === '2' || currentDocument.value.fileTypeCode === '4')) {
418
419
  getDigitalDocs();
419
420
  }
420
421
  }
@@ -426,7 +427,7 @@ export default defineComponent({
426
427
  return;
427
428
  }
428
429
  documentLoading.value = true;
429
- const response = await dataStore.onlineAccess(currentIin.value, String(documentType.value));
430
+ const response = await dataStore.getOnlineAccess(currentIin.value, String(documentType.value));
430
431
  if (response) {
431
432
  dataStore.showToaster('success', dataStore.t('toaster.successOtp'), 3000);
432
433
  }
@@ -434,12 +435,16 @@ export default defineComponent({
434
435
  };
435
436
 
436
437
  const getDigitalDocument = async () => {
438
+ if (!documentType.value) {
439
+ dataStore.showToaster('error', 'Выберите тип документа', 3000);
440
+ return;
441
+ }
437
442
  if (!otpCode.value) {
438
443
  dataStore.showToaster('error', 'Введите код подтверждения', 3000);
439
444
  return;
440
445
  }
441
446
  documentLoading.value = true;
442
- const response = await dataStore.digitalDocuments(currentIin.value, String(formStore.applicationData.processInstanceId), otpCode.value);
447
+ const response = await dataStore.getDigitalDocuments(currentIin.value, String(formStore.applicationData.processInstanceId), otpCode.value);
443
448
  if (response) {
444
449
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
445
450
  getDigitalDocs();
@@ -455,7 +460,9 @@ export default defineComponent({
455
460
  const findCommonDocs = (members: Base.Document.Digital[]) => {
456
461
  let commonDocs: IDocument[] = [];
457
462
  for (let member of members) {
458
- const matchingDoc = formStore.signedDocumentList.find(doc => doc.iin === String(member.iin).replaceAll('-', '') && (doc.fileTypeCode === '1' || doc.fileTypeCode === '2'));
463
+ const matchingDoc = formStore.signedDocumentList.find(
464
+ doc => doc.iin === String(member.iin).replaceAll('-', '') && (doc.fileTypeCode === '1' || doc.fileTypeCode === '2' || doc.fileTypeCode === '4'),
465
+ );
459
466
  if (matchingDoc) commonDocs.push(matchingDoc);
460
467
  }
461
468
  return commonDocs;
@@ -1003,7 +1003,7 @@ export default {
1003
1003
  (whichForm.value === formStore.beneficiaryFormKey && member.value.iin !== formStore.policyholderForm.iin) ||
1004
1004
  (dataStore.isLifetrip && whichForm.value === formStore.insuredFormKey && member.value.isInsuredUnderage),
1005
1005
  );
1006
- const hasWorkPositionDict = dataStore.isBaiterek && dataStore.isEfoParent;
1006
+ const hasWorkPositionDict = dataStore.isBaiterek;
1007
1007
 
1008
1008
  const birthDateRule = computed(() => {
1009
1009
  const baseDateRule = dataStore.rules.required.concat(dataStore.rules.birthDate);
@@ -1474,7 +1474,7 @@ export default defineComponent({
1474
1474
  };
1475
1475
 
1476
1476
  const filterTermConditions = (term: AddCover) => {
1477
- if (term.coverTypeCode === 10) {
1477
+ if (term.coverTypeCode === 10 && !props.isCalculator) {
1478
1478
  return !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
1479
1479
  }
1480
1480
  return true;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <label v-if="chip && chip.title" class="transition-all leading-6 px-3 py-1 rounded-pill border-[1px] border-white mr-4 whitespace-nowrap" :class="[textSize, color]"
2
+ <label v-if="chip && chip.title" class="transition-all leading-6 px-3 rounded-pill border-[1px] border-white mr-4 whitespace-nowrap" :class="[textSize, color]"
3
3
  >{{ chip.title }}<v-tooltip v-if="chip.description" activator="parent" location="bottom" :max-width="maxWidth">{{ chip.description }}</v-tooltip></label
4
4
  >
5
5
  </template>
package/locales/ru.json CHANGED
@@ -143,7 +143,8 @@
143
143
  "duplicateClient": "В списке присутствуют повторяющиеся клиенты",
144
144
  "notParsedDocument": "Не удалось получить данные",
145
145
  "errorOsns": "По данному БИН на дату заключения заявления не найден договор ОСНС. Просим проверить БИН Страхователя.",
146
- "needDigDoc": "Нужно получить цифровой документ {text}"
146
+ "needDigDoc": "Нужно получить цифровой документ {text}",
147
+ "notDigDoc": "Выданный документ не найден"
147
148
  },
148
149
  "notSignedContract": "Неподписанный Договор",
149
150
  "Contract": "Договор страхования",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.24",
3
+ "version": "0.0.10-beta.26",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -2515,7 +2515,7 @@ export const useDataStore = defineStore('data', {
2515
2515
  ErrorHandler(err);
2516
2516
  }
2517
2517
  },
2518
- async nclayerSign(groupId: string, signType: number, isXml: boolean = false) {
2518
+ async nclayerSign(groupId: string, signType: number, isXml: boolean = false, processInstanceId?: string) {
2519
2519
  try {
2520
2520
  const ncaLayerClient = new NCALayerClient();
2521
2521
  await ncaLayerClient.connect();
@@ -2525,7 +2525,7 @@ export const useDataStore = defineStore('data', {
2525
2525
  if (isXml) {
2526
2526
  const signedAgreement = await ncaLayerClient.signXml(storageType, document, 'SIGNATURE', '');
2527
2527
  const data = new FormData();
2528
- data.append('processInstanceId', String(this.formStore.applicationData.processInstanceId));
2528
+ data.append('processInstanceId', processInstanceId ?? String(this.formStore.applicationData.processInstanceId));
2529
2529
  data.append('xmlData', signedAgreement);
2530
2530
  data.append('name', 'PAEnpf_Agreement');
2531
2531
  data.append('format', 'xml');
@@ -2841,7 +2841,7 @@ export const useDataStore = defineStore('data', {
2841
2841
  this.showToaster('error', this.t('toaster.notSavedMember', { text: 'страхователя' }), 3000);
2842
2842
  return false;
2843
2843
  }
2844
- if (this.isInitiator() && this.isEfoParent && this.formStore.policyholderForm.iin && !policyholderDoc) {
2844
+ if (useEnv().isProduction && this.isInitiator() && this.isEfoParent && this.formStore.policyholderForm.iin && !policyholderDoc) {
2845
2845
  this.showToaster('error', this.t('toaster.needDigDoc', { text: 'страхователя' }));
2846
2846
  return false;
2847
2847
  }
@@ -3697,27 +3697,32 @@ export const useDataStore = defineStore('data', {
3697
3697
 
3698
3698
  return true;
3699
3699
  },
3700
- async onlineAccess(iin: string, documentType: string) {
3700
+ async getOnlineAccess(iin: string, documentType: string) {
3701
3701
  try {
3702
3702
  const data = {
3703
3703
  iinBin: iin.replaceAll('-', ''),
3704
3704
  documentType: documentType,
3705
3705
  };
3706
- await this.api.externalServices.onlineAccess(data);
3707
- return true;
3706
+ const response = await this.api.externalServices.getOnlineAccess(data);
3707
+ if (response.code === 'PROFILE_DIGIDOCS_INTERNAL_ERROR') {
3708
+ this.showToaster('error', this.t('toaster.notDigDoc'), 3000);
3709
+ return false;
3710
+ } else {
3711
+ return true;
3712
+ }
3708
3713
  } catch (err) {
3709
3714
  ErrorHandler(err);
3710
3715
  return null;
3711
3716
  }
3712
3717
  },
3713
- async digitalDocuments(iin: string, processInstanceId: string, code: string) {
3718
+ async getDigitalDocuments(iin: string, processInstanceId: string, code: string) {
3714
3719
  try {
3715
3720
  const data = {
3716
3721
  iin: iin.replaceAll('-', ''),
3717
3722
  processInstanceId: processInstanceId,
3718
3723
  code: code.replace(/\s/g, ''),
3719
3724
  };
3720
- await this.api.externalServices.digitalDocuments(data);
3725
+ await this.api.externalServices.getDigitalDocuments(data);
3721
3726
  return true;
3722
3727
  } catch (err) {
3723
3728
  ErrorHandler(err);