hl-core 0.0.9-beta.34 → 0.0.9-beta.35

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
@@ -690,14 +690,14 @@ export class ApiClass {
690
690
  }
691
691
 
692
692
  async getTripInsuredAmount(data: getTripInsuredAmountRequest) {
693
- return this.axiosCall<TripInsuranceAmount>({
693
+ return await this.axiosCall<TripInsuranceAmount>({
694
694
  method: Methods.POST,
695
695
  url: `/${this.productUrl}/api/Application/InsuranceAmountOptions`,
696
696
  data: data,
697
697
  });
698
698
  }
699
699
  async downloadTemplate(fileType: number) {
700
- return this.axiosCall({
700
+ return await this.axiosCall({
701
701
  method: Methods.GET,
702
702
  url: `/${this.productUrl}/api/Application/DownloadTemplate?fileType=${fileType}`,
703
703
  responseType: 'arraybuffer',
@@ -705,7 +705,7 @@ export class ApiClass {
705
705
  }
706
706
 
707
707
  async sendTemplateToEmail(email: string) {
708
- return this.axiosCall({
708
+ return await this.axiosCall({
709
709
  method: Methods.GET,
710
710
  url: `/${this.productUrl}/api/Application/SendTemplateToEmail?emailTo=${email}`,
711
711
  });
@@ -782,8 +782,8 @@ export class ApiClass {
782
782
  });
783
783
  }
784
784
 
785
- async getClientData(clientId: string) {
786
- return this.axiosCall({
785
+ async getClientData<T>(clientId: string) {
786
+ return await this.axiosCall<T>({
787
787
  method: Methods.GET,
788
788
  url: `/${this.productUrl}/api/Application/GetClientData`,
789
789
  params: {
@@ -792,18 +792,18 @@ export class ApiClass {
792
792
  });
793
793
  }
794
794
 
795
- async getInsuredData(insuredId: string) {
796
- return this.axiosCall({
795
+ async getInsuredData<T>(insuredId: string) {
796
+ return await this.axiosCall<T>({
797
797
  method: Methods.GET,
798
- url: `/${this.productUrl}/api/Application/GetClientData`,
798
+ url: `/${this.productUrl}/api/Application/GetInsuredData`,
799
799
  params: {
800
800
  insuredId,
801
801
  },
802
802
  });
803
803
  }
804
804
 
805
- async getBeneficiaryData(beneficiaryId: string) {
806
- return this.axiosCall({
805
+ async getBeneficiaryData<T>(beneficiaryId: string) {
806
+ return await this.axiosCall<T>({
807
807
  method: Methods.GET,
808
808
  url: `/${this.productUrl}/api/Application/GetBeneficiaryData`,
809
809
  params: {
@@ -812,47 +812,51 @@ export class ApiClass {
812
812
  });
813
813
  }
814
814
 
815
- async saveClientData(clientId: string) {
816
- return this.axiosCall({
815
+ async saveClientData<T>(clientId: string, data: T) {
816
+ return await this.axiosCall({
817
817
  method: Methods.POST,
818
818
  url: `/${this.productUrl}/api/Application/SaveClient`,
819
819
  params: {
820
820
  clientId,
821
821
  },
822
+ data: data,
822
823
  });
823
824
  }
824
825
 
825
- async saveInsuredData(processInstanceId: string, insuredId: string) {
826
- return this.axiosCall({
826
+ async saveInsuredData<T>(processInstanceId: string, insuredId: string, data: T) {
827
+ return await this.axiosCall({
827
828
  method: Methods.POST,
828
829
  url: `/${this.productUrl}/api/Application/SaveInsured`,
829
830
  params: {
830
831
  processInstanceId,
831
832
  insuredId,
832
833
  },
834
+ data: data,
833
835
  });
834
836
  }
835
837
 
836
- async saveBeneficiaryData(processInstanceId: string, benificiaryId: string) {
837
- return this.axiosCall({
838
+ async saveBeneficiaryData<T>(processInstanceId: string, benificiaryId: string, data: T) {
839
+ return await this.axiosCall({
838
840
  method: Methods.POST,
839
841
  url: `/${this.productUrl}/api/Application/SaveBenificiary`,
840
842
  params: {
841
843
  processInstanceId,
842
844
  benificiaryId,
843
845
  },
846
+ data: data,
844
847
  });
845
848
  }
846
849
 
847
- async setApplicationData() {
848
- return this.axiosCall({
850
+ async setApplicationData(data: SetApplicationRequest) {
851
+ return await this.axiosCall({
849
852
  method: Methods.POST,
850
853
  url: `/${this.productUrl}/api/Application/SetApplicationData`,
854
+ data: data,
851
855
  });
852
856
  }
853
857
 
854
858
  async calculate(processInstanceId: string) {
855
- return this.axiosCall({
859
+ return await this.axiosCall({
856
860
  method: Methods.POST,
857
861
  url: `/${this.productUrl}/api/Application/Calculator`,
858
862
  params: {
@@ -12,7 +12,7 @@
12
12
  v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
13
13
  :key="index"
14
14
  :text="(item.nameRu as string)"
15
- :selected="item.nameRu === panelValue.nameRu"
15
+ :selected="item.nameRu === panelValue"
16
16
  @click="pickPanelValue(item)"
17
17
  />
18
18
  </div>
@@ -35,7 +35,7 @@ export default defineComponent({
35
35
  setup() {
36
36
  const dataStore = useDataStore();
37
37
  const isPanelOpen = ref<boolean>(false);
38
- const panelValue = ref<Value>(new Value());
38
+ const panelValue = ref<any>(new Value());
39
39
  const panelList = ref<Value[]>([]);
40
40
  const isPanelLoading = ref<boolean>(false);
41
41
  const searchQuery = ref<string>('');
@@ -80,6 +80,7 @@ export default defineComponent({
80
80
  isPanelOpen.value = true;
81
81
  dataStore.rightPanel.open = true;
82
82
  dataStore.rightPanel.title = dataStore.t(listOfPanelTitles[field.fetchFrom]);
83
+ panelValue.value = field.modelValue;
83
84
  panelList.value = (await dataStore[field.fetchFrom]()) as Value[];
84
85
  isPanelLoading.value = false;
85
86
  }
@@ -375,6 +375,10 @@ export default defineComponent({
375
375
  await onInit();
376
376
  });
377
377
 
378
+ onUnmounted(() => {
379
+ dataStore.abortRequests();
380
+ });
381
+
378
382
  watch(
379
383
  () => dataStore.rightPanel.open,
380
384
  () => {
@@ -457,10 +457,10 @@
457
457
  :value="term.coverSumName"
458
458
  :readonly="isTermsDisabled"
459
459
  :clearable="false"
460
- :label="term.coverTypeName"
460
+ :label="coverTypeName(term)"
461
461
  append-inner-icon="mdi mdi-chevron-right"
462
462
  :suffix="!!term.amount ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}` : ''"
463
- @append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
463
+ @append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
464
464
  />
465
465
  </div>
466
466
  </base-form-section>
@@ -1198,6 +1198,14 @@ export default defineComponent({
1198
1198
  }
1199
1199
  return true;
1200
1200
  };
1201
+
1202
+ const coverTypeName = (term: AddCover) => {
1203
+ if (whichProduct.value === 'lifebusiness') {
1204
+ return String(term.coverTypeNameRu);
1205
+ }
1206
+ return term.coverTypeName;
1207
+ };
1208
+
1201
1209
  const submitForm = async () => {
1202
1210
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
1203
1211
  if (v.valid) {
@@ -1557,6 +1565,7 @@ export default defineComponent({
1557
1565
  pickfixInsValue,
1558
1566
  openFixInsPanel,
1559
1567
  pickCoverPeriodValue,
1568
+ coverTypeName,
1560
1569
  };
1561
1570
  },
1562
1571
  });
@@ -4,6 +4,7 @@ import interceptors from '../api/interceptors';
4
4
  export const useAxiosInstance = (baseURL: string) => {
5
5
  const axiosInstance = axios.create({
6
6
  baseURL: baseURL,
7
+ signal: useDataStore().rController.signal,
7
8
  });
8
9
  interceptors(axiosInstance);
9
10
 
@@ -18,7 +18,7 @@ export const constants = Object.freeze({
18
18
  checkcontract: 2,
19
19
  },
20
20
  extractedProducts: ['dso', 'uu'],
21
- editableStatuses: [Statuses.StartForm, Statuses.EditBeneficiaryForm, Statuses.EditForm],
21
+ editableStatuses: [Statuses.StartForm, Statuses.EditBeneficiaryForm, Statuses.EditForm, Statuses.InputDataForm],
22
22
  documentsLinkVisibleStatuses: [
23
23
  Statuses.DocumentsSignedFrom,
24
24
  Statuses.UnderwriterForm,
@@ -26,13 +26,22 @@ export const constants = Object.freeze({
26
26
  Statuses.Completed,
27
27
  Statuses.InsurancePremiumOnlinePaid,
28
28
  ],
29
- returnStatementStatuses: [Statuses.DocumentsSignedFrom, Statuses.ContractSignedFrom, Statuses.WaitingInsurancePremiumForm, Statuses.UnderwriterForm],
29
+ returnStatementStatuses: [
30
+ Statuses.DocumentsSignedFrom,
31
+ Statuses.DocumentsSignedClientFrom,
32
+ Statuses.ContractSignedFrom,
33
+ Statuses.WaitingInsurancePremiumForm,
34
+ Statuses.UnderwriterForm,
35
+ Statuses.InputDataForm,
36
+ ],
30
37
  cancelApplicationStatuses: [
31
38
  Statuses.StartForm,
32
39
  Statuses.EditForm,
33
40
  Statuses.EditBeneficiaryForm,
34
41
  Statuses.WaitingInsurancePremiumForm,
35
42
  Statuses.DocumentsSignedFrom,
43
+ Statuses.DocumentsSignedClientFrom,
44
+ Statuses.InputDataForm,
36
45
  Statuses.ContractSignedFrom,
37
46
  ],
38
47
  gbdErrors: ['INVALID', 'TIMEOUT', 'ERROR', 'NOT_FOUND'],
package/locales/ru.json CHANGED
@@ -478,7 +478,12 @@
478
478
  "contracts": "Контракты",
479
479
  "contragents": "Контрагенты",
480
480
  "stateRegistrationDate": "Дата государственной регистрации",
481
- "numberRegistration": "Номер государственной регистрации"
481
+ "numberRegistration": "Номер государственной регистрации",
482
+ "id": "ID",
483
+ "sum": "Минимальная сумма",
484
+ "changes": "Кол-во изменений",
485
+ "termDays": "Срок договора в днях",
486
+ "termYears": "Срок договора в годах"
482
487
  },
483
488
  "agent": {
484
489
  "currency": "Валюта",
@@ -750,7 +755,8 @@
750
755
  "noResidentOffline": "Обратитесь в филиал для оффлайн оформления нерезидента",
751
756
  "calculationPreliminary": "Расчет предварительный. Требуется заполнить все необходимые данные",
752
757
  "planDate": "Дата должна превышать сегодняшнюю дату",
753
- "iik": "ИИК должен состоять из 20 символов"
758
+ "iik": "ИИК должен состоять из 20 символов",
759
+ "dataInPast": "Указанная дата осталась в прошлом"
754
760
  },
755
761
  "code": "КЭС",
756
762
  "fontSize": "Размер шрифта",
@@ -888,7 +894,8 @@
888
894
  "clients": {
889
895
  "listInsured": "Список Застрахованных",
890
896
  "templateInsured": "Шаблон для заполнения данных Застрахованных",
891
- "sendListToFill": "Отправить список Страхователю для заполнения",
897
+ "sendListToFill": "Скачать или Отправить список Страхователю для заполнения",
898
+ "sendDeclarationToFill": "Скачать или Отправить декларацию Страхователю для заполнения",
892
899
  "completedListInsured": "Заполненный список Застрахованных",
893
900
  "selectInsSum": "Выберите страховую сумму",
894
901
  "isPolicyholderBeneficialOwner": "Является ли Страхователь Бенефициарным собственником",
@@ -902,6 +909,7 @@
902
909
  "documentsBeneficialOwner": "Документы Бенефициарного собственника",
903
910
  "coveragePeriod": "Период покрытия",
904
911
  "attachScansSignDocs": "Вложить сканы подписанных документов",
912
+ "declarationHealthInsured": "Декларация о здоровье Застрахованных",
905
913
  "form": {
906
914
  "calculation": "Расчеты",
907
915
  "paymentAmount": "Размер выплаты",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.9-beta.34",
3
+ "version": "0.0.9-beta.35",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -22,6 +22,7 @@ export const useDataStore = defineStore('data', {
22
22
  formStore: useFormStore(),
23
23
  // contragent: useContragentStore(),
24
24
  api: new ApiClass(),
25
+ rController: new AbortController(),
25
26
  yearEnding: (year: number) => yearEnding(year, constants.yearTitles, constants.yearCases),
26
27
  currentDate: () => new Date(Date.now() - new Date().getTimezoneOffset() * 60 * 1000).toISOString().slice(0, -1),
27
28
  showToaster: (type: 'success' | 'error' | 'warning' | 'info', msg: string, timeout?: number) =>
@@ -77,6 +78,14 @@ export const useDataStore = defineStore('data', {
77
78
  childFrame.contentWindow.postMessage({ action: action, value: value }, '*');
78
79
  }
79
80
  },
81
+ abortRequests() {
82
+ try {
83
+ this.rController.abort();
84
+ this.rController = new AbortController();
85
+ } catch (err) {
86
+ console.log(err);
87
+ }
88
+ },
80
89
  async copyToClipboard(text: unknown) {
81
90
  if (typeof text === 'string' || typeof text === 'number') {
82
91
  if (navigator.clipboard && window.isSecureContext) {
@@ -206,6 +215,9 @@ export const useDataStore = defineStore('data', {
206
215
  isSupervisor() {
207
216
  return this.isRole(constants.roles.Supervisor);
208
217
  },
218
+ isHeadManager() {
219
+ return this.isRole(constants.roles.HeadManager);
220
+ },
209
221
  isProcessEditable(statusCode?: keyof typeof Statuses) {
210
222
  const getEditibleStatuses = () => {
211
223
  const defaultStatuses = constants.editableStatuses;
@@ -1810,22 +1822,7 @@ export const useDataStore = defineStore('data', {
1810
1822
  async calculatePrice(taskId?: string) {
1811
1823
  this.isLoading = true;
1812
1824
  try {
1813
- const priceForm: {
1814
- processInstanceId?: string | number | null;
1815
- id?: string | null;
1816
- addCoversDto?: AddCover[];
1817
- insuredAmountId?: string | number | null;
1818
- age?: string | number | null;
1819
- lifeTripCountries?: string[] | null;
1820
- tripPurposeId?: string | number | null;
1821
- workTypeId?: string | number | null;
1822
- sportsTypeId?: string | number | null;
1823
- singleTripDays?: number;
1824
- multipleTripMaxDays?: number;
1825
- tripInsurancePeriod?: number;
1826
- startDate?: string | null;
1827
- endDate?: string | null;
1828
- } = {};
1825
+ const priceForm: SetApplicationRequest = {};
1829
1826
  priceForm.insuredAmountId = this.formStore.productConditionsForm.calculatorForm.amount.id;
1830
1827
  priceForm.age = this.formStore.productConditionsForm.calculatorForm.age;
1831
1828
  priceForm.lifeTripCountries = this.formStore.productConditionsForm.calculatorForm.countries!.map(item => item.id as string);
@@ -1906,7 +1903,6 @@ export const useDataStore = defineStore('data', {
1906
1903
  this.formStore.ManagerPolicy.ids = applicationData.insisWorkDataApp.managerPolicy;
1907
1904
  this.formStore.SaleChanellPolicy.nameRu = applicationData.insisWorkDataApp.saleChanellPolicyName;
1908
1905
  this.formStore.SaleChanellPolicy.ids = applicationData.insisWorkDataApp.saleChanellPolicy;
1909
-
1910
1906
  this.formStore.AgentData.fullName = applicationData.insisWorkDataApp.agentName;
1911
1907
  this.formStore.AgentData.agentId = applicationData.insisWorkDataApp.agentId;
1912
1908
 
package/store/rules.ts CHANGED
@@ -212,6 +212,17 @@ export const rules = {
212
212
  ],
213
213
  policyholderAgeLimit: [(v: any) => v >= 18 || t('rules.policyholderAgeLimit')],
214
214
  beneficiaryAgeLimit: [(v: any) => v <= 15 || t('rules.beneficiaryAgeLimit')],
215
+ dateInPast: [
216
+ (v: any) => {
217
+ const givenDate = new Date(formatDate(v)!);
218
+ const currentDate = new Date();
219
+ if (givenDate.getTime() < currentDate.getTime()) {
220
+ return t('rules.dataInPast');
221
+ } else {
222
+ return true;
223
+ }
224
+ },
225
+ ],
215
226
  guaranteedPeriodLimit(v: any, termAnnuityPayments: any) {
216
227
  if (Number(v) > Number(termAnnuityPayments)) {
217
228
  return t('rules.guaranteedPeriodLimit');
package/types/enum.ts CHANGED
@@ -52,6 +52,7 @@ export enum Roles {
52
52
  ManagerHalykBank = 'ManagerHalykBank',
53
53
  ServiceManager = 'ServiceManager',
54
54
  DRNSJ = 'DRNSJ',
55
+ HeadManager = 'HeadManager',
55
56
  }
56
57
 
57
58
  export enum Statuses {
@@ -67,6 +68,9 @@ export enum Statuses {
67
68
  WaitingInsurancePremiumForm = 'WaitingInsurancePremiumForm',
68
69
  CheckFinCenterForm = 'CheckFinCenterForm',
69
70
  RegistryFinCenterForm = 'RegistryFinCenterForm',
71
+ DocumentsSignedClientFrom = 'DocumentsSignedClientFrom',
72
+ InputDataForm = 'InputDataForm',
73
+ ApproveForm = 'ApproveForm',
70
74
  }
71
75
 
72
76
  export enum MemberCodes {
package/types/index.ts CHANGED
@@ -323,6 +323,8 @@ declare global {
323
323
  coverPeriodName?: string;
324
324
  coverPeriodCode?: string;
325
325
  calculatorValue?: number;
326
+ coverTypeNameRu?: string;
327
+ coverTypeNameKz?: string;
326
328
  }
327
329
 
328
330
  type SignUrlType = {
@@ -621,6 +623,64 @@ declare global {
621
623
  tripInsurancePeriod?: number;
622
624
  startDate?: string | null;
623
625
  endDate?: string | null;
626
+ policyId?: number;
627
+ policyNumber?: string;
628
+ contractDate?: string;
629
+ contractEndDate?: string;
630
+ amount?: number;
631
+ premium?: number;
632
+ mainCoverPremium?: number;
633
+ currency?: string;
634
+ isSpokesman?: boolean;
635
+ coverPeriod?: number;
636
+ payPeriod?: number;
637
+ indexRateId?: string;
638
+ indexRateCode?: string;
639
+ indexRateName?: string;
640
+ paymentPeriodId?: string;
641
+ paymentPeriodName?: string;
642
+ lifeMultiply?: number;
643
+ lifeAdditive?: number;
644
+ adbMultiply?: number;
645
+ adbAdditive?: number;
646
+ disabilityMultiply?: number;
647
+ disabilityAdditive?: number;
648
+ documentSignTypeId?: string;
649
+ documentSignTypeCode?: string;
650
+ documentSignTypeName?: string;
651
+ isDocumentsSigned?: boolean;
652
+ paymentTypeId?: string;
653
+ paymentTypeName?: string;
654
+ isPayed?: boolean;
655
+ underwritingType?: number;
656
+ calcDirect?: number;
657
+ tariffId?: string;
658
+ tariffName?: string;
659
+ riskGroup?: number;
660
+ riskGroup2?: number;
661
+ lifeMultiplyClient?: number;
662
+ lifeAdditiveClient?: number;
663
+ annuityTypeId?: string;
664
+ annuityTypeName?: string;
665
+ annuityPaymentPeriodId?: string;
666
+ annuityPaymentPeriodName?: string;
667
+ guaranteedPaymentPeriod?: number;
668
+ paymentPeriod?: number;
669
+ annuityMonthPay?: number;
670
+ annuityPaymentBeginDate?: string;
671
+ annuityPaymentEndDate?: string;
672
+ calcDate?: string;
673
+ guaranteedPaymentBeginDate?: string;
674
+ guaranteedPaymentEndDate?: string;
675
+ annuityPaymentAmount?: number;
676
+ countPay?: number;
677
+ guaranteedPeriod?: number;
678
+ dateFirstPay?: string;
679
+ effectiveAnnualpercentage?: number;
680
+ factorCurrentValueGP?: number;
681
+ alfa?: number;
682
+ gamma?: number;
683
+ mrpPayment?: number;
624
684
  };
625
685
 
626
686
  type KGDResponse = {