hl-core 0.0.10-beta.64 → 0.0.10-beta.65

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.
@@ -23,6 +23,7 @@ export class Masks {
23
23
  spacedNumbers: string = '### ### ### ### ### ### ###';
24
24
  iin: string = '###-###-###-###';
25
25
  phone: string = '+7 (7##) ### ## ##';
26
+ phoneNonResident: string = '+###############';
26
27
  date: string = '##.##.####';
27
28
  post: string = '######';
28
29
  threeDigit: string = '###';
@@ -47,6 +48,16 @@ export const getNumber = (number: string) => {
47
48
  return number ? Number(number.replace(/\s/g, '')) : null;
48
49
  };
49
50
 
51
+ export const parseAmount = (value: number | string | null): number | null => {
52
+ if (value === null) return null;
53
+ if (typeof value === 'number') return value;
54
+
55
+ const normalized = value.replace(/\s+/g, '');
56
+ const num = Number(normalized);
57
+
58
+ return Number.isNaN(num) ? null : num;
59
+ };
60
+
50
61
  export const formatDate = (date: string) => {
51
62
  if (date) {
52
63
  const data = date.split('.');
@@ -821,7 +832,18 @@ export class RoleController {
821
832
  if (dataStore.isCritical || product === 'criticalillness') return this.isBranchDirector();
822
833
  return false;
823
834
  })();
824
- return this.isManager() || this.isSalesManager() || this.isChiefSalesManager() || this.isChiefManagerNSZH() || this.isAgent() || this.isAgentMycar() || this.isManagerHalykBank() || this.isServiceManager() || this.isAgentAuletti() || hasAccessByProduct;
835
+ return (
836
+ this.isManager() ||
837
+ this.isSalesManager() ||
838
+ this.isChiefSalesManager() ||
839
+ this.isChiefManagerNSZH() ||
840
+ this.isAgent() ||
841
+ this.isAgentMycar() ||
842
+ this.isManagerHalykBank() ||
843
+ this.isServiceManager() ||
844
+ this.isAgentAuletti() ||
845
+ hasAccessByProduct
846
+ );
825
847
  };
826
848
  isManager = () => this.isRole(constants.roles.Manager);
827
849
  isSalesManager = () => this.isRole(constants.roles.SalesManager);
@@ -872,6 +894,9 @@ export class RoleController {
872
894
  isTravelAgent = () => this.isRole(constants.roles.TravelAgent);
873
895
  isHR = () => this.isRole(constants.roles.HR);
874
896
  isReInsurer = () => this.isRole(constants.roles.ReInsurer);
897
+ isSanctioner1 = () => this.isRole(constants.roles.Sanctioner1);
898
+ isSanctioner2 = () => this.isRole(constants.roles.Sanctioner2);
899
+ isSanctioner3 = () => this.isRole(constants.roles.Sanctioner3);
875
900
  hasAccess = () => {
876
901
  const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn() || this.isDsuioOrv() || this.isAuditor();
877
902
  return {
@@ -891,15 +916,12 @@ export class RoleController {
891
916
  this.isHeadAdjuster() ||
892
917
  this.isArchivist() ||
893
918
  this.isSecurity() ||
919
+ this.isSanctioner1() ||
920
+ this.isSanctioner2() ||
921
+ this.isSanctioner3() ||
894
922
  baseAccessRoles,
895
923
  toReinsurance: this.isReInsurer() || this.isAdjuster() || this.isHeadAdjuster() || baseAccessRoles,
896
- toReporting:
897
- this.isServiceManager() ||
898
- this.isManager() ||
899
- this.isSalesManager() ||
900
- this.isChiefSalesManager() ||
901
- this.isChiefManagerNSZH() ||
902
- baseAccessRoles,
924
+ toReporting: this.isServiceManager() || this.isManager() || this.isSalesManager() || this.isChiefSalesManager() || this.isChiefManagerNSZH() || baseAccessRoles,
903
925
  toDSO:
904
926
  this.isUsns() ||
905
927
  this.isDsuio() ||
@@ -914,6 +936,8 @@ export class RoleController {
914
936
  this.isAccountantDirector() ||
915
937
  baseAccessRoles,
916
938
  toEFO:
939
+ this.isAgentAuletti() ||
940
+ this.isManagerAuletti() ||
917
941
  this.isManager() ||
918
942
  this.isSalesManager() ||
919
943
  this.isChiefSalesManager() ||
@@ -935,7 +959,7 @@ export class RoleController {
935
959
  this.isJurist() ||
936
960
  this.isAccountant() ||
937
961
  this.isBranchDirector() ||
938
- this.isRegionDirector() ||
962
+ this.isRegionDirector() ||
939
963
  this.isUSNSACCINS() ||
940
964
  this.isDsuio() ||
941
965
  this.isAdjuster() ||
@@ -954,6 +978,9 @@ export class RoleController {
954
978
  this.isHR() ||
955
979
  this.isNotAccumulativeSanctionerUSNS() ||
956
980
  this.isReInsurer() ||
981
+ this.isSanctioner1() ||
982
+ this.isSanctioner2() ||
983
+ this.isSanctioner3() ||
957
984
  baseAccessRoles,
958
985
  };
959
986
  };
@@ -43,7 +43,7 @@ const openSettings = async () => {
43
43
 
44
44
  const onLink = async (item: MenuItem) => {
45
45
  if (dataStore.menu.onLink) await dataStore.menu.onLink(item);
46
- if (!dataStore.filters.disabled(item)) dataStore.menu.selectedItem = item;
46
+ if (!dataStore.filters.disabled(item) && !dataStore.isDirty) dataStore.menu.selectedItem = item;
47
47
  };
48
48
 
49
49
  const onBack = async (item: MenuItem) => {
package/locales/ru.json CHANGED
@@ -29,7 +29,14 @@
29
29
  "memberCopy": "Ошибка при копировании данных участников",
30
30
  "memberSave": "Ошибка при сохранении данных участников",
31
31
  "notValidIik": "Некорректный ИИК",
32
- "exceedUploadLimitFile": "Размер файла превышает определенный лимит"
32
+ "401": "Ошибка авторизации. Пожалуйста, войдите в систему снова",
33
+ "403": "`Нет доступа на запрос: {text}",
34
+ "404": "Отсутствует запрашиваемый ресурс",
35
+ "exceedUploadLimitFile": "Размер файла превышает определенный лимит",
36
+ "serverError": "Произошла ошибка на сервере. Попробуйте позже",
37
+ "unknownError": "Произошла непредвиденная ошибка. Пожалуйста, перезагрузите страницу",
38
+ "timeout": "Время ожидания истекло. Проверьте соединение и повторите попытку",
39
+ "networkError": "Нет подключения к сети. Проверьте интернет и попробуйте снова",
33
40
  },
34
41
  "toaster": {
35
42
  "wrongFormatOf": "Некорректный формат \"{text}\"",
@@ -144,6 +151,7 @@
144
151
  "needAttachQuestionnaire": "Нужно вложить анкету для клиентов",
145
152
  "notZeroPremium": "Общая страховая премия не должен быть 0",
146
153
  "requiredFieldsLB": "Обязательные поля: №, Ф.И.О, Пол, Должность, Дата рождения, ИИН, Страховая сумма, Сектор экономики, Признак резеденства",
154
+ "requiredFieldsLBDopik": "Обязательные поля: №, Ф.И.О, Пол, Должность, Дата рождения, ИИН, Страховая сумма, Дата увольнения, Дата начала действия страховой защиты",
147
155
  "duplicateClient": "В списке присутствуют повторяющиеся клиенты",
148
156
  "notParsedDocument": "Не удалось получить данные",
149
157
  "successProfile": "Профиль успешно обновлен",
@@ -272,6 +280,7 @@
272
280
  "exit": "Вы действительно хотите выйти?",
273
281
  "exitApp": "Вы действительно хотите выйти? Данные будут очищены.",
274
282
  "dataWillClear": "Данные будут очищены",
283
+ "dataWillNotSave": "Данные не будут сохранены",
275
284
  "cancel": "Вы действительно хотите отменить заявку?",
276
285
  "clear": "Вы действительно хотите очистить данные участника?",
277
286
  "delete": "Вы действительно хотите удалить участника?",
@@ -895,7 +904,8 @@
895
904
  "sums": "Поле должно содержать только цифры",
896
905
  "iinRight": "ИИН/БИН должен состоять из 12 цифр",
897
906
  "onlySymbols": "Поле не должно содержать число",
898
- "phoneFormat": "Номер телефона должен содержать из 11 чисел",
907
+ "phoneFormat": "Номер телефона должен состоять из 11 цифр",
908
+ "phoneNonResidentFormat": "Телефон должен быть в международном формате + и от 8 до 15 цифр.",
899
909
  "date": "Неправильный формат даты",
900
910
  "age": "Поле должно быть только числом",
901
911
  "exceedDate": "Дата не должна превышать сегодняшнюю дату",
@@ -1064,7 +1074,7 @@
1064
1074
  "chooseChild": "Выберите ребёнка",
1065
1075
  "addChild": "Добавить ребёнка",
1066
1076
  "addBeneficiary": "Добавить выгодоприобретателя",
1067
- "educationFundConsent": "Согласен на начисление стартового образовательного капитала",
1077
+ "educationFundConsent": "Согласен на начисление стартового образовательного капитала"
1068
1078
  },
1069
1079
  "bankDetailsForm": {
1070
1080
  "title": "Банковские реквизиты",
@@ -1241,5 +1251,8 @@
1241
1251
  "attachNotification": "Вложить уведомление",
1242
1252
  "coverageFrom": "Период действия с",
1243
1253
  "coverageTo": "Период действия до",
1244
- "recoveredFrom": "Восстановлен с"
1254
+ "recoveredFrom": "Восстановлен с",
1255
+ "hint": {
1256
+ "needToFillPolicyholder": "Необходимо заполнить данные страхователя"
1257
+ }
1245
1258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.64",
3
+ "version": "0.0.10-beta.65",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -1130,6 +1130,8 @@ export const useDataStore = defineStore('data', {
1130
1130
  conditionsData.policyAppDto.premiumInCurrency = getNumber(String(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar));
1131
1131
  conditionsData.policyAppDto.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
1132
1132
  conditionsData.policyAppDto.currencyExchangeRate = this.currencies.usd;
1133
+ conditionsData.policyAppDto.hasEnhancedGift = !!this.formStore.productConditionsForm.hasEnhancedGift;
1134
+ conditionsData.policyAppDto.managerHelped = this.formStore.productConditionsForm.managerHelped;
1133
1135
  }
1134
1136
  if (this.isGons) {
1135
1137
  conditionsData.policyAppDto.premiumInCurrency =
@@ -1276,8 +1278,10 @@ export const useDataStore = defineStore('data', {
1276
1278
  try {
1277
1279
  this.isLoading = loading;
1278
1280
  await this.api.setINSISWorkData(data);
1281
+ return true;
1279
1282
  } catch (err) {
1280
1283
  ErrorHandler(err);
1284
+ return false;
1281
1285
  } finally {
1282
1286
  this.isLoading = false;
1283
1287
  }
@@ -1940,6 +1944,8 @@ export const useDataStore = defineStore('data', {
1940
1944
  calculationData.premiumInCurrency = getNumber(String(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar));
1941
1945
  calculationData.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
1942
1946
  calculationData.currencyExchangeRate = this.currencies.usd;
1947
+ calculationData.hasEnhancedGift = this.formStore.productConditionsForm.hasEnhancedGift;
1948
+ calculationData.managerHelped = this.formStore.productConditionsForm.managerHelped;
1943
1949
  }
1944
1950
  if (this.isGons || product === 'gons') {
1945
1951
  calculationData.premiumInCurrency =
@@ -2007,7 +2013,11 @@ export const useDataStore = defineStore('data', {
2007
2013
  if (this.isLifeBusiness || product === 'lifebusiness' || this.isGns || product === 'gns') {
2008
2014
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpacesAfterComma(calculationResponse.mainPremiumWithCommission as number);
2009
2015
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.mainInsSum === 0 ? null : calculationResponse.mainInsSum);
2010
- this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
2016
+ const updatedCovers = calculationResponse.addCovers.map((item: any) => ({
2017
+ ...item,
2018
+ premium: 0,
2019
+ }));
2020
+ this.formStore.additionalInsuranceTermsWithout = updatedCovers;
2011
2021
  if (calculationResponse.agentCommission) {
2012
2022
  this.formStore.productConditionsForm.agentCommission = calculationResponse.agentCommission;
2013
2023
  }
@@ -2048,6 +2058,9 @@ export const useDataStore = defineStore('data', {
2048
2058
  this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(result.value / this.currencies.usd);
2049
2059
  }
2050
2060
  }
2061
+ if(this.isKazyna) {
2062
+ this.formStore.productConditionsForm.isCalculated = applicationData.policyAppDto.isCalculated;
2063
+ }
2051
2064
  if (this.formStore.productConditionsForm.insurancePremiumPerMonth != null) {
2052
2065
  this.formStore.productConditionsForm.requestedSumInsured = this.isGons ? this.getNumberWithSpacesAfterComma(result.value) : this.getNumberWithSpaces(result.value);
2053
2066
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons
@@ -2111,6 +2124,9 @@ export const useDataStore = defineStore('data', {
2111
2124
  }
2112
2125
  this.isLoading = false;
2113
2126
  },
2127
+ async setIsNotCalculated(processInstanceId: string | number) {
2128
+ await this.api.setIsNotCalculated(processInstanceId);
2129
+ },
2114
2130
  async getDividendSchedule() {
2115
2131
  this.isLoading = true;
2116
2132
  try {
@@ -2533,6 +2549,9 @@ export const useDataStore = defineStore('data', {
2533
2549
  if (applicationData.policyAppDto.currency === 'USD' && applicationData.policyAppDto.amount !== null && applicationData.policyAppDto.premium !== null) {
2534
2550
  this.currencies.usd = applicationData.policyAppDto.currencyExchangeRate;
2535
2551
  }
2552
+ this.formStore.productConditionsForm.hasEnhancedGift = applicationData.policyAppDto.hasEnhancedGift;
2553
+ this.formStore.productConditionsForm.isCalculated = applicationData.policyAppDto.isCalculated;
2554
+ this.formStore.productConditionsForm.managerHelped = applicationData.policyAppDto.managerHelped ?? false;
2536
2555
  }
2537
2556
  const riskGroup = this.riskGroup.find(item => {
2538
2557
  if (applicationData.policyAppDto.riskGroup == 0) {
@@ -3276,7 +3295,8 @@ export const useDataStore = defineStore('data', {
3276
3295
  return false;
3277
3296
  }
3278
3297
  if (this.isInitiator()) {
3279
- await this.setINSISWorkData();
3298
+ const isSetInsisWorkData = await this.setINSISWorkData();
3299
+ if (isSetInsisWorkData === false) return false;
3280
3300
  }
3281
3301
  } else {
3282
3302
  this.isLoading = false;
@@ -3806,11 +3826,8 @@ export const useDataStore = defineStore('data', {
3806
3826
  'clientData.addTaxResidency',
3807
3827
  'clientData.gender',
3808
3828
  'clientData.placeOfBirth',
3809
- 'clientData.authoritedPerson.actualAddress',
3810
3829
  'clientData.authoritedPerson.bankInfo',
3811
3830
  'clientData.authoritedPerson.economySectorCode',
3812
- 'clientData.authoritedPerson.legalAddress',
3813
- 'clientData.authoritedPerson.taxResidentCountry',
3814
3831
  'clientData.authoritedPerson.addTaxResidency',
3815
3832
  ]);
3816
3833
  policyholder.clientData.authoritedPerson.gender = policyholder.clientData.authoritedPerson.gender.nameRu === 'Мужской' ? 1 : 2;
@@ -3847,10 +3864,13 @@ export const useDataStore = defineStore('data', {
3847
3864
  this.sendToParent(constants.postActions.toHomePage, this.t('toaster.noSuchProduct'));
3848
3865
  return;
3849
3866
  }
3850
-
3851
3867
  this.formStore.applicationData = applicationData;
3852
3868
  this.formStore.regNumber = applicationData.regNumber;
3853
- this.formStore.additionalInsuranceTerms = applicationData.addCoverDto;
3869
+ const updatedCovers = applicationData.addCoverDto.map((item: any) => ({
3870
+ ...item,
3871
+ premium: 0,
3872
+ }));
3873
+ this.formStore.additionalInsuranceTerms = updatedCovers;
3854
3874
  this.formStore.canBeClaimed = await this.api.isClaimTask(taskId);
3855
3875
  this.formStore.applicationTaskId = taskId;
3856
3876
  this.formStore.RegionPolicy.nameRu = applicationData.insisWorkDataApp.regionPolicyName;
@@ -4167,7 +4187,8 @@ export const useDataStore = defineStore('data', {
4167
4187
  const areValid = this.formStore.SaleChanellPolicy.nameRu && this.formStore.RegionPolicy.nameRu && this.formStore.ManagerPolicy.nameRu && this.formStore.AgentData.fullName;
4168
4188
  if (areValid) {
4169
4189
  if (this.isInitiator()) {
4170
- await this.setINSISWorkData();
4190
+ const isSetInsisWorkData = await this.setINSISWorkData();
4191
+ if (isSetInsisWorkData === false) return false;
4171
4192
  }
4172
4193
  } else {
4173
4194
  this.isLoading = false;
@@ -4244,6 +4265,18 @@ export const useDataStore = defineStore('data', {
4244
4265
  return null;
4245
4266
  }
4246
4267
  },
4268
+ async checkExistProcess(iin: string, processCode: number) {
4269
+ try {
4270
+ const response = await this.api.checkExistProcess(iin, processCode);
4271
+ if (!!response) {
4272
+ ErrorHandler(response);
4273
+ }
4274
+ return !!response;
4275
+ } catch (err) {
4276
+ ErrorHandler(err);
4277
+ return true;
4278
+ }
4279
+ },
4247
4280
  async checkIIN(iin: string) {
4248
4281
  try {
4249
4282
  const response = await this.api.checkIIN(iin);
@@ -4301,15 +4334,19 @@ export const useDataStore = defineStore('data', {
4301
4334
  },
4302
4335
  getClientData(clientData: GroupMember) {
4303
4336
  this.formStore.lfb.policyholder.clientData = clientData;
4304
- this.formStore.lfb.policyholder.clientData.authoritedPerson = clientData.authoritedPerson;
4305
4337
  this.formStore.lfb.policyholder.clientData.iin = reformatIin(clientData.iin);
4306
- this.formStore.lfb.policyholder.clientData.authoritedPerson.iin = reformatIin(clientData.authoritedPerson.iin);
4307
- this.formStore.lfb.policyholder.clientData.authoritedPerson.authorityDetails.date = reformatDate(clientData.authoritedPerson.authorityDetails.date as string);
4308
- this.formStore.lfb.policyholder.clientData.authoritedPerson.birthDate = reformatDate(clientData.authoritedPerson.birthDate) ?? '';
4309
- this.formStore.lfb.policyholder.clientData.authoritedPerson.identityDocument.issuedOn = reformatDate(clientData.authoritedPerson.identityDocument.issuedOn) ?? '';
4310
- this.formStore.lfb.policyholder.clientData.authoritedPerson.identityDocument.validUntil = reformatDate(clientData.authoritedPerson.identityDocument.validUntil) ?? '';
4338
+ this.formStore.lfb.policyholder.clientData.authoritedPerson = clientData.authoritedPerson;
4339
+ const person = this.formStore.lfb.policyholder.clientData.authoritedPerson;
4340
+ person.iin = reformatIin(clientData.authoritedPerson.iin);
4341
+ person.authorityDetails.date = reformatDate(clientData.authoritedPerson.authorityDetails.date as string);
4342
+ person.birthDate = reformatDate(clientData.authoritedPerson.birthDate) ?? '';
4343
+ person.identityDocument.issuedOn = reformatDate(clientData.authoritedPerson.identityDocument.issuedOn) ?? '';
4344
+ person.identityDocument.validUntil = reformatDate(clientData.authoritedPerson.identityDocument.validUntil) ?? '';
4311
4345
  const gender = this.gender.find((i: Value) => i.id === Number(clientData.authoritedPerson.gender));
4312
- this.formStore.lfb.policyholder.clientData.authoritedPerson.gender = gender ? gender : new Value();
4346
+ person.gender = gender ? gender : new Value();
4347
+ person.legalAddress ??= new Address();
4348
+ person.actualAddress ??= new Address();
4349
+ person.taxResidentCountry ??= new Value();
4313
4350
  },
4314
4351
  async getParentApplication(bin: string) {
4315
4352
  try {
package/store/rules.ts CHANGED
@@ -126,6 +126,14 @@ export const rules = {
126
126
  }
127
127
  },
128
128
  ],
129
+ phoneNonResidentFormat: [
130
+ (v: any) => {
131
+ if (v === null || v === '') {
132
+ return true;
133
+ }
134
+ return /^\+[1-9]\d{7,14}$/.test(v) ? true : t('rules.phoneNonResidentFormat');
135
+ },
136
+ ],
129
137
  date: [
130
138
  (v: any) => {
131
139
  if (v === null || v == '') return true;
package/types/enum.ts CHANGED
@@ -133,6 +133,9 @@ export enum Roles {
133
133
  HR = 'HR',
134
134
  NotAccumulativeSanctionerUSNS = 'NotAccumulativeSanctionerUSNS',
135
135
  ReInsurer = 'ReInsurer',
136
+ Sanctioner1 = 'Sanctioner1',
137
+ Sanctioner2 = 'Sanctioner2',
138
+ Sanctioner3 = 'Sanctioner3',
136
139
  }
137
140
 
138
141
  export enum Statuses {
package/types/index.ts CHANGED
@@ -586,6 +586,9 @@ export type PolicyAppDto = {
586
586
  calcDate?: string;
587
587
  mainPremiumWithCommission?: number;
588
588
  accureStartEducationCapital?: boolean;
589
+ hasEnhancedGift?: boolean | null;
590
+ isCalculated?: boolean | null;
591
+ managerHelped?: boolean;
589
592
  };
590
593
 
591
594
  export type InsisWorkDataApp = {