hl-core 0.0.9-beta.16 → 0.0.9-beta.18

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
@@ -1,6 +1,6 @@
1
1
  import { MemberCodes, Methods } from '../types/enum';
2
2
  import { useAxiosInstance } from '../composables/axios';
3
- import { Value, IDocument } from '../composables/classes';
3
+ import { Value, IDocument, CountryValue } from '../composables/classes';
4
4
 
5
5
  export class ApiClass {
6
6
  private readonly baseURL: string = import.meta.env.VITE_BASE_URL as string;
@@ -128,6 +128,13 @@ export class ApiClass {
128
128
  });
129
129
  }
130
130
 
131
+ async getBanks() {
132
+ return await this.axiosCall<Value[]>({
133
+ method: Methods.GET,
134
+ url: '/Ekk/api/Contragentinsis/DictionaryItems/Bank',
135
+ });
136
+ }
137
+
131
138
  async getDicAnnuityTypeList() {
132
139
  return await this.axiosCall<Value[]>({
133
140
  method: Methods.GET,
@@ -394,7 +401,7 @@ export class ApiClass {
394
401
  });
395
402
  }
396
403
 
397
- async setApplication(data: { policyAppDto: PolicyAppDto; addCoversDto: AddCover[] }) {
404
+ async setApplication(data: SetApplicationRequest) {
398
405
  return await this.axiosCall<void>({
399
406
  method: Methods.POST,
400
407
  url: `/${this.productUrl}/api/Application/SetApplicationData`,
@@ -543,6 +550,13 @@ export class ApiClass {
543
550
  });
544
551
  }
545
552
 
553
+ async checkIIN(iin: number) {
554
+ return await this.axiosCall<boolean>({
555
+ method: Methods.GET,
556
+ url: `/Arm/api/Bpm/CheckIIN?iin=${iin}`,
557
+ });
558
+ }
559
+
546
560
  async getContragentFromGBDFL(data: { iin: string; phoneNumber: string }) {
547
561
  return await this.axiosCall<GBDFLResponse>({
548
562
  method: Methods.POST,
@@ -559,6 +573,22 @@ export class ApiClass {
559
573
  });
560
574
  }
561
575
 
576
+ async getKgd(data: { iinBin: string }) {
577
+ return await this.axiosCall<KGDResponse>({
578
+ method: Methods.POST,
579
+ url: '/externalservices/api/ExternalServices/GetKgd',
580
+ data: data,
581
+ });
582
+ }
583
+
584
+ async getGbdUl(data: { userName: string; branchName: string; bin: string }) {
585
+ return await this.axiosCall({
586
+ method: Methods.POST,
587
+ url: '/integration/api/External/GetGbdUl',
588
+ data: data,
589
+ });
590
+ }
591
+
562
592
  async getProcessTariff(code: number | string = 5) {
563
593
  return await this.axiosCall({ method: Methods.GET, url: `/Arm/api/Dictionary/ProcessTariff/${code}` });
564
594
  }
@@ -621,4 +651,34 @@ export class ApiClass {
621
651
  url: `/${this.productUrl}/api/Application/IsCourseChanged?processInstanceId=${processInstanceId}`,
622
652
  });
623
653
  }
654
+
655
+ async getArmDicts<T>(dict: string) {
656
+ return await this.axiosCall<T>({
657
+ method: Methods.GET,
658
+ url: `/Arm/api/Dictionary/GetDictionaryItems/${dict}`,
659
+ });
660
+ }
661
+
662
+ async getTripInsuranceDaysOptions() {
663
+ return await this.axiosCall<TripInsuranceDaysOptions>({
664
+ method: Methods.GET,
665
+ url: `/${this.productUrl}/api/Application/TripInsuranceDaysOptions`,
666
+ });
667
+ }
668
+
669
+ async getTripInsuredAmount(data: getTripInsuredAmountRequest) {
670
+ return this.axiosCall<TripInsuranceAmount>({
671
+ method: Methods.POST,
672
+ url: `/${this.productUrl}/api/Application/InsuranceAmountOptions`,
673
+ data: data,
674
+ });
675
+ }
676
+
677
+ async getCalculator(data: SetApplicationRequest) {
678
+ return await this.axiosCall<number>({
679
+ method: Methods.POST,
680
+ url: `/${this.productUrl}/api/Application/Calculator`,
681
+ data: data,
682
+ });
683
+ }
624
684
  }
package/api/index.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import { ApiClass } from './base.api';
2
- import { EfoApiClass } from './efo.api';
3
2
 
4
- export { ApiClass, EfoApiClass };
3
+ export { ApiClass };
@@ -7,6 +7,36 @@ export default function (axios: AxiosInstance) {
7
7
  if (dataStore.accessToken) {
8
8
  request.headers.Authorization = `Bearer ${dataStore.accessToken}`;
9
9
  }
10
+ if (request.url && request.baseURL) {
11
+ const host = window.location.hostname;
12
+ const port = window.location.port;
13
+ if (import.meta.env.VITE_MODE === 'production') {
14
+ if (host.startsWith('bpmsrv02') && port === '88' && request.baseURL !== 'http://bpmsrv02.halyklife.nb') {
15
+ request.baseURL = 'http://bpmsrv02.halyklife.nb';
16
+ }
17
+ } else {
18
+ if (host.startsWith('vega') && port === '800' && request.baseURL !== 'http://vega:84') {
19
+ request.baseURL = 'http://vega:84';
20
+ }
21
+ }
22
+ if (import.meta.env.VITE_ON_NEW_API === 'true') {
23
+ if (request.url.includes('api/Application')) {
24
+ if (request.baseURL === 'http://vega:84') {
25
+ request.baseURL = 'http://efo-dev.halyklife.nb/api';
26
+ }
27
+ if (request.baseURL === 'http://bpmsrv02.halyklife.nb') {
28
+ request.baseURL = 'http://efo-prod.halyklife.nb/api';
29
+ }
30
+ request.url = request.url.replace('/api/Application', '');
31
+ if (request.baseURL.includes('api/v1/insis')) {
32
+ request.baseURL = request.baseURL.replace('api/v1/insis', 'efo/api');
33
+ }
34
+ if (request.baseURL.includes('api/v1/test/insis')) {
35
+ request.baseURL = request.baseURL.replace('api/v1/test/insis', 'dev/efo/api');
36
+ }
37
+ }
38
+ }
39
+ }
10
40
  return request;
11
41
  },
12
42
  (error: AxiosError) => {
@@ -6,23 +6,48 @@
6
6
  </p>
7
7
  <p v-if="!!subtitle" :class="[$styles.greyText, $styles.textSimple]">{{ subtitle }}</p>
8
8
  </div>
9
- <div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
9
+ <div v-if="hasDefault" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
10
10
  <span v-if="hasSum" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
11
11
  <span v-if="hasPremium" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
12
- <span v-if="hasPolicyNumber" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
12
+
13
13
  <span v-if="hasContractDate" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
14
14
  <span v-if="hasCoverPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
15
15
  <span v-if="hasPayPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
16
16
  </div>
17
- <div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
17
+ <div v-if="hasDefault" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
18
18
  <span v-if="hasSum" :class="[amount === null && $styles.emptyBlockCol]">{{ amount }} </span>
19
19
  <span v-if="hasPremium" :class="[premium === null && $styles.emptyBlockCol]"> {{ premium }}</span>
20
20
  <span v-if="hasPolicyNumber" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
21
21
  <span v-if="hasContractDate" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
22
22
  <span v-if="hasCoverPeriod" :class="[coverPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
23
- <span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">
24
- {{ paymentPeriod }}
23
+ <span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ paymentPeriod }}</span>
24
+ <div
25
+ class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
26
+ :class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
27
+ @click="!disabled && $emit('onMore', { whichForm: 'productConditions' })"
28
+ >
29
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
30
+ </div>
31
+ </div>
32
+ <div v-if="$dataStore.isLifetrip" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
33
+ <span :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('calculatorForm.type') }}</span>
34
+ <span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('calculatorForm.country') }}</span>
35
+ <span :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('calculatorForm.purpose') }}</span>
36
+ <span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('calculatorForm.amount') }}</span>
37
+ <span v-if="hasPolicyNumber" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
38
+ </div>
39
+ <div v-if="$dataStore.isLifetrip" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
40
+ <span :class="[calculatorForm.type.nameRu === null && $styles.emptyBlockCol]" class="hidden lg:block">
41
+ {{ calculatorForm.type.nameRu }}
25
42
  </span>
