hl-core 0.0.10-beta.28 → 0.0.10-beta.29

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
@@ -643,6 +643,13 @@ export class ApiClass {
643
643
  });
644
644
  }
645
645
 
646
+ async getBankByAccountNumber(accountNumber: string) {
647
+ return await this.axiosCall<Value>({
648
+ method: Methods.GET,
649
+ url: `/Ekk/api/ContragentInsis/GetBankByAccountNumber?accountNumber=${accountNumber}`,
650
+ });
651
+ }
652
+
646
653
  async searchAgentByName(name: string, branchCode?: string) {
647
654
  return await this.axiosCall<Types.AgentData[]>({
648
655
  method: Methods.GET,
@@ -75,12 +75,18 @@ export default defineComponent({
75
75
  const dataStore = useDataStore();
76
76
  const formStore = useFormStore();
77
77
 
78
- const amount = computed(() =>
79
- formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null,
80
- );
81
- const premium = computed(() =>
82
- formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null,
83
- );
78
+ const amount = computed(() => {
79
+ if (dataStore.isGons && formStore.productConditionsForm && formStore.productConditionsForm.currency.code === 'USD') {
80
+ return formStore.productConditionsForm.requestedSumInsuredInDollar;
81
+ }
82
+ return formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null;
83
+ });
84
+ const premium = computed(() => {
85
+ if (dataStore.isGons && formStore.productConditionsForm && formStore.productConditionsForm.currency.code === 'USD') {
86
+ return formStore.productConditionsForm.insurancePremiumPerMonthInDollar;
87
+ }
88
+ return formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null;
89
+ });
84
90
  const policyNumber = computed(() => (formStore.applicationData && formStore.applicationData.policyAppDto ? formStore.applicationData.policyAppDto.policyNumber : null));
85
91
  const contractDate = computed(() =>
86
92
  formStore.applicationData && formStore.applicationData.policyAppDto && formStore.applicationData.policyAppDto.contractDate
@@ -52,8 +52,8 @@
52
52
  v-model="member.signOfResidency"
53
53
  :value="member.signOfResidency?.nameRu"
54
54
  :label="$dataStore.t('form.signOfResidency')"
55
- :readonly="isDisabled || isDataFromGov"
56
- :clearable="!isDisabled && !isDataFromGov"
55
+ :readonly="isDisabled"
56
+ :clearable="!isDisabled"
57
57
  :rules="residencyRule"
58
58
  append-inner-icon="mdi mdi-chevron-right"
59
59
  @append="openPanel($dataStore.t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
@@ -517,8 +517,8 @@
517
517
  v-model="member.signOfResidency"
518
518
  :value="member.signOfResidency?.nameRu"
519
519
  :label="$dataStore.t('form.signOfResidency')"
520
- :readonly="isDisabled || isDataFromGov"
521
- :clearable="!isDisabled && !isDataFromGov"
520
+ :readonly="isDisabled"
521
+ :clearable="!isDisabled"
522
522
  :rules="residencyRule"
523
523
  append-inner-icon="mdi mdi-chevron-right"
524
524
  @append="openPanel($dataStore.t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
@@ -932,7 +932,7 @@ export default {
932
932
  };
933
933
  return dataStore.isAULETTI || dataStore.isAulettiParent ? false : dataStore.controls.hasGBDFL && perMemberCondition();
934
934
  });
935
- const hasGBDFLDocSelection = dataStore.isLifetrip && whichForm.value === formStore.policyholderFormKey;
935
+ const hasGBDFLDocSelection = dataStore.isLifetrip;
936
936
  const hasInsis = computed(() => dataStore.controls.hasInsis);
937
937
  const hasGKB = computed(() => {
938
938
  const perMemberCondition = () => {
@@ -1082,7 +1082,6 @@ export default {
1082
1082
  case formStore.policyholderFormKey:
1083
1083
  return route.params.taskId === '0';
1084
1084
  case formStore.insuredFormKey:
1085
- if (dataStore.isPension && formStore.applicationData.processCode === 19) return route.params.taskId === '0';
1086
1085
  return route.query.id === '0';
1087
1086
  case formStore.policyholdersRepresentativeFormKey:
1088
1087
  case formStore.beneficiaryFormKey:
@@ -152,6 +152,17 @@
152
152
  @append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
153
153
  />
154
154
  </div>
155
+ <base-panel-input
156
+ v-if="hasCurrency"
157
+ v-model="productConditionsForm.currency"
158
+ :value="productConditionsForm.currency.nameRu"
159
+ :readonly="isDisabled"
160
+ :clearable="!isDisabled"
161
+ :label="$dataStore.t('agent.currency')"
162
+ :rules="$rules.objectRequired"
163
+ append-inner-icon="mdi mdi-chevron-right"
164
+ @append="openPanel($dataStore.t('agent.currency'), $constants.currencyList, 'currency')"
165
+ />
155
166
  <base-form-input
156
167
  v-if="hasInsStartDate"
157
168
  v-model="productConditionsForm.calcDate"
@@ -185,8 +196,8 @@
185
196
  v-if="hasPaymentPeriod"
186
197
  v-model="productConditionsForm.paymentPeriod"
187
198
  :value="productConditionsForm.paymentPeriod?.nameRu"
188
- :readonly="isDisabled"
189
- :clearable="!isDisabled"
199
+ :readonly="isDisabledPaymentPeriod"
200
+ :clearable="!isDisabledPaymentPeriod"
190
201
  :rules="$rules.objectRequired"
191
202
  :label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
192
203
  append-inner-icon="mdi mdi-chevron-right"
@@ -256,10 +267,10 @@
256
267
  @onClear="onClearPremiumDollar"
257
268
  />
258
269
  <base-form-input
259
- v-if="hasCurrency && $dataStore.currencies.usd"
270
+ v-if="hasCurrencySymbols && $dataStore.currencies.usd"
260
271
  v-model="$dataStore.currencies.usd"
261
272
  :readonly="true"
262
- :label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
273
+ :label="currencySymbolsLabel"
263
274
  :suffix="$constants.currencySymbols.kzt"
264
275
  />
265
276
  <base-form-input
@@ -819,7 +830,9 @@ export default defineComponent({
819
830
  const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
820
831
  const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
821
832
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
822
- const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
833
+ const insurancePremiumPerMonthRule = computed(() =>
834
+ !!productConditionsForm.insurancePremiumPerMonth ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
835
+ );
823
836
  const insurancePremiumPerMonthDisabled = computed(() => {
824
837
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
825
838
  return true;
@@ -829,7 +842,9 @@ export default defineComponent({
829
842
  }
830
843
  return isDisabled.value;
831
844
  });
832
- const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
845
+ const requestedSumInsuredRule = computed(() =>
846
+ !!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
847
+ );
833
848
  const fixInsSumRule = computed(() =>
834
849
  !!productConditionsForm.fixInsSum
835
850
  ? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
@@ -872,18 +887,27 @@ export default defineComponent({
872
887
  if (whichProduct.value === 'halykkazyna') {
873
888
  return true;
874
889
  }
890
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
891
+ return true;
892
+ }
875
893
  return false;
876
894
  });
877
895
  const hasInsurancePremiumPerMonthInDollar = computed(() => {
878
896
  if (whichProduct.value === 'halykkazyna') {
879
897
  return true;
880
898
  }
899
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
900
+ return true;
901
+ }
881
902
  return false;
882
903
  });
883
- const hasCurrency = computed(() => {
904
+ const hasCurrencySymbols = computed(() => {
884
905
  if (whichProduct.value === 'halykkazyna') {
885
906
  return true;
886
907
  }
908
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
909
+ return true;
910
+ }
887
911
  return false;
888
912
  });
889
913
  const hasAdbMultiply = computed(() => {
@@ -986,6 +1010,12 @@ export default defineComponent({
986
1010
  }
987
1011
  return dataStore.t('productConditionsForm.insurancePremiumAmount');
988
1012
  });
1013
+ const currencySymbolsLabel = computed(() => {
1014
+ if (whichProduct.value === 'gons') {
1015
+ return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
1016
+ }
1017
+ return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
1018
+ });
989
1019
  const isDisabledFixInsSum = computed(() => {
990
1020
  if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
991
1021
  return false;
@@ -1080,6 +1110,18 @@ export default defineComponent({
1080
1110
  }
1081
1111
  return false;
1082
1112
  });
1113
+ const hasCurrency = computed(() => {
1114
+ if (whichProduct.value === 'gons') {
1115
+ return true;
1116
+ }
1117
+ return false;
1118
+ });
1119
+ const isDisabledPaymentPeriod = computed(() => {
1120
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1121
+ return true;
1122
+ }
1123
+ return isDisabled.value;
1124
+ });
1083
1125
 
1084
1126
  const pensionCalculationParams = ref({
1085
1127
  compulsoryContractAmount: pensionForm && pensionForm.compulsoryContractAmount && pensionForm.compulsoryContractAmount != 0 ? pensionForm.compulsoryContractAmount : null,
@@ -1381,7 +1423,7 @@ export default defineComponent({
1381
1423
  const calculatedPremiumDollar = getNumber(event.target.value as string);
1382
1424
  if (calculatedPremiumDollar) {
1383
1425
  productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
1384
- if (whichProduct.value === 'halykkazyna') {
1426
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1385
1427
  if (typeof dataStore.currencies.usd === 'number') {
1386
1428
  productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
1387
1429
  } else {
@@ -1409,7 +1451,7 @@ export default defineComponent({
1409
1451
  const calculatedSumDollar = getNumber(event.target.value as string);
1410
1452
  if (calculatedSumDollar) {
1411
1453
  productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
1412
- if (whichProduct.value === 'halykkazyna') {
1454
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1413
1455
  if (typeof dataStore.currencies.usd === 'number') {
1414
1456
  productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
1415
1457
  } else {
@@ -1549,13 +1591,13 @@ export default defineComponent({
1549
1591
  } else {
1550
1592
  if (whichSum.value === 'requestedSumInsured') {
1551
1593
  productConditionsForm.insurancePremiumPerMonth = null;
1552
- if (whichProduct.value === 'halykkazyna') {
1594
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1553
1595
  productConditionsForm.insurancePremiumPerMonthInDollar = null;
1554
1596
  }
1555
1597
  }
1556
1598
  if (whichSum.value === 'insurancePremiumPerMonth') {
1557
1599
  productConditionsForm.requestedSumInsured = null;
1558
- if (whichProduct.value === 'halykkazyna') {
1600
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1559
1601
  productConditionsForm.requestedSumInsuredInDollar = null;
1560
1602
  }
1561
1603
  }
@@ -1669,6 +1711,10 @@ export default defineComponent({
1669
1711
  if (dataStore.isCalculator) {
1670
1712
  clearFields();
1671
1713
  }
1714
+ if (whichProduct.value === 'gons') {
1715
+ formStore.isDisabled.productConditionsForm = false;
1716
+ dataStore.setFormsDisabled(false);
1717
+ }
1672
1718
  if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
1673
1719
  if (
1674
1720
  (dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
@@ -1712,10 +1758,12 @@ export default defineComponent({
1712
1758
  dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
1713
1759
  await dataStore.getProcessPaymentPeriod();
1714
1760
  }
1761
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1762
+ await dataStore.getCurrencies();
1763
+ }
1715
1764
  if (whichProduct.value === 'halykkazyna') {
1716
1765
  const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
1717
1766
  if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
1718
- await dataStore.getCurrencies();
1719
1767
  }
1720
1768
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1721
1769
  productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
@@ -1771,6 +1819,23 @@ export default defineComponent({
1771
1819
  { immediate: true },
1772
1820
  );
1773
1821
 
1822
+ if (hasCurrency.value) {
1823
+ watch(
1824
+ () => productConditionsForm.currency,
1825
+ async val => {
1826
+ if (val.code === 'USD') {
1827
+ if (!dataStore.processPaymentPeriod.length) {
1828
+ await dataStore.getProcessPaymentPeriod();
1829
+ }
1830
+ const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
1831
+ if (paymentPeriod) {
1832
+ productConditionsForm.paymentPeriod = paymentPeriod;
1833
+ }
1834
+ }
1835
+ },
1836
+ );
1837
+ }
1838
+
1774
1839
  if (hasInsStartDate.value) {
1775
1840
  watch(
1776
1841
  () => productConditionsForm.calcDate,
@@ -1886,6 +1951,9 @@ export default defineComponent({
1886
1951
  isDisabled,
1887
1952
  isTermsDisabled,
1888
1953
  isUnderwriterForm,
1954
+ hasCurrencySymbols,
1955
+ currencySymbolsLabel,
1956
+ isDisabledPaymentPeriod,
1889
1957
  insurancePremiumPerMonthRule,
1890
1958
  insurancePremiumPerMonthDisabled,
1891
1959
  requestedSumInsuredRule,
@@ -11,10 +11,10 @@
11
11
  <div :class="[$styles.flexColNav]">
12
12
  <base-content-block v-if="hasConditionsInfo" class="flex flex-col gap-3">
13
13
  <span
14
- >{{ `Сумма страховой премии ${paymentPeriod}:` }} <b>{{ `${insurancePremiumPerMonth}₸` }}</b></span
14
+ >{{ `Сумма страховой премии ${paymentPeriod}:` }} <b>{{ `${insurancePremiumPerMonth}` }}</b></span
15
15
  >
16
16
  <span
17
- >{{ `Запрашиваемая страховая сумма: ` }} <b>{{ `${requestedSumInsured}₸` }}</b>
17
+ >{{ `Запрашиваемая страховая сумма: ` }} <b>{{ `${requestedSumInsured}` }}</b>
18
18
  </span>
19
19
  </base-content-block>
20
20
  <base-content-block v-if="$dataStore.isLifetrip" class="flex flex-col gap-3">
@@ -574,14 +574,22 @@ export default defineComponent({
574
574
  const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
575
575
  const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
576
576
  const choosePayActions = computed(() => dataStore.controls.hasChoosePay && dataStore.panelAction === constants.actions.choosePay);
577
- const isNewSign = computed(() => (dataStore.isPension || dataStore.isGons) && !useEnv().isProduction);
577
+ const isNewSign = computed(() => (dataStore.isPension && !useEnv().isProduction) || dataStore.isGons);
578
578
  const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
579
- const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
579
+ const insurancePremiumPerMonth = computed(() => {
580
+ if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
581
+ return `${formStore.productConditionsForm.insurancePremiumPerMonthInDollar}$`;
582
+ }
583
+ return `${formStore.productConditionsForm.insurancePremiumPerMonth}₸`;
584
+ });
580
585
  const requestedSumInsured = computed(() => {
581
586
  if ((dataStore.isLifeBusiness || dataStore.isGns) && formStore.productConditionsForm.requestedSumInsured === null) {
582
587
  return dataStore.getNumberWithSpaces(formStore.applicationData.policyAppDto!.mainInsSum);
583
588
  }
584
- return dataStore.getNumberWithSpaces(formStore.productConditionsForm.requestedSumInsured);
589
+ if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
590
+ return `${formStore.productConditionsForm.requestedSumInsuredInDollar}$`;
591
+ }
592
+ return `${formStore.productConditionsForm.requestedSumInsured}₸`;
585
593
  });
586
594
  const price = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.calculatorForm.price));
587
595
  const insuredAmount = computed(() => formStore.productConditionsForm.calculatorForm.amount!.nameRu! + dataStore.currency);
@@ -825,6 +825,7 @@ export class ProductConditions {
825
825
  fixInsSum: number | string | null;
826
826
  calcDate: string | null;
827
827
  contractEndDate: string | null;
828
+ currency: Value;
828
829
 
829
830
  constructor(
830
831
  insuranceCase = null,
@@ -873,6 +874,7 @@ export class ProductConditions {
873
874
  fixInsSum = null,
874
875
  calcDate = null,
875
876
  contractEndDate = null,
877
+ currency = new Value(),
876
878
  ) {
877
879
  this.requestedSumInsuredInDollar = null;
878
880
  this.insurancePremiumPerMonthInDollar = null;
@@ -925,6 +927,7 @@ export class ProductConditions {
925
927
  this.fixInsSum = fixInsSum;
926
928
  this.calcDate = calcDate;
927
929
  this.contractEndDate = contractEndDate;
930
+ this.currency = currency;
928
931
  }
929
932
 
930
933
  getSingleTripDays() {
@@ -163,4 +163,20 @@ export const constants = Object.freeze({
163
163
  ids: '',
164
164
  },
165
165
  ],
166
+ currencyList: [
167
+ {
168
+ code: 'KZT',
169
+ id: '1',
170
+ nameKz: 'Тенге',
171
+ nameRu: 'Тенге',
172
+ ids: '',
173
+ },
174
+ {
175
+ code: 'USD',
176
+ id: '2',
177
+ nameKz: 'С индексацией на курс USD',
178
+ nameRu: 'С индексацией на курс USD',
179
+ ids: '',
180
+ },
181
+ ],
166
182
  });
package/locales/ru.json CHANGED
@@ -395,6 +395,7 @@
395
395
  "insurancePremiumAmount": "Размер Страховой премии (страховой взнос) в тенге",
396
396
  "insurancePremiumAmountInDollar": "Размер Страховой премии (страховой взнос) в долларах",
397
397
  "dollarExchangeRateNBRK": "Курс доллара НБРК",
398
+ "exchangeRateSettlementDate": "Курс на дату расчета (USD/KZT)",
398
399
  "contractDate": "Дата контракта",
399
400
  "guaranteedTermAnnuityPayments": "Гарантированный срок аннуитетных выплат",
400
401
  "guaranteedPeriod": "Укажите период гарантированного срока",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.28",
3
+ "version": "0.0.10-beta.29",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -1024,6 +1024,14 @@ export const useDataStore = defineStore('data', {
1024
1024
  conditionsData.policyAppDto.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
1025
1025
  conditionsData.policyAppDto.currencyExchangeRate = this.currencies.usd;
1026
1026
  }
1027
+ if (this.isGons) {
1028
+ conditionsData.policyAppDto.premiumInCurrency =
1029
+ this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar));
1030
+ conditionsData.policyAppDto.amountInCurrency =
1031
+ this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
1032
+ conditionsData.policyAppDto.currencyExchangeRate = this.formStore.productConditionsForm.currency.code === 'KZT' ? null : this.currencies.usd;
1033
+ conditionsData.policyAppDto.currency = this.formStore.productConditionsForm.currency.code as string;
1034
+ }
1027
1035
  if (this.isLiferenta) {
1028
1036
  conditionsData.policyAppDto.guaranteedPaymentPeriod = this.formStore.productConditionsForm.guaranteedPeriod || 0;
1029
1037
  conditionsData.policyAppDto.annuityTypeId = (this.formStore.productConditionsForm.typeAnnuityInsurance.id as string) ?? undefined;
@@ -1792,6 +1800,15 @@ export const useDataStore = defineStore('data', {
1792
1800
  calculationData.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
1793
1801
  calculationData.currencyExchangeRate = this.currencies.usd;
1794
1802
  }
1803
+ if (this.isGons || product === 'gons') {
1804
+ calculationData.premiumInCurrency =
1805
+ this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar));
1806
+ calculationData.amountInCurrency =
1807
+ this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
1808
+ calculationData.currencyExchangeRate = this.formStore.productConditionsForm.currency.code === 'KZT' ? null : this.currencies.usd;
1809
+
1810
+ calculationData.currency = this.formStore.productConditionsForm.currency.code as string;
1811
+ }
1795
1812
  if (this.isLiferenta || product === 'liferenta') {
1796
1813
  calculationData.guaranteedPaymentPeriod = this.formStore.productConditionsForm.guaranteedPeriod || 0;
1797
1814
  calculationData.annuityTypeId = (this.formStore.productConditionsForm.typeAnnuityInsurance.id as string) ?? undefined;
@@ -1810,10 +1827,15 @@ export const useDataStore = defineStore('data', {
1810
1827
  calculationData.calcDate = formatDate(this.formStore.productConditionsForm.calcDate as string)!.toISOString();
1811
1828
  }
1812
1829
  const calculationResponse = await this.api.calculateWithoutApplication(calculationData, this.isCalculator ? product : undefined);
1813
- if (calculationResponse.amount) this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.amount);
1814
- if (calculationResponse.premium) this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.premium);
1830
+ if (calculationResponse.amount)
1831
+ this.formStore.productConditionsForm.requestedSumInsured =
1832
+ this.isGons || product === 'gons' ? this.getNumberWithSpacesAfterComma(calculationResponse.amount) : this.getNumberWithSpaces(calculationResponse.amount);
1833
+ if (calculationResponse.premium)
1834
+ this.formStore.productConditionsForm.insurancePremiumPerMonth =
1835
+ this.isGons || product === 'gons' ? this.getNumberWithSpacesAfterComma(calculationResponse.premium) : this.getNumberWithSpaces(calculationResponse.premium);
1836
+
1815
1837
  this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
1816
- if (this.isKazyna || product === 'halykkazyna') {
1838
+ if (this.isKazyna || product === 'halykkazyna' || this.isGons || product === 'gons') {
1817
1839
  if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
1818
1840
  this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(calculationResponse.amountInCurrency);
1819
1841
  } else {
@@ -1860,7 +1882,7 @@ export const useDataStore = defineStore('data', {
1860
1882
  const applicationData = await this.api.getApplicationData(taskId);
1861
1883
  this.formStore.applicationData = applicationData;
1862
1884
  if (this.formStore.applicationData.addCoverDto) this.formStore.additionalInsuranceTerms = this.formStore.applicationData.addCoverDto;
1863
- if (this.isKazyna && this.currencies.usd) {
1885
+ if ((this.isKazyna || this.isGons) && this.currencies.usd) {
1864
1886
  if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
1865
1887
  this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(result.value / this.currencies.usd);
1866
1888
  } else {
@@ -1868,11 +1890,15 @@ export const useDataStore = defineStore('data', {
1868
1890
  }
1869
1891
  }
1870
1892
  if (this.formStore.productConditionsForm.insurancePremiumPerMonth != null) {
1871
- this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(result.value);
1872
- this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(applicationData.policyAppDto.premium);
1893
+ this.formStore.productConditionsForm.requestedSumInsured = this.isGons ? this.getNumberWithSpacesAfterComma(result.value) : this.getNumberWithSpaces(result.value);
1894
+ this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons
1895
+ ? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.premium)
1896
+ : this.getNumberWithSpaces(applicationData.policyAppDto.premium);
1873
1897
  } else {
1874
- this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(result.value);
1875
- this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(applicationData.policyAppDto.amount);
1898
+ this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons ? this.getNumberWithSpacesAfterComma(result.value) : this.getNumberWithSpaces(result.value);
1899
+ this.formStore.productConditionsForm.requestedSumInsured = this.isGons
1900
+ ? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.amount)
1901
+ : this.getNumberWithSpaces(applicationData.policyAppDto.amount);
1876
1902
  }
1877
1903
  if (this.isLiferenta) {
1878
1904
  this.formStore.productConditionsForm.amountAnnuityPayments = this.getNumberWithSpaces(applicationData.policyAppDto.annuityMonthPay);
@@ -2216,16 +2242,21 @@ export const useDataStore = defineStore('data', {
2216
2242
  const paymentPeriod = this.processPaymentPeriod.find(item => item.id == applicationData.policyAppDto.paymentPeriodId);
2217
2243
  this.formStore.productConditionsForm.paymentPeriod = paymentPeriod ? paymentPeriod : new Value();
2218
2244
 
2219
- this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(
2220
- applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount,
2221
- );
2222
- this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(
2223
- applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium,
2224
- );
2225
- if (this.isKazyna) {
2245
+ this.formStore.productConditionsForm.requestedSumInsured = this.isGons
2246
+ ? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount)
2247
+ : this.getNumberWithSpaces(applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount);
2248
+ this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons
2249
+ ? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium)
2250
+ : this.getNumberWithSpaces(applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium);
2251
+
2252
+ if (this.isKazyna || this.isGons) {
2226
2253
  this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(applicationData.policyAppDto.amountInCurrency);
2227
2254
  this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(applicationData.policyAppDto.premiumInCurrency);
2228
2255
  }
2256
+ if (this.isGons) {
2257
+ const currency = constants.currencyList.find(item => item.code === applicationData.policyAppDto.currency);
2258
+ this.formStore.productConditionsForm.currency = currency ? currency : new Value();
2259
+ }
2229
2260
  const riskGroup = this.riskGroup.find(item => {
2230
2261
  if (applicationData.policyAppDto.riskGroup == 0) {
2231
2262
  return true;
@@ -3310,10 +3341,12 @@ export const useDataStore = defineStore('data', {
3310
3341
 
3311
3342
  if (Array.isArray(person.documents.document)) {
3312
3343
  const filteredDocuments = person.documents.document.filter(i => new Date(i.endDate) > new Date(Date.now()) && i.status.code === '00');
3313
- const validDocument =
3314
- filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes['1UDL']) ??
3315
- filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.VNZ) ??
3316
- filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.PS);
3344
+
3345
+ const validDocument = this.isLifetrip
3346
+ ? filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.PS)
3347
+ : filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes['1UDL']) ??
3348
+ filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.VNZ) ??
3349
+ filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.PS);
3317
3350
  if (validDocument) {
3318
3351
  const documentType = this.documentTypes.find(
3319
3352
  (i: Value) => i.ids === Object.keys(CoreEnums.GBD.DocTypes)[Object.values(CoreEnums.GBD.DocTypes).indexOf(validDocument.type.code)],
@@ -3759,6 +3792,14 @@ export const useDataStore = defineStore('data', {
3759
3792
  return ErrorHandler(err);
3760
3793
  }
3761
3794
  },
3795
+ async getBankByAccountNumber(accountNumber: string) {
3796
+ try {
3797
+ const bank = await this.api.getBankByAccountNumber(accountNumber);
3798
+ return bank;
3799
+ } catch (err) {
3800
+ return ErrorHandler(err);
3801
+ }
3802
+ },
3762
3803
  async isCourseChanged(processInstanceId: string) {
3763
3804
  try {
3764
3805
  const response = await this.api.isCourseChanged(processInstanceId);