hl-core 0.0.9-beta.41 → 0.0.9-beta.42-test

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.
@@ -754,6 +754,7 @@ export class ProductConditions {
754
754
  statePremium5: number | string | null;
755
755
  statePremium7: number | string | null;
756
756
  calculatorForm: CalculatorForm;
757
+ agentCommission: number | null;
757
758
  constructor(
758
759
  insuranceCase = null,
759
760
  coverPeriod = null,
@@ -796,6 +797,7 @@ export class ProductConditions {
796
797
  statePremium5 = null,
797
798
  statePremium7 = null,
798
799
  calculatorForm = new CalculatorForm(),
800
+ agentCommission = null,
799
801
  ) {
800
802
  this.requestedSumInsuredInDollar = null;
801
803
  this.insurancePremiumPerMonthInDollar = null;
@@ -843,6 +845,7 @@ export class ProductConditions {
843
845
  this.statePremium5 = statePremium5;
844
846
  this.statePremium7 = statePremium7;
845
847
  this.calculatorForm = calculatorForm;
848
+ this.agentCommission = agentCommission;
846
849
  }
847
850
  getSingleTripDays() {
848
851
  if (this.calculatorForm.startDate && this.calculatorForm.endDate) {
@@ -1238,13 +1241,7 @@ export class FormStoreClass {
1238
1241
  signedContractFormData: any;
1239
1242
  lfb: {
1240
1243
  clients: ClientV2[];
1241
- policyholder: {
1242
- isIpdl: boolean;
1243
- clientData: {
1244
- company: MemberV2;
1245
- authoritedPerson: MemberV2;
1246
- };
1247
- };
1244
+ policyholder: PolicyholderClass;
1248
1245
  hasAccidentIncidents: boolean;
1249
1246
  accidentIncidents: AccidentIncidents[];
1250
1247
  policyholderActivities: PolicyholderActivity[];
@@ -1352,13 +1349,7 @@ export class FormStoreClass {
1352
1349
  this.signedContractFormData = null;
1353
1350
  this.lfb = {
1354
1351
  clients: [],
1355
- policyholder: {
1356
- isIpdl: false,
1357
- clientData: {
1358
- company: new MemberV2(),
1359
- authoritedPerson: new MemberV2(),
1360
- },
1361
- },
1352
+ policyholder: new PolicyholderClass(),
1362
1353
  hasAccidentIncidents: true,
1363
1354
  policyholderActivities: [new PolicyholderActivity()],
1364
1355
  beneficialOwners: [new BeneficialOwner()],
@@ -1453,111 +1444,144 @@ export class FormStoreClass {
1453
1444
  }
1454
1445
  }
1455
1446
 
1456
- export class MemberV2 {
1457
- iin: string | null;
1458
- phoneNumber: string | null;
1459
- firstName?: string | null;
1460
- middleName?: string | null;
1461
- lastName?: string | null;
1462
- name?: string | null;
1463
- longName?: string | null;
1464
- nameKz?: string | null;
1465
- longNameKz?: string | null;
1447
+ export class Address {
1448
+ country: Value;
1449
+ region: Value;
1450
+ regionType: Value;
1451
+ city: Value;
1452
+ square: string | null;
1453
+ microdistrict: string | null;
1454
+ street: string | null;
1455
+ houseNumber: string | null;
1456
+ kato: string | null;
1457
+ longName: string | null;
1458
+ longNameKz: string | null;
1459
+ constructor() {
1460
+ this.country = new Value();
1461
+ this.region = new Value();
1462
+ this.regionType = new Value();
1463
+ this.city = new Value();
1464
+ this.square = null;
1465
+ this.microdistrict = null;
1466
+ this.street = null;
1467
+ this.houseNumber = null;
1468
+ this.kato = null;
1469
+ this.longName = null;
1470
+ this.longNameKz = null;
1471
+ }
1472
+ }
1473
+
1474
+ export class PolicyholderActivity {
1475
+ activityTypeName: string | null;
1476
+ empoloyeeCount: string | null;
1477
+ constructor() {
1478
+ this.activityTypeName = null;
1479
+ this.empoloyeeCount = null;
1480
+ }
1481
+ }
1482
+
1483
+ export class BaseGroupClass {
1484
+ id: string | number;
1485
+ longName: string;
1486
+ iin: string;
1487
+ phoneNumber: string;
1488
+ age: string;
1489
+ name: string;
1490
+ nameKz: string;
1491
+ longNameKz: string;
1466
1492
  citizenship: Value;
1467
- email: string | null;
1493
+ email: string;
1468
1494
  resident: Value;
1469
1495
  taxResidentCountry: Value;
1496
+ addTaxResidency: Value;
1470
1497
  economySectorCode: Value;
1498
+ hasAttachedFile: boolean;
1499
+ actualAddress: Address;
1471
1500
  isActualAddressEqualLegalAddres: boolean;
1472
- identityDocument?: {
1501
+ legalAddress: Address;
1502
+ identityDocument: {
1473
1503
  documentType: Value;
1474
- documentNumber: string | null;
1475
- series: string | null;
1504
+ documentNumber: string;
1505
+ series: string;
1476
1506
  issuedBy: Value;
1477
1507
  validUntil: string | null;
1478
1508
  };
1479
- bankInfo: {
1480
- bin: string | null;
1481
- bankName: Value;
1482
- iik: string | null;
1483
- bik: string | null;
1484
- kbe: string | null;
1485
- };
1486
- workDetails?: {
1487
- workplace: string | null;
1488
- position: string | null;
1489
- jobDuties: string | null;
1490
- };
1491
- authorityDetails: {
1492
- basis: string | null;
1493
- documentNumber: string | null;
1494
- date: string | null;
1495
- };
1496
- kbe: string | null;
1497
- typeOfEconomicActivity: Value;
1498
- legalAddress: Address;
1499
- actualAddress: Address;
1500
- activityTypes: {
1501
- activityTypeName: string | null;
1502
- empoloyeeCount: number | null;
1503
- }[];
1504
- isLeader?: boolean;
1505
- beneficalOwnerQuest?: {
1506
- order: number;
1507
- text: string | null;
1508
- answer: boolean | null;
1509
- }[];
1509
+ bankInfo: BankInfoClass;
1510
+ kbe: string;
1510
1511
  constructor() {
1511
- this.iin = null;
1512
- this.phoneNumber = null;
1513
- this.firstName = null;
1514
- this.middleName = null;
1515
- this.lastName = null;
1516
- this.name = null;
1517
- this.longName = null;
1518
- this.nameKz = null;
1519
- this.longNameKz = null;
1512
+ this.id = 0;
1513
+ this.longName = '';
1514
+ this.iin = '';
1515
+ this.phoneNumber = '';
1516
+ this.age = '';
1517
+ this.name = '';
1518
+ this.nameKz = '';
1519
+ this.longNameKz = '';
1520
1520
  this.citizenship = new Value();
1521
- this.email = null;
1521
+ this.email = '';
1522
1522
  this.resident = new Value();
1523
1523
  this.taxResidentCountry = new Value();
1524
+ this.addTaxResidency = new Value();
1524
1525
  this.economySectorCode = new Value();
1526
+ this.hasAttachedFile = false;
1527
+ this.actualAddress = new Address();
1525
1528
  this.isActualAddressEqualLegalAddres = true;
1529
+ this.legalAddress = new Address();
1526
1530
  this.identityDocument = {
1527
1531
  documentType: new Value(),
1528
- documentNumber: null,
1529
- series: null,
1532
+ documentNumber: '',
1533
+ series: '',
1530
1534
  issuedBy: new Value(),
1531
- validUntil: null,
1532
- };
1533
- this.bankInfo = {
1534
- bin: null,
1535
- bankName: new Value(),
1536
- iik: null,
1537
- bik: null,
1538
- kbe: null,
1539
- };
1540
- this.workDetails = {
1541
- workplace: null,
1542
- position: null,
1543
- jobDuties: null,
1535
+ validUntil: '',
1544
1536
  };
1537
+ this.bankInfo = new BankInfoClass();
1538
+ this.kbe = '';
1539
+ }
1540
+ }
1541
+
1542
+ export class PhysGroupClass extends BaseGroupClass {
1543
+ lastName: string;
1544
+ firstName: string;
1545
+ middleName: string;
1546
+ birthDate: string | null;
1547
+ placeOfBirth: Value;
1548
+ workDetails: { workplace: string; position: string; jobDuties: string };
1549
+ hasContactPerson: boolean;
1550
+ constructor() {
1551
+ super();
1552
+ this.lastName = '';
1553
+ this.firstName = '';
1554
+ this.middleName = '';
1555
+ this.birthDate = '';
1556
+ this.placeOfBirth = new Value();
1557
+ this.workDetails = { workplace: '', position: '', jobDuties: '' };
1558
+ this.hasContactPerson = false;
1559
+ }
1560
+ }
1561
+
1562
+ export class GroupMember extends PhysGroupClass {
1563
+ isLeader: boolean;
1564
+ authorityDetails: {
1565
+ basis: Value;
1566
+ documentNumber: string | null;
1567
+ date: string | null;
1568
+ };
1569
+ typeOfEconomicActivity: Value;
1570
+ activityTypes: { activityTypeName: string; empoloyeeCount: number }[];
1571
+ beneficalOwnerQuest: { order: number; text: string; answer: boolean | null }[];
1572
+ authoritedPerson: PhysGroupClass;
1573
+ insuredPolicyData: InsuredPolicyType;
1574
+ constructor() {
1575
+ super();
1576
+ // Client
1577
+ this.isLeader = false;
1545
1578
  this.authorityDetails = {
1546
- basis: null,
1579
+ basis: new Value(),
1547
1580
  documentNumber: null,
1548
1581
  date: null,
1549
1582
  };
1550
- this.kbe = null;
1551
1583
  this.typeOfEconomicActivity = new Value();
1552
- this.legalAddress = new Address();
1553
- this.actualAddress = new Address();
1554
- this.activityTypes = [
1555
- {
1556
- activityTypeName: null,
1557
- empoloyeeCount: null,
1558
- },
1559
- ];
1560
- this.isLeader = false;
1584
+ this.activityTypes = [];
1561
1585
  this.beneficalOwnerQuest = [
1562
1586
  {
1563
1587
  order: 0,
@@ -1575,82 +1599,60 @@ export class MemberV2 {
1575
1599
  answer: null,
1576
1600
  },
1577
1601
  ];
1602
+ this.authoritedPerson = new PhysGroupClass();
1603
+ // Insured
1604
+ this.insuredPolicyData = {
1605
+ insSum: 0,
1606
+ insSumWithLoad: 0,
1607
+ premium: 0,
1608
+ premiumWithLoad: 0,
1609
+ insuredRisk: {
1610
+ lifeMultiply: 0,
1611
+ lifeAdditive: 0,
1612
+ disabilityMultiply: 0,
1613
+ disabilityAdditive: 0,
1614
+ traumaTableMultiple: 0,
1615
+ accidentalLifeMultiply: 0,
1616
+ accidentalLifeAdditive: 0,
1617
+ criticalMultiply: 0,
1618
+ criticalAdditive: 0,
1619
+ },
1620
+ insuredCoverData: [],
1621
+ };
1578
1622
  }
1579
1623
  }
1580
1624
 
1581
- export class Address {
1582
- country: Value;
1583
- region: Value;
1584
- regionType: Value;
1585
- city: Value;
1586
- square: string | null;
1587
- microdistrict: string | null;
1588
- street: string | null;
1589
- houseNumber: string | null;
1590
- kato: string | null;
1625
+ export class BankInfoClass {
1626
+ bankName: Value;
1627
+ bin: string;
1628
+ iik: string;
1629
+ bik: string;
1630
+ kbe: string;
1591
1631
  constructor() {
1592
- this.country = new Value();
1593
- this.region = new Value();
1594
- this.regionType = new Value();
1595
- this.city = new Value();
1596
- this.square = null;
1597
- this.microdistrict = null;
1598
- this.street = null;
1599
- this.houseNumber = null;
1600
- this.kato = null;
1632
+ this.bankName = new Value();
1633
+ this.bin = '';
1634
+ this.iik = '';
1635
+ this.bik = '';
1636
+ this.kbe = '';
1601
1637
  }
1602
1638
  }
1603
1639
 
1604
- export class PolicyholderActivity {
1605
- activityTypeName: string | null;
1606
- empoloyeeCount: string | null;
1640
+ export class PolicyholderClass {
1641
+ isIpdl: boolean;
1642
+ clientData: GroupMember;
1607
1643
  constructor() {
1608
- this.activityTypeName = null;
1609
- this.empoloyeeCount = null;
1644
+ this.isIpdl = false;
1645
+ this.clientData = new GroupMember();
1610
1646
  }
1611
1647
  }
1612
1648
 
1613
1649
  export class BeneficialOwner {
1614
- id: string | null;
1615
- processInstanceId: string | number;
1616
- insisId: number;
1617
- iin: string | null;
1618
- longName: string | null;
1650
+ id: string;
1619
1651
  isIpdl: boolean;
1620
- isTerror: boolean;
1621
- isIpdlCompliance: boolean;
1622
- isTerrorCompliance: boolean;
1623
- personType: number;
1624
- lastName: string | null;
1625
- firstName: string | null;
1626
- middleName: string | null;
1627
- countryId: string | null;
1628
- countryName: string | null;
1629
- residentId: string | null;
1630
- residentName: string | null;
1631
- taxResidentId: string | null;
1632
- taxResidentName: string | null;
1633
- beneficialOwnerData: MemberV2;
1652
+ beneficialOwnerData: GroupMember;
1634
1653
  constructor() {
1635
- this.id = null;
1636
- this.processInstanceId = 0;
1637
- this.insisId = 0;
1638
- this.iin = null;
1639
- this.longName = null;
1640
1654
  this.isIpdl = false;
1641
- this.isTerror = true;
1642
- this.isIpdlCompliance = true;
1643
- this.isTerrorCompliance = true;
1644
- this.personType = 0;
1645
- this.lastName = null;
1646
- this.firstName = null;
1647
- this.middleName = null;
1648
- this.countryId = null;
1649
- this.countryName = null;
1650
- this.residentId = null;
1651
- this.residentName = null;
1652
- this.taxResidentId = null;
1653
- this.taxResidentName = null;
1654
- this.beneficialOwnerData = new MemberV2();
1655
+ this.beneficialOwnerData = new GroupMember();
1656
+ this.id = '';
1655
1657
  }
1656
1658
  }
package/locales/ru.json CHANGED
@@ -725,7 +725,11 @@
725
725
  "attachApplication": "Вложить приложение №1",
726
726
  "attachPowerOfAttorney": "Вложить доверенность",
727
727
  "noDocuments": "Нет документов для просмотра",
728
- "address": "Адрес"
728
+ "address": "Адрес",
729
+ "premiumWithLoad": "Страховая премия за факт период (с нагрузкой)",
730
+ "premiumWithoutLoad": "Страховая премия за факт период (без нагрузки)",
731
+ "policyStartDate": "Дата начала действия полиса",
732
+ "policyEndDate": "Дата окончания действия полиса",
729
733
  },
730
734
  "placeholders": {
731
735
  "login": "Логин",
@@ -761,7 +765,8 @@
761
765
  "calculationPreliminary": "Расчет предварительный. Требуется заполнить все необходимые данные",
762
766
  "planDate": "Дата должна превышать сегодняшнюю дату",
763
767
  "iik": "ИИК должен состоять из 20 символов",
764
- "dataInPast": "Указанная дата осталась в прошлом"
768
+ "dataInPast": "Указанная дата осталась в прошлом",
769
+ "agentCommission": "Агентская комиссия не должно превышать 50"
765
770
  },
766
771
  "code": "КСЭ",
767
772
  "fontSize": "Размер шрифта",
@@ -915,6 +920,7 @@
915
920
  "coveragePeriod": "Период покрытия",
916
921
  "attachScansSignDocs": "Вложить сканы подписанных документов",
917
922
  "declarationHealthInsured": "Декларация о здоровье Застрахованных",
923
+ "uploadInsured": "Загрузите застрахованных",
918
924
  "form": {
919
925
  "calculation": "Расчеты",
920
926
  "paymentAmount": "Размер выплаты",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.9-beta.41",
3
+ "version": "0.0.9-beta.42-test",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -3,7 +3,18 @@ import { rules } from './rules';
3
3
  import { i18n } from '../configs/i18n';
4
4
  import { Toast, Types, Positions, ToastOptions } from './toast';
5
5
  import { isValidGUID, yearEnding, jwtDecode, ErrorHandler, getKeyWithPattern, getNumber, getAgeByBirthDate } from '../composables';
6
- import { DataStoreClass, Contragent, DocumentItem, Member, Value, CountryValue, MemberV2, PolicyholderActivity, BeneficialOwner } from '../composables/classes';
6
+ import {
7
+ DataStoreClass,
8
+ Contragent,
9
+ DocumentItem,
10
+ Member,
11
+ Value,
12
+ CountryValue,
13
+ PolicyholderActivity,
14
+ BeneficialOwner,
15
+ GroupMember,
16
+ PolicyholderClass,
17
+ } from '../composables/classes';
7
18
  import { ApiClass } from '../api';
8
19
  import { useFormStore } from './form.store';
9
20
  import { AxiosError } from 'axios';
@@ -1038,7 +1049,7 @@ export const useDataStore = defineStore('data', {
1038
1049
  if (this.isLifeBusiness) {
1039
1050
  conditionsData.policyAppDto.insTermInMonth = Number(this.formStore.productConditionsForm.coverPeriod);
1040
1051
  conditionsData.policyAppDto.fixInsSum = getNumber(String(this.formStore.productConditionsForm.requestedSumInsured));
1041
- conditionsData.policyAppDto.tariffId = String(this.formStore.productConditionsForm.processTariff.id);
1052
+ conditionsData.policyAppDto.agentCommission = Number(this.formStore.productConditionsForm.agentCommission);
1042
1053
  conditionsData.policyAppDto.processDefinitionFgotId = (this.formStore.productConditionsForm.processGfot.id as string) ?? undefined;
1043
1054
  }
1044
1055
  return conditionsData;
@@ -1320,7 +1331,7 @@ export const useDataStore = defineStore('data', {
1320
1331
  }
1321
1332
  return this.cities;
1322
1333
  },
1323
- async getCitiesEfo(key?: string, member?: MemberV2, parentKey?: string) {
1334
+ async getCitiesEfo(key?: string, member?: any, parentKey?: string) {
1324
1335
  if (this.isLifeBusiness) {
1325
1336
  await this.getFromApi('cities', 'getCities');
1326
1337
  //@ts-ignore
@@ -1784,7 +1795,7 @@ export const useDataStore = defineStore('data', {
1784
1795
  calculationData.insrCount = this.formStore.lfb.clients.length;
1785
1796
  calculationData.insTermInMonth = Number(this.formStore.productConditionsForm.coverPeriod);
1786
1797
  calculationData.fixInsSum = getNumber(String(this.formStore.productConditionsForm.requestedSumInsured));
1787
- calculationData.agentCommission = this.formStore.productConditionsForm.processTariff.id;
1798
+ calculationData.agentCommission = Number(this.formStore.productConditionsForm.agentCommission);
1788
1799
  calculationData.processDefinitionFgotId = this.formStore.productConditionsForm.processGfot.id;
1789
1800
  }
1790
1801
  const calculationResponse = await this.api.calculateWithoutApplication(calculationData, this.isCalculator ? product : undefined);
@@ -1811,6 +1822,9 @@ export const useDataStore = defineStore('data', {
1811
1822
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.mainPremium);
1812
1823
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.fixInsSum === 0 ? null : calculationResponse.fixInsSum);
1813
1824
  this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
1825
+ if (calculationResponse.agentCommission) {
1826
+ this.formStore.productConditionsForm.agentCommission = calculationResponse.agentCommission;
1827
+ }
1814
1828
  if (calculationResponse.clients) {
1815
1829
  this.formStore.lfb.clients = calculationResponse.clients;
1816
1830
  }
@@ -3104,18 +3118,48 @@ export const useDataStore = defineStore('data', {
3104
3118
  const economySectorCode = this.economySectorCode.find((i: Value) => i.ids === '500003.9');
3105
3119
  if (economySectorCode) member.economySectorCode = economySectorCode;
3106
3120
  },
3107
- async startApplicationV2(data: any) {
3108
- const policyholder = data.clientData;
3109
- if (!policyholder.authoritedPerson.iin) return false;
3121
+ preparePersonData(data: any) {
3122
+ if (data) {
3123
+ Object.keys(data).forEach(key => {
3124
+ const dataKeys = key as keyof typeof data;
3125
+ if (data[dataKeys] === Object(data[dataKeys])) {
3126
+ if (!!data[dataKeys]) {
3127
+ this.preparePersonData(data[dataKeys]);
3128
+ }
3129
+ } else {
3130
+ if (data[dataKeys] !== null) {
3131
+ if (dataKeys === 'iin' || dataKeys === 'bin') {
3132
+ //@ts-ignore
3133
+ data[dataKeys] = data[dataKeys].replace(/-/g, '');
3134
+ }
3135
+ if (dataKeys === 'phoneNumber') data[dataKeys] = formatPhone(data[dataKeys]);
3136
+ if (dataKeys === 'issuedOn' || dataKeys === 'validUntil' || dataKeys === 'birthDate') data[dataKeys] = formatDate(data[dataKeys])?.toISOString() ?? '';
3137
+ //@ts-ignore
3138
+ if (dataKeys === 'nameRu' && data['ids']) data['id'] = data['ids'];
3139
+ }
3140
+ }
3141
+ });
3142
+ }
3143
+ },
3144
+ async startApplicationV2(data: PolicyholderClass) {
3145
+ const policyholder = JSON.parse(JSON.stringify(data)) as any;
3146
+ this.preparePersonData(policyholder);
3147
+ delete policyholder.clientData.beneficalOwnerQuest;
3148
+ delete policyholder.clientData.identityDocument;
3149
+ delete policyholder.clientData.authoritedPerson.identityDocument;
3150
+ delete policyholder.clientData.activityTypes;
3151
+ if (!policyholder.clientData.iin) return false;
3110
3152
  try {
3111
- const response = await this.api.startApplication(data);
3153
+ const response = await this.api.startApplication(policyholder);
3112
3154
  this.sendToParent(constants.postActions.applicationCreated, response.processInstanceId);
3113
3155
  return response.processInstanceId;
3114
3156
  } catch (err) {
3115
3157
  return ErrorHandler(err);
3116
3158
  }
3117
3159
  },
3118
- async saveClient(policyholder: any) {
3160
+ async saveClient(data: PolicyholderClass) {
3161
+ const policyholder = JSON.parse(JSON.stringify(data)) as any;
3162
+ this.preparePersonData(policyholder);
3119
3163
  try {
3120
3164
  await this.api.saveClient(this.formStore.applicationData.processInstanceId, this.formStore.lfb.clientId, policyholder);
3121
3165
  } catch (err) {
@@ -3156,12 +3200,12 @@ export const useDataStore = defineStore('data', {
3156
3200
 
3157
3201
  this.formStore.applicationData.processInstanceId = applicationData.processInstanceId;
3158
3202
  this.formStore.lfb.policyholder.isIpdl = applicationData.clientApp.isIpdl;
3159
- this.formStore.lfb.policyholder.clientData.company = clientData;
3203
+ this.formStore.lfb.policyholder.clientData = clientData;
3160
3204
  this.formStore.lfb.policyholder.clientData.authoritedPerson = clientData.authoritedPerson;
3161
- this.formStore.lfb.policyholder.clientData.company.iin = reformatIin(clientData.iin);
3205
+ this.formStore.lfb.policyholder.clientData.iin = reformatIin(clientData.iin);
3162
3206
  this.formStore.lfb.policyholder.clientData.authoritedPerson.iin = reformatIin(clientData.authoritedPerson.iin);
3163
3207
  this.formStore.lfb.clientId = clientId;
3164
- this.formStore.lfb.policyholder.clientData.company.authorityDetails.date = reformatDate(clientData.authorityDetails.date);
3208
+ this.formStore.lfb.policyholder.clientData.authorityDetails.date = reformatDate(clientData.authorityDetails.date);
3165
3209
 
3166
3210
  if (clientData && clientData.activityTypes !== null) {
3167
3211
  this.formStore.lfb.policyholderActivities = clientData.activityTypes;
@@ -3171,6 +3215,7 @@ export const useDataStore = defineStore('data', {
3171
3215
  this.formStore.lfb.beneficialOwners = beneficialOwnerApp;
3172
3216
  this.formStore.lfb.isPolicyholderBeneficialOwner = clientData.authoritedPerson.iin.replace(/-/g, '') === beneficialOwnerApp[0].beneficialOwnerData.iin ? true : false;
3173
3217
  this.formStore.lfb.beneficialOwners.forEach(beneficial => {
3218
+ beneficial.beneficialOwnerData.birthDate = reformatDate(beneficial.beneficialOwnerData.birthDate as string);
3174
3219
  beneficial.beneficialOwnerData.identityDocument!.validUntil = reformatDate(beneficial.beneficialOwnerData.identityDocument!.validUntil as string);
3175
3220
  beneficial.beneficialOwnerData.iin = reformatIin(beneficial.beneficialOwnerData.iin as string);
3176
3221
  });
@@ -3189,6 +3234,7 @@ export const useDataStore = defineStore('data', {
3189
3234
  });
3190
3235
  }
3191
3236
 
3237
+ this.formStore.productConditionsForm.agentCommission = applicationData.policyAppDto.agentCommission === 0 ? null : applicationData.policyAppDto.agentCommission;
3192
3238
  this.formStore.productConditionsForm.coverPeriod = 12;
3193
3239
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(applicationData.policyAppDto.amount === 0 ? null : applicationData.policyAppDto.amount);
3194
3240
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(
@@ -3196,8 +3242,6 @@ export const useDataStore = defineStore('data', {
3196
3242
  );
3197
3243
  const paymentPeriod = this.processPaymentPeriod.find(item => item.id == applicationData.policyAppDto.paymentPeriodId);
3198
3244
  this.formStore.productConditionsForm.paymentPeriod = paymentPeriod ? paymentPeriod : new Value();
3199
- const processTariff = this.processTariff.find(item => item.id == applicationData.policyAppDto.tariffId);
3200
- this.formStore.productConditionsForm.processTariff = processTariff ? processTariff : new Value();
3201
3245
  const processGfot = this.processGfot.find(item => item.id == applicationData.policyAppDto.processDefinitionFgotId);
3202
3246
  this.formStore.productConditionsForm.processGfot = processGfot ? processGfot : new Value();
3203
3247
  } catch (err) {
@@ -3218,15 +3262,33 @@ export const useDataStore = defineStore('data', {
3218
3262
  return ErrorHandler(err);
3219
3263
  }
3220
3264
  },
3221
- async saveClientAcivityTypes(data: PolicyholderActivity[]) {
3265
+ async saveClientActivityTypes(data: PolicyholderActivity[]) {
3222
3266
  try {
3223
- const response = await this.api.saveClientAcivityTypes(this.formStore.applicationData.clientApp.id, data);
3267
+ const response = await this.api.saveClientActivityTypes(this.formStore.applicationData.clientApp.id, data);
3224
3268
  return response;
3225
3269
  } catch (err) {
3226
3270
  return ErrorHandler(err);
3227
3271
  }
3228
3272
  },
3229
- async saveBeneficialOwnerList(beneficialOwnerList: BeneficialOwner[]) {
3273
+ async saveBeneficialOwnerList(data: BeneficialOwner[]) {
3274
+ const beneficialOwnerList = JSON.parse(JSON.stringify(data)) as any;
3275
+ for (const item of beneficialOwnerList) {
3276
+ delete item.beneficialOwnerData.identityDocument.issuedOn;
3277
+ delete item.beneficialOwnerData.activityTypes;
3278
+ delete item.beneficialOwnerData.actualAddress;
3279
+ delete item.beneficialOwnerData.addTaxResidency;
3280
+ delete item.beneficialOwnerData.authoritedPerson;
3281
+ delete item.beneficialOwnerData.authorityDetails;
3282
+ delete item.beneficialOwnerData.bankInfo;
3283
+ delete item.beneficialOwnerData.economySectorCode;
3284
+ delete item.beneficialOwnerData.legalAddress;
3285
+ delete item.beneficialOwnerData.placeOfBirth;
3286
+ delete item.beneficialOwnerData.resident;
3287
+ delete item.beneficialOwnerData.taxResidentCountry;
3288
+ delete item.beneficialOwnerData.typeOfEconomicActivity;
3289
+ item.processInstanceId = this.formStore.applicationData.processInstanceId;
3290
+ this.preparePersonData(item.beneficialOwnerData);
3291
+ }
3230
3292
  try {
3231
3293
  const response = await this.api.saveBeneficialOwnerList(this.formStore.applicationData.processInstanceId, beneficialOwnerList);
3232
3294
  return response;
@@ -3234,9 +3296,12 @@ export const useDataStore = defineStore('data', {
3234
3296
  return ErrorHandler(err);
3235
3297
  }
3236
3298
  },
3237
- async saveBeneficialOwner(beneficialOwner: BeneficialOwner) {
3299
+ async saveBeneficialOwner(data: BeneficialOwner) {
3300
+ const beneficialOwner = JSON.parse(JSON.stringify(data)) as any;
3301
+ delete beneficialOwner.beneficialOwnerData.identityDocument.issuedOn;
3302
+ this.preparePersonData(beneficialOwner.beneficialOwnerData);
3238
3303
  try {
3239
- const response = await this.api.saveBeneficialOwner(this.formStore.applicationData.processInstanceId, beneficialOwner.id, beneficialOwner);
3304
+ const response = await this.api.saveBeneficialOwner(this.formStore.applicationData.processInstanceId, String(beneficialOwner.id), beneficialOwner);
3240
3305
  return response;
3241
3306
  } catch (err) {
3242
3307
  return ErrorHandler(err);
@@ -3265,7 +3330,7 @@ export const useDataStore = defineStore('data', {
3265
3330
  id: index,
3266
3331
  fullName: client.longName,
3267
3332
  gender: client.gender,
3268
- position: item.workDetails?.position,
3333
+ position: client.workDetails.position,
3269
3334
  birthDate: client.birthDate,
3270
3335
  iin: reformatIin(client.iin),
3271
3336
  insSum: client.insuredPolicyData.insSum,
@@ -3323,7 +3388,7 @@ export const useDataStore = defineStore('data', {
3323
3388
  if (this.validateMultipleMembersV2('beneficialOwners', 'beneficialOwnerApp', 'бенефициарных собственников') === false) {
3324
3389
  return false;
3325
3390
  }
3326
- const inStatement = this.formStore.lfb.beneficialOwners.every(i => i.id !== null);
3391
+ const inStatement = this.formStore.lfb.beneficialOwners.every(i => i.beneficialOwnerData.id !== null);
3327
3392
  if (inStatement === false) {
3328
3393
  this.showToaster('error', this.t('toaster.requiredMember', { text: this.t('toaster.beneficialOwner') }));
3329
3394
  return false;
package/store/rules.ts CHANGED
@@ -9,6 +9,7 @@ export const rules = {
9
9
  recalculationAdditive: [(v: any) => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween', { floor: '0', ceil: '100' })],
10
10
  required: [(v: any) => !!v || t('rules.required')],
11
11
  iik: [(v: any) => v.length === 20 || t('rules.iik')],
12
+ agentCommission: [(v: any) => v <= 50 || t('rules.agentCommission')],
12
13
  objectRequired: [
13
14
  (v: any) => {
14
15
  if (!!v && 'nameRu' in v && v.nameRu != null) {
package/types/enum.ts CHANGED
@@ -40,9 +40,6 @@ export enum Actions {
40
40
  affiliate = 'affiliate',
41
41
  affiliateCustom = 'affiliateCustom',
42
42
 
43
- template = 'template',
44
- templateCustom = 'templateCustom',
45
-
46
43
  chooseSign = 'chooseSign',
47
44
  chooseSignCustom = 'chooseSignCustom',
48
45
  }