43
+ <span :class="[calculatorForm.price === null && $styles.emptyBlockCol]"> {{ calculatorForm.countries?.length ? countriesComputed : '' }}</span>
44
+ <span :class="[calculatorForm.purpose.nameRu === null && $styles.emptyBlockCol]" class="hidden lg:block">
45
+ {{ calculatorForm.purpose && calculatorForm.purpose.nameRu ? calculatorForm.purpose.nameRu : $dataStore.t('calculatorForm.purpose') }}</span
46
+ >
47
+ <span :class="[calculatorForm.amount && calculatorForm.amount.nameRu ? calculatorForm.amount.nameRu : $dataStore.t('calculatorForm.amount') && $styles.emptyBlockCol]"
48
+ >{{ calculatorForm.amount?.nameRu }}
49
+ </span>
50
+
26
51
  <div
27
52
  class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
28
53
  :class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
@@ -68,11 +93,17 @@ export default defineComponent({
68
93
  ? formStore.productConditionsForm.paymentPeriod.nameRu
69
94
  : null,
70
95
  );
71
-
96
+ const calculatorForm = formStore.productConditionsForm.calculatorForm;
72
97
  const hasSum = computed(() => {
98
+ if (dataStore.isLifetrip) {
99
+ return false;
100
+ }
73
101
  return true;
74
102
  });
75
103
  const hasPremium = computed(() => {
104
+ if (dataStore.isLifetrip) {
105
+ return false;
106
+ }
76
107
  return true;
77
108
  });
78
109
  const hasPolicyNumber = computed(() => {
@@ -88,20 +119,40 @@ export default defineComponent({
88
119
  return false;
89
120
  });
90
121
  const hasCoverPeriod = computed(() => {
122
+ if (dataStore.isLifetrip) {
123
+ return false;
124
+ }
91
125
  if (dataStore.isFinCenter()) {
92
126
  return false;
93
127
  }
94
128
  return true;
95
129
  });
96
130
  const hasPayPeriod = computed(() => {
131
+ if (dataStore.isLifetrip) {
132
+ return false;
133
+ }
97
134
  if (dataStore.isFinCenter()) {
98
135
  return false;
99
136
  }
100
137
  return true;
101
138
  });
139
+ const countriesComputed = computed(() => {
140
+ let message = '';
141
+ for (let country in calculatorForm.countries) {
142
+ message += calculatorForm.countries[country as any].nameRu + ', ';
143
+ }
144
+ return message.slice(0, -2);
145
+ });
146
+ const hasDefault = computed(() => {
147
+ if (dataStore.isLifetrip) {
148
+ return false;
149
+ }
150
+ return true;
151
+ });
102
152
  return {
103
153
  // State
104
154
  formStore,
155
+ calculatorForm,
105
156
 
106
157
  // Computed
107
158
  amount,
@@ -116,6 +167,8 @@ export default defineComponent({
116
167
  hasContractDate,
117
168
  hasPayPeriod,
118
169
  hasCoverPeriod,
170
+ countriesComputed,
171
+ hasDefault,
119
172
  };
120
173
  },
121
174
  });
@@ -24,7 +24,7 @@
24
24
  :suffix="suffix"
25
25
  @keyup.enter.prevent="submitted"
26
26
  @click:control="!props.readonly && $emit('append')"
27
- @click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', new Value())"
27
+ @click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', clearValue)"
28
28
  @click:append="!props.readonly && $emit('append-out')"
29
29
  @click:prepend="!props.readonly && $emit('prepend-out')"
30
30
  @click:append-inner="!props.readonly && $emit('append')"
@@ -50,6 +50,10 @@ export default defineComponent({
50
50
  type: Boolean,
51
51
  default: false,
52
52
  },
53
+ clearValue: {
54
+ type: Object,
55
+ default: new Value(),
56
+ },
53
57
  clearable: {
54
58
  type: Boolean,
55
59
  default: true,
@@ -27,6 +27,23 @@
27
27
  :title="$dataStore.t('form.personalData')"
28
28
  :class="[memberSetting && memberSetting.has === true && memberSetting.isMultiple === true ? 'rounded-t-0 !mt-[-5px]' : 'mt-[14px]']"
29
29
  >
30
+ <base-panel-input
31
+ v-if="$dataStore.isLifetrip"
32
+ v-model="member.signOfResidency"
33
+ :value="member.signOfResidency?.nameRu"
34
+ :label="$dataStore.t('form.signOfResidency')"
35
+ :readonly="isDisabled"
36
+ :clearable="!isDisabled"
37
+ :rules="residencyRule"
38
+ append-inner-icon="mdi mdi-chevron-right"
39
+ @append="openPanel($dataStore.t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
40
+ />
41
+ <base-form-toggle
42
+ v-if="$dataStore.isLifetrip && whichForm === 'insuredForm'"
43
+ v-model="member.isInsuredUnderage"
44
+ :title="$dataStore.t('isInsuredUnderage')"
45
+ :has-border="false"
46
+ />
30
47
  <base-form-input
31
48
  v-model="member.phoneNumber"
32
49
  :label="$dataStore.t('form.phoneNumber')"
@@ -64,12 +81,31 @@
64
81
  :rules="$rules.required.concat($rules.cyrillic)"
65
82
  />
66
83
  <base-form-input
84
+ v-if="hasMiddleName"
67
85
  v-model.trim="member.middleName"
68
86
  :readonly="isDisabled || isFromGBD"
69
87
  :clearable="!isDisabled"
70
88
  :label="$dataStore.t('form.middleName')"
71
89
  :rules="$rules.cyrillicNonRequired"
72
90
  />
91
+ <base-form-input
92
+ v-if="$dataStore.isLifetrip"
93
+ v-model.trim="member.lastNameLat"
94
+ :readonly="isDisabled || isFromGBD"
95
+ :clearable="!isDisabled"
96
+ :label="$dataStore.t('form.lastNameLat')"
97
+ :rules="$rules.required.concat($rules.latin)"
98
+ :hint="$dataStore.t('labels.checkWithDoc')"
99
+ />
100
+ <base-form-input
101
+ v-if="$dataStore.isLifetrip"
102
+ v-model.trim="member.firstNameLat"
103
+ :readonly="isDisabled || isFromGBD"
104
+ :clearable="!isDisabled"
105
+ :label="$dataStore.t('form.firstNameLat')"
106
+ :rules="$rules.required.concat($rules.latin)"
107
+ :hint="$dataStore.t('labels.checkWithDoc')"
108
+ />
73
109
  <base-form-input
74
110
  v-model="member.birthDate"
75
111
  :readonly="isDisabled || isFromGBD"
@@ -102,7 +138,7 @@
102
138
  @append="openPanel($dataStore.t('form.familyStatus'), [], 'familyStatus', $dataStore.getFamilyStatuses)"
103
139
  />
104
140
  <base-panel-input
105
- v-if="(whichForm === formStore.beneficiaryFormKey || whichForm === formStore.insuredFormKey) && member.iin !== formStore.policyholderForm.iin"
141
+ v-if="hasRelationDegree"
106
142
  v-model="member.relationDegree"
107
143
  :value="member.relationDegree?.nameRu"
108
144
  :readonly="isDisabled"
@@ -231,7 +267,7 @@
231
267
  append-inner-icon="mdi mdi-calendar-blank-outline"
232
268
  />
233
269
  </base-form-section>
234
- <base-form-section :title="$dataStore.t('form.jobData')" v-if="$dataStore.hasJobSection(whichForm)">
270
+ <base-form-section v-if="$dataStore.hasJobSection(whichForm)" :title="$dataStore.t('form.jobData')">
235
271
  <base-form-input v-model.trim="member.job" :label="$dataStore.t('form.job')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required" />
236
272
  <base-form-input v-model.trim="member.jobPosition" :label="$dataStore.t('form.jobPosition')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required" />
237
273
  <base-form-input v-model.trim="member.jobPlace" :label="$dataStore.t('form.jobPlace')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required" />
@@ -244,7 +280,7 @@
244
280
  :readonly="isDisabled"
245
281
  :clearable="!isDisabled"
246
282
  :label="$dataStore.t('form.Country')"
247
- :rules="$rules.objectRequired"
283
+ :rules="member.isInsuredUnderage ? [] : $rules.objectRequired"
248
284
  append-inner-icon="mdi mdi-chevron-right"
249
285
  @append="openPanel($dataStore.t('form.Country'), [], 'registrationCountry', $dataStore.getCountries)"
250
286
  />
@@ -256,7 +292,7 @@
256
292
  :label="$dataStore.t('form.Province')"
257
293
  :readonly="isDisabled"
258
294
  :clearable="!isDisabled"
259
- :rules="$rules.objectRequired"
295
+ :rules="member.isInsuredUnderage ? [] : $rules.objectRequired"
260
296
  append-inner-icon="mdi mdi-chevron-right"
261
297
  @append="openPanel($dataStore.t('form.Province'), [], 'registrationProvince', $dataStore.getStates, 'registrationCountry')"
262
298
  />
@@ -266,7 +302,7 @@
266
302
  :label="$dataStore.t('form.RegionType')"
267
303
  :readonly="isDisabled"
268
304
  :clearable="!isDisabled"
269
- :rules="$rules.objectRequired"
305
+ :rules="member.isInsuredUnderage ? [] : $rules.objectRequired"
270
306
  append-inner-icon="mdi mdi-chevron-right"
271
307
  @append="openPanel($dataStore.t('form.RegionType'), [], 'registrationRegionType', $dataStore.getLocalityTypes)"
272
308
  />
@@ -277,7 +313,7 @@
277
313
  :label="$dataStore.t('form.Region')"
278
314
  :readonly="isDisabled"
279
315
  :clearable="!isDisabled"
280
- :rules="$rules.objectRequired"
316
+ :rules="member.isInsuredUnderage ? [] : $rules.objectRequired"
281
317
  append-inner-icon="mdi mdi-chevron-right"
282
318
  @append="openPanel($dataStore.t('form.Region'), [], 'registrationRegion', $dataStore.getRegions, 'registrationProvince')"
283
319
  />
@@ -287,7 +323,7 @@
287
323
  :label="$dataStore.t('form.City')"
288
324
  :readonly="isDisabled"
289
325
  :clearable="!isDisabled"
290
- :rules="$rules.objectRequired"
326
+ :rules="member.isInsuredUnderage ? [] : $rules.objectRequired"
291
327
  append-inner-icon="mdi mdi-chevron-right"
292
328
  @append="openPanel($dataStore.t('form.City'), [], 'registrationCity', $dataStore.getCities, 'registrationProvince')"
293
329
  />
@@ -297,14 +333,14 @@
297
333
  <base-form-input v-model.trim="member.registrationMicroDistrict" :readonly="isDisabled" :clearable="!isDisabled" :label="$dataStore.t('form.MicroDistrict')" />
298
334
  <base-form-input
299
335
  v-model.trim="member.registrationStreet"
300
- :rules="$rules.required"
336
+ :rules="member.isInsuredUnderage ? [] : $rules.required"
301
337
  :readonly="isDisabled"
302
338
  :clearable="!isDisabled"
303
339
  :label="$dataStore.t('form.Street')"
304
340
  />
305
341
  <base-form-input
306
342
  v-model.trim="member.registrationNumberHouse"
307
- :rules="$rules.required"
343
+ :rules="member.isInsuredUnderage ? [] : $rules.required"
308
344
  :readonly="isDisabled"
309
345
  :clearable="!isDisabled"
310
346
  :label="$dataStore.t('form.NumberHouse')"
@@ -391,6 +427,7 @@
391
427
  />
392
428
  </base-fade-transition>
393
429
  <base-panel-input
430
+ v-if="!$dataStore.isLifetrip"
394
431
  v-model="member.signOfResidency"
395
432
  :value="member.signOfResidency?.nameRu"
396
433
  :label="$dataStore.t('form.signOfResidency')"
@@ -474,7 +511,7 @@
474
511
  :label="$dataStore.t('form.homePhone')"
475
512
  :readonly="isDisabled"
476
513
  :clearable="!isDisabled"
477
- :rules="whichForm === formStore.beneficiaryFormKey ? [] : $rules.phoneFormat"
514
+ :rules="whichForm === formStore.beneficiaryFormKey || member.isInsuredUnderage ? [] : $rules.phoneFormat"
478
515
  />
479
516
  <base-form-input v-model.trim="member.email" :label="$dataStore.t('form.email')" :rules="$rules.email" />
480
517
  </base-form-section>
@@ -615,7 +652,12 @@ export default {
615
652
  }
616
653
  return true;
617
654
  }
618
- case formStore.insuredFormKey:
655
+ case formStore.insuredFormKey: {
656
+ if (dataStore.isLifetrip && member.value.isInsuredUnderage) {
657
+ return false;
658
+ }
659
+ return true;
660
+ }
619
661
  case formStore.beneficialOwnerFormKey:
620
662
  case formStore.policyholdersRepresentativeFormKey:
621
663
  return true;
@@ -647,7 +689,25 @@ export default {
647
689
  return dataStore.controls.hasGKB && !!dataStore.isTask() && perMemberCondition();
648
690
  });
649
691
  const hasMemberSearch = computed(() => showSaveButton.value && (hasGBDFL.value || hasGKB.value || hasInsis.value));
692
+ const hasMiddleName = computed(() => {
693
+ if (dataStore.isLifetrip) {
694
+ return false;
695
+ }
696
+ return true;
697
+ });
698
+ const hasRelationDegree = computed(() => {
699
+ if (dataStore.isLifetrip) {
700
+ return false;
701
+ }
702
+ if ((whichForm.value === formStore.beneficiaryFormKey || whichForm.value === formStore.insuredFormKey) && member.value.iin !== formStore.policyholderForm.iin) {
703
+ return true;
704
+ }
705
+ return false;
706
+ });
650
707
  const hasFamilyStatus = computed(() => {
708
+ if (dataStore.isLifetrip) {
709
+ return false;
710
+ }
651
711
  if (whichForm.value === formStore.beneficiaryFormKey) {
652
712
  if (dataStore.isBolashak) {
653
713
  return false;
@@ -664,7 +724,7 @@ export default {
664
724
  return false;
665
725
  });
666
726
  const hasSignOfIPDL = computed(() => {
667
- if (dataStore.isGons) {
727
+ if (dataStore.isGons || dataStore.isLifetrip) {
668
728
  return false;
669
729
  }
670
730
  return true;
@@ -683,6 +743,9 @@ export default {
683
743
  if (dataStore.isBolashak || dataStore.isBaiterek) {
684
744
  return dataStore.rules.age18ByDate;
685
745
  }
746
+ if (dataStore.isLifetrip) {
747
+ return dataStore.rules.ageExceeds80ByDate;
748
+ }
686
749
  }
687
750
  return [];
688
751
  };
@@ -714,10 +777,16 @@ export default {
714
777
  const phoneRule = computed(() => {
715
778
  const basePhoneRule = dataStore.rules.required.concat(dataStore.rules.phoneFormat);
716
779
  if (whichForm.value === formStore.beneficiaryFormKey) {
780
+ if (dataStore.isGons || dataStore.isBolashak) {
781
+ return [];
782
+ }
717
783
  if (member.value.age !== null && Number(member.value.age) < 18) {
718
784
  return [];
719
785
  }
720
786
  }
787
+ if (member.value.isInsuredUnderage) {
788
+ return [];
789
+ }
721
790
  return basePhoneRule;
722
791
  });
723
792
 
@@ -728,6 +797,9 @@ export default {
728
797
  return baseResidencyRule.concat(dataStore.rules.noResident);
729
798
  }
730
799
  }
800
+ if (dataStore.isLifetrip) {
801
+ return baseResidencyRule.concat(dataStore.rules.noResidentOffline);
802
+ }
731
803
  return baseResidencyRule;
732
804
  });
733
805
 
@@ -746,6 +818,7 @@ export default {
746
818
  // Add conditions by product
747
819
  if (member.value.hasAgreement) return false;
748
820
  if (whichForm.value === formStore.beneficiaryFormKey && member.value.age !== null && Number(member.value.age) < 18) return false;
821
+ if (dataStore.isLifetrip && whichForm.value === formStore.insuredFormKey && member.value.isInsuredUnderage) return false;
749
822
  if (!member.value.phoneNumber || (member.value.phoneNumber && member.value.phoneNumber.length !== useMask().phone.length)) return false;
750
823
  return getOtpConditionByMember();
751
824
  });
@@ -1040,14 +1113,17 @@ export default {
1040
1113
  if (!isSaved) return false;
1041
1114
  if (whichForm.value === formStore.policyholderFormKey) {
1042
1115
  if (isInsured === true || remoteIsInsured.value === true) {
1043
- formStore.insuredForm[0] = formStore.policyholderForm;
1044
- const isInsuredSaved = await dataStore.saveMember(
1045
- member.value,
1046
- memberStore.getMemberCode(formStore.insuredFormKey)!,
1047
- memberStore.getMemberFromApplication(formStore.insuredFormKey, formStore.insuredFormIndex),
1048
- );
1049
- if (!isInsuredSaved) return false;
1050
- wasInsuredAction.value = true;
1116
+ const insuredFormIndex = remoteIsInsured.value === true ? 0 : isInsured === true ? formStore.insuredForm.findIndex(i => i.iin === formStore.policyholderForm.iin) : -1;
1117
+ if (insuredFormIndex !== -1) {
1118
+ formStore.insuredForm[insuredFormIndex] = formStore.policyholderForm;
1119
+ const isInsuredSaved = await dataStore.saveMember(
1120
+ member.value,
1121
+ memberStore.getMemberCode(formStore.insuredFormKey)!,
1122
+ memberStore.getMemberFromApplication(formStore.insuredFormKey, insuredFormIndex),
1123
+ );
1124
+ if (!isInsuredSaved) return false;
1125
+ wasInsuredAction.value = true;
1126
+ }
1051
1127
  }
1052
1128
  }
1053
1129
  if (whichForm.value === formStore.insuredFormKey) {
@@ -1080,6 +1156,11 @@ export default {
1080
1156
  return true;
1081
1157
  }
1082
1158
  }
1159
+ if (whichForm.value === formStore.insuredFormKey) {
1160
+ if (dataStore.isLifetrip && member.value.isInsuredUnderage) {
1161
+ return true;
1162
+ }
1163
+ }
1083
1164
  if (member.value.hasAgreement !== true) {
1084
1165
  dataStore.showToaster('error', dataStore.t('toaster.needAgreement'));
1085
1166
  return false;
@@ -1094,9 +1175,14 @@ export default {
1094
1175
  if (v.valid) {
1095
1176
  isSubmittingForm.value = true;
1096
1177
  const docType = member.value.documentType.ids;
1097
- if (member.value.gotFromInsis === true && (docType === '1UDL' || docType === 'SBI')) {
1178
+ if (member.value.gotFromInsis === true && (docType === '1UDL' || docType === 'SBI' || docType === 'PS')) {
1098
1179
  dataStore.isLoading = true;
1099
- const ESBDResponse = await validateESBD(docType === '1UDL' ? 1 : 3);
1180
+ const docTypeCodes = {
1181
+ '1UDL': 1,
1182
+ PS: 2,
1183
+ SBI: 3,
1184
+ };
1185
+ const ESBDResponse = await validateESBD(docTypeCodes[docType]);
1100
1186
  if (!ESBDResponse) {
1101
1187
  dataStore.isLoading = false;
1102
1188
  return;
@@ -1175,6 +1261,15 @@ export default {
1175
1261
  if (setDefaults.percentage) {
1176
1262
  setPercentage();
1177
1263
  }
1264
+ if (setDefaults.signOfResidency) {
1265
+ setSignOfResidency();
1266
+ }
1267
+ if (setDefaults.countryOfTaxResidency) {
1268
+ setCountryOfTaxResidency();
1269
+ }
1270
+ if (setDefaults.countryOfCitizenship) {
1271
+ setCountryOfCitizenship();
1272
+ }
1178
1273
  };
1179
1274
 
1180
1275
  const setSectorCode = async () => {
@@ -1184,7 +1279,27 @@ export default {
1184
1279
  member.value.economySectorCode = defaultValue ? defaultValue : new Value();
1185
1280
  }
1186
1281
  };
1187
-
1282
+ const setSignOfResidency = async () => {
1283
+ if (member.value.id === 0 && route.query.id === '0') {
1284
+ const residents = await dataStore.getResidents();
1285
+ const defaultValue = residents.find(item => String(item.nameRu).match(new RegExp('Резидент', 'i'))) as Value;
1286
+ member.value.signOfResidency = defaultValue ? defaultValue : new Value();
1287
+ }
1288
+ };
1289
+ const setCountryOfTaxResidency = async () => {
1290
+ if (member.value.id === 0 && route.query.id === '0') {
1291
+ const taxCountries = await dataStore.getTaxCountries();
1292
+ const defaultValue = taxCountries.find(item => String(item.nameRu).match(new RegExp('Казахстан', 'i'))) as Value;
1293
+ member.value.countryOfTaxResidency = defaultValue ? defaultValue : new Value();
1294
+ }
1295
+ };
1296
+ const setCountryOfCitizenship = async () => {
1297
+ if (member.value.id === 0 && route.query.id === '0') {
1298
+ const citizenshipCountries = await dataStore.getCitizenshipCountries();
1299
+ const defaultValue = citizenshipCountries.find(item => String(item.nameRu).match(new RegExp('Казахстан', 'i'))) as Value;
1300
+ member.value.countryOfCitizenship = defaultValue ? defaultValue : new Value();
1301
+ }
1302
+ };
1188
1303
  const setPercentage = () => {
1189
1304
  if (whichForm.value === formStore.beneficiaryFormKey && member.value.id === 0 && route.query.id === '0' && member.value.percentageOfPayoutAmount === null) {
1190
1305
  if (dataStore.members.beneficiaryApp.isMultiple) {
@@ -1324,6 +1439,30 @@ export default {
1324
1439
  searchQuery.value = '';
1325
1440
  }
1326
1441
  });
1442
+ if (dataStore.isLifetrip) {
1443
+ watch(
1444
+ () => member.value.age,
1445
+ val => {
1446
+ if (val && Number(val) >= 18) {
1447
+ if (member.value.hasAgreement !== true) {
1448
+ member.value.hasAgreement = false;
1449
+ }
1450
+ } else {
1451
+ member.value.hasAgreement = true;
1452
+ }
1453
+ member.value.isInsuredUnderage = Number(val) >= 18 ? false : true;
1454
+ },
1455
+ );
1456
+ watch(
1457
+ () => member.value.isInsuredUnderage,
1458
+ val => {
1459
+ if (val === true && Number(member.value.age) >= 18) {
1460
+ member.value.isInsuredUnderage = false;
1461
+ return dataStore.showToaster('error', dataStore.t('toaster.underageShouldBeLess18'), 3000);
1462
+ }
1463
+ },
1464
+ );
1465
+ }
1327
1466
 
1328
1467
  return {
1329
1468
  // State
@@ -1365,6 +1504,8 @@ export default {
1365
1504
  hasGBDFL,
1366
1505
  hasInsis,
1367
1506
  hasGKB,
1507
+ hasMiddleName,
1508
+ hasRelationDegree,
1368
1509
  hasFamilyStatus,
1369
1510
  hasInsurancePay,
1370
1511
  hasSignOfIPDL,