hl-core 0.0.8-beta.39 → 0.0.8-beta.40

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.
@@ -1,3 +1,4 @@
1
+ import { Statuses, StoreMembers, MemberAppCodes } from '../types/enum';
1
2
  import { formatDate } from '.';
2
3
  import { RouteLocationNormalized, RouteLocationNormalizedLoaded } from 'vue-router';
3
4
 
@@ -58,8 +59,8 @@ export class MenuItem extends MenuItemConfig {
58
59
  export class Value {
59
60
  id: string | number | null;
60
61
  code: string | number | null;
61
- nameRu: string | number | null;
62
- nameKz: string | number | null;
62
+ nameRu: string | null;
63
+ nameKz: string | null;
63
64
  ids: string | number | null;
64
65
 
65
66
  constructor(id: string | number | null = null, nameRu: string | null = null, nameKz: string | null = null, code: string | null = null, ids: string | null = null) {
@@ -140,7 +141,16 @@ export class MenuOption {
140
141
  }
141
142
  }
142
143
 
143
- export const InitialColumns = () => {
144
+ export const InitialColumns = (): {
145
+ addRegNumber: boolean | null;
146
+ number: boolean | null;
147
+ iin: boolean | null;
148
+ longName: boolean | null;
149
+ userName: boolean | null;
150
+ processCodeTitle: boolean | null;
151
+ historyStatusTitle: boolean | null;
152
+ dateCreated: boolean | null;
153
+ } => {
144
154
  return {
145
155
  addRegNumber: null,
146
156
  number: null,
@@ -360,11 +370,11 @@ export class Contragent extends Person {
360
370
 
361
371
  export class Member extends Person {
362
372
  response?: {
363
- contragent?: any;
364
- questionnaires?: any;
365
- contacts?: any;
366
- documents?: any;
367
- addresses?: any;
373
+ contragent?: ContragentType;
374
+ questionnaires?: ContragentQuestionaries[];
375
+ contacts?: ContragentContacts[];
376
+ documents?: ContragentDocuments[];
377
+ addresses?: ContragentAddress[];
368
378
  };
369
379
  verifyType: any;
370
380
  verifyDate: any;
@@ -431,7 +441,7 @@ export class Member extends Person {
431
441
  hasAgreement: boolean | null;
432
442
  otpTokenId: string | null;
433
443
  otpCode: string | null;
434
- documentsList: UserDocument[];
444
+ documentsList: ContragentDocuments[];
435
445
  constructor(
436
446
  id = 0,
437
447
  type = 1,
@@ -650,43 +660,13 @@ export class Member extends Person {
650
660
  }
651
661
  }
652
662
 
653
- export class PolicyholderForm extends Member {
654
- constructor(...args: any) {
655
- super(...args);
656
- }
657
- }
658
-
659
- export class InsuredForm extends Member {
660
- constructor(...args: any) {
661
- super(...args);
662
- }
663
- }
664
-
665
- export class BeneficiaryForm extends Member {
666
- constructor(...args: any) {
667
- super(...args);
668
- }
669
- }
670
-
671
- export class BeneficialOwnerForm extends Member {
672
- constructor(...args: any) {
673
- super(...args);
674
- }
675
- }
676
-
677
- export class PolicyholdersRepresentativeForm extends Member {
678
- constructor(...args: any) {
679
- super(...args);
680
- }
681
- }
682
-
683
663
  export class ProductConditions {
684
664
  signDate: string | null;
685
665
  birthDate: string | null;
686
666
  gender: Value;
687
667
  insuranceCase: string | null;
688
- coverPeriod: string | null;
689
- payPeriod: string | null;
668
+ coverPeriod: number | null;
669
+ payPeriod: number | null;
690
670
  termsOfInsurance: string | null;
691
671
  annualIncome: string | null;
692
672
  processIndexRate: Value;
@@ -702,20 +682,20 @@ export class ProductConditions {
702
682
  bodyInjury: Value;
703
683
  criticalIllnessOfTheInsured: Value;
704
684
  paymentPeriod: Value;
705
- amountOfInsurancePremium: string | null;
706
- lifeMultiply: string | null;
707
- lifeAdditive: string | null;
708
- lifeMultiplyClient: string | null;
709
- lifeAdditiveClient: string | null;
710
- adbMultiply: string | null;
711
- adbAdditive: string | null;
712
- disabilityMultiply: string | null;
713
- disabilityAdditive: string | null;
685
+ amountOfInsurancePremium: string | number | null;
686
+ lifeMultiply: string | number | null;
687
+ lifeAdditive: string | number | null;
688
+ lifeMultiplyClient: string | number | null;
689
+ lifeAdditiveClient: string | number | null;
690
+ adbMultiply: string | number | null;
691
+ adbAdditive: string | number | null;
692
+ disabilityMultiply: string | number | null;
693
+ disabilityAdditive: string | number | null;
714
694
  processTariff: Value;
715
695
  riskGroup: Value;
716
696
  riskGroup2: Value;
717
697
  additionalConditionAnnuityPayments: boolean;
718
- guaranteedPeriod: number | string | null;
698
+ guaranteedPeriod: number | null;
719
699
  typeAnnuityInsurance: Value;
720
700
  termAnnuityPayments: number | string | null;
721
701
  periodAnnuityPayment: Value;
@@ -853,7 +833,7 @@ export class DataStoreClass {
853
833
  };
854
834
  iframeLoading: boolean;
855
835
  hasLayoutMargins: boolean;
856
- readonly product: string | null;
836
+ readonly product: Projects | null;
857
837
  showNav: boolean;
858
838
  menuItems: MenuItem[];
859
839
  menu: {
@@ -873,7 +853,7 @@ export class DataStoreClass {
873
853
  };
874
854
  buttons: MenuItem[];
875
855
  isButtonsLoading: boolean;
876
- panelAction: string | null;
856
+ panelAction: keyof typeof constants.actions | null;
877
857
  panel: {
878
858
  open: boolean;
879
859
  overlay: boolean;
@@ -908,7 +888,6 @@ export class DataStoreClass {
908
888
  fontSize: number;
909
889
  isFontChangerOpen: boolean = false;
910
890
  isLoading: boolean = false;
911
- userNotFound: boolean = false;
912
891
  user: User;
913
892
  accessToken: string | null = null;
914
893
  refreshToken: string | null = null;
@@ -919,7 +898,7 @@ export class DataStoreClass {
919
898
  processAnnuityPaymentPeriod: Value[];
920
899
  taskList: TaskListItem[];
921
900
  processHistory: TaskHistory[];
922
- contragentList: any[];
901
+ contragentList: ContragentType[];
923
902
  contragentFormKey: string;
924
903
  processCode: number | null;
925
904
  groupCode: string;
@@ -990,7 +969,7 @@ export class DataStoreClass {
990
969
  this.RegionPolicy = [];
991
970
  this.ManagerPolicy = [];
992
971
  this.AgentData = [];
993
- this.product = import.meta.env.VITE_PRODUCT ? (import.meta.env.VITE_PRODUCT as string) : null;
972
+ this.product = import.meta.env.VITE_PRODUCT ? (import.meta.env.VITE_PRODUCT as Projects) : null;
994
973
  this.showNav = true;
995
974
  this.menuItems = [];
996
975
  this.menu = {
@@ -1049,7 +1028,6 @@ export class DataStoreClass {
1049
1028
  this.fontSize = 14;
1050
1029
  this.isFontChangerOpen = false;
1051
1030
  this.isLoading = false;
1052
- this.userNotFound = false;
1053
1031
  this.user = new User();
1054
1032
  this.accessToken = null;
1055
1033
  this.refreshToken = null;
@@ -1112,12 +1090,12 @@ export class FormStoreClass {
1112
1090
  id: string | number | null;
1113
1091
  processInstanceId: string | number | null;
1114
1092
  number: string | number | null;
1115
- date: string | number | null;
1093
+ date: string | null;
1116
1094
  };
1117
1095
  finCenterData: {
1118
1096
  processInstanceId: string | number | null;
1119
1097
  regNumber: string | number | null;
1120
- date: string | number | null;
1098
+ date: string | null;
1121
1099
  };
1122
1100
  signedDocumentList: IDocument[];
1123
1101
  surveyByHealthBase: AnketaFirst | null;
@@ -1158,27 +1136,29 @@ export class FormStoreClass {
1158
1136
  isPolicyholderIPDL: boolean = false;
1159
1137
  applicationData: {
1160
1138
  processInstanceId: number | string;
1161
- statusCode?: string | null;
1139
+ statusCode?: keyof typeof Statuses;
1162
1140
  clientApp?: any;
1163
1141
  insuredApp?: any;
1164
1142
  beneficiaryApp?: any;
1165
1143
  beneficialOwnerApp?: any;
1166
1144
  spokesmanApp?: any;
1167
1145
  isTask?: boolean | null;
1168
- policyAppDto?: any;
1146
+ policyAppDto?: PolicyAppDto;
1147
+ insisWorkDataApp?: InsisWorkDataApp;
1148
+ addCoverDto?: AddCover[];
1169
1149
  };
1170
- policyholderForm: PolicyholderForm;
1171
- policyholderFormKey: string;
1172
- policyholdersRepresentativeForm: PolicyholdersRepresentativeForm;
1173
- policyholdersRepresentativeFormKey: string;
1174
- beneficiaryForm: BeneficiaryForm[];
1175
- beneficiaryFormKey: string;
1150
+ policyholderForm: Member;
1151
+ policyholderFormKey: StoreMembers.policyholderForm;
1152
+ policyholdersRepresentativeForm: Member;
1153
+ policyholdersRepresentativeFormKey: StoreMembers.policyholdersRepresentativeForm;
1154
+ beneficiaryForm: Member[];
1155
+ beneficiaryFormKey: StoreMembers.beneficiaryForm;
1176
1156
  beneficiaryFormIndex: number;
1177
- beneficialOwnerForm: BeneficialOwnerForm[];
1157
+ beneficialOwnerForm: Member[];
1178
1158
  beneficialOwnerFormIndex: number;
1179
- beneficialOwnerFormKey: string;
1180
- insuredForm: InsuredForm[];
1181
- insuredFormKey: string;
1159
+ beneficialOwnerFormKey: StoreMembers.beneficialOwnerForm;
1160
+ insuredForm: Member[];
1161
+ insuredFormKey: StoreMembers.insuredForm;
1182
1162
  insuredFormIndex: number;
1183
1163
  productConditionsForm: ProductConditions;
1184
1164
  productConditionsFormKey: string;
@@ -1248,18 +1228,18 @@ export class FormStoreClass {
1248
1228
  this.isActOwnBehalf = true;
1249
1229
  this.hasRepresentative = false;
1250
1230
  this.applicationData = { processInstanceId: 0 };
1251
- this.policyholderForm = new PolicyholderForm();
1252
- this.policyholderFormKey = 'policyholderForm';
1253
- this.policyholdersRepresentativeForm = new PolicyholdersRepresentativeForm();
1254
- this.policyholdersRepresentativeFormKey = 'policyholdersRepresentativeForm';
1255
- this.beneficiaryForm = [new BeneficiaryForm()];
1256
- this.beneficiaryFormKey = 'beneficiaryForm';
1231
+ this.policyholderForm = new Member();
1232
+ this.policyholderFormKey = StoreMembers.policyholderForm;
1233
+ this.policyholdersRepresentativeForm = new Member();
1234
+ this.policyholdersRepresentativeFormKey = StoreMembers.policyholdersRepresentativeForm;
1235
+ this.beneficiaryForm = [new Member()];
1236
+ this.beneficiaryFormKey = StoreMembers.beneficiaryForm;
1257
1237
  this.beneficiaryFormIndex = 0;
1258
- this.beneficialOwnerForm = [new BeneficialOwnerForm()];
1238
+ this.beneficialOwnerForm = [new Member()];
1259
1239
  this.beneficialOwnerFormIndex = 0;
1260
- this.beneficialOwnerFormKey = 'beneficialOwnerForm';
1261
- this.insuredForm = [new InsuredForm()];
1262
- this.insuredFormKey = 'insuredForm';
1240
+ this.beneficialOwnerFormKey = StoreMembers.beneficialOwnerForm;
1241
+ this.insuredForm = [new Member()];
1242
+ this.insuredFormKey = StoreMembers.insuredForm;
1263
1243
  this.insuredFormIndex = 0;
1264
1244
  this.productConditionsForm = new ProductConditions();
1265
1245
  this.productConditionsFormKey = 'productConditionsForm';
@@ -1,3 +1,5 @@
1
+ import { Actions, PostActions, Roles, Statuses } from '../types/enum';
2
+
1
3
  export const constants = Object.freeze({
2
4
  products: {
3
5
  baiterek: 3,
@@ -8,68 +10,29 @@ export const constants = Object.freeze({
8
10
  gons: 10,
9
11
  halykkazyna: 11,
10
12
  },
11
-
12
- editableStatuses: ['StartForm', 'EditBeneficiaryForm', 'EditForm'],
13
- documentsLinkVisibleStatuses: ['DocumentsSignedFrom', 'UnderwriterForm', 'AffilationResolutionForm', 'Completed', 'InsurancePremiumOnlinePaid'],
14
- returnStatementStatuses: ['DocumentsSignedFrom', 'ContractSignedFrom', 'WaitingInsurancePremiumForm', 'UnderwriterForm'],
15
- cancelApplicationStatuses: ['StartForm', 'EditForm', 'EditBeneficiaryForm', 'WaitingInsurancePremiumForm', 'DocumentsSignedFrom', 'ContractSignedFrom'],
13
+ editableStatuses: [Statuses.StartForm, Statuses.EditBeneficiaryForm, Statuses.EditForm],
14
+ documentsLinkVisibleStatuses: [
15
+ Statuses.DocumentsSignedFrom,
16
+ Statuses.UnderwriterForm,
17
+ Statuses.AffilationResolutionForm,
18
+ Statuses.Completed,
19
+ Statuses.InsurancePremiumOnlinePaid,
20
+ ],
21
+ returnStatementStatuses: [Statuses.DocumentsSignedFrom, Statuses.ContractSignedFrom, Statuses.WaitingInsurancePremiumForm, Statuses.UnderwriterForm],
22
+ cancelApplicationStatuses: [
23
+ Statuses.StartForm,
24
+ Statuses.EditForm,
25
+ Statuses.EditBeneficiaryForm,
26
+ Statuses.WaitingInsurancePremiumForm,
27
+ Statuses.DocumentsSignedFrom,
28
+ Statuses.ContractSignedFrom,
29
+ ],
16
30
  gbdErrors: ['INVALID', 'TIMEOUT', 'ERROR', 'NOT_FOUND'],
17
- types: {
18
- string: 'string',
19
- array: 'object',
20
- object: 'object',
21
- },
22
- roles: {
23
- manager: 'Manager',
24
- admin: 'Admin',
25
- underwriter: 'Underwriter',
26
- agent: 'Agent',
27
- compliance: 'Compliance',
28
- agentMycar: 'AgentMycar',
29
- analyst: 'Analyst',
30
- upk: 'UPK',
31
- finCenter: 'FinCenter',
32
- supervisor: 'Supervisor',
33
- support: 'Support',
34
- managerHalykBank: 'ManagerHalykBank',
35
- serviceManager: 'ServiceManager',
36
- drn: 'DRNSJ',
37
- },
38
- actions: {
39
- accept: 'accept',
40
- rejectclient: 'rejectclient',
41
- reject: 'reject',
42
- return: 'return',
43
- claim: 'claim',
44
- sign: 'sign',
45
- pay: 'pay',
46
- register: 'register',
47
- send: 'send',
48
- affiliate: 'affiliate',
49
- },
31
+ roles: Roles,
32
+ actions: Actions,
33
+ postActions: PostActions,
50
34
  yearCases: [2, 0, 1, 1, 1, 2],
51
35
  yearTitles: ['год', 'года', 'лет'],
52
- panelActions: {
53
- accept: 'accept',
54
- claim: 'claim',
55
- return: 'return',
56
- reject: 'reject',
57
- rejectclient: 'rejectclient',
58
- },
59
- postActions: {
60
- font: 'font',
61
- route: 'route',
62
- onRouteChange: 'onRouteChange',
63
- applicationCreated: 'applicationCreated',
64
- clipboard: 'clipboard',
65
- toHomePage: 'toHomePage',
66
- toStatementHistory: 'toStatementHistory',
67
- toAuth: 'toAuth',
68
- DOMevent: 'DOMevent',
69
- Error401: 'Error401',
70
- Error500: 'Error500',
71
- iframeLoaded: 'iframeLoaded',
72
- },
73
36
  currencySymbols: {
74
37
  kzt: '₸',
75
38
  usd: '$',
@@ -227,21 +227,24 @@ export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean)
227
227
  beneficiary.registrationRegionType = new Value();
228
228
  beneficiary.registrationStreet = '';
229
229
  } else {
230
- const country = dataStore.countries.find(i => (i.nameRu as string).match(new RegExp(beneficiary.response?.addresses[0].countryName, 'i')));
231
- const city = dataStore.cities.find(i => i.nameRu === beneficiary.response?.addresses[0].cityName.replace('г.', ''));
232
- const province = dataStore.states.find(i => i.ids === beneficiary.response?.addresses[0].stateCode);
233
- const localityType = dataStore.localityTypes.find(i => i.nameRu === beneficiary.response?.addresses[0].cityTypeName);
234
- const region = dataStore.regions.find(i => i.ids == beneficiary.response?.addresses[0].regionCode);
235
- beneficiary.registrationCountry = country ?? new Value();
236
- beneficiary.registrationCity = city ?? new Value();
237
- beneficiary.registrationMicroDistrict = beneficiary.response?.addresses[0].microRaion ?? '';
238
- beneficiary.registrationNumberApartment = beneficiary.response?.addresses[0].apartmentNumber ?? '';
239
- beneficiary.registrationNumberHouse = beneficiary.response?.addresses[0].blockNumber ?? '';
240
- beneficiary.registrationProvince = province ?? new Value();
241
- beneficiary.registrationQuarter = beneficiary.response?.addresses[0].kvartal ?? '';
242
- beneficiary.registrationRegion = region ?? new Value();
243
- beneficiary.registrationRegionType = localityType ?? new Value();
244
- beneficiary.registrationStreet = beneficiary.response?.addresses[0].streetName ?? '';
230
+ if (beneficiary.response && beneficiary.response.addresses && beneficiary.response.addresses.length) {
231
+ const benAddress = beneficiary.response.addresses;
232
+ const country = dataStore.countries.find(i => (i.nameRu as string).match(new RegExp(benAddress[0].countryName, 'i')));
233
+ const city = dataStore.cities.find(i => i.nameRu === benAddress[0].cityName.replace('г.', ''));
234
+ const province = dataStore.states.find(i => i.ids === benAddress[0].stateCode);
235
+ const localityType = dataStore.localityTypes.find(i => i.nameRu === benAddress[0].cityTypeName);
236
+ const region = dataStore.regions.find(i => i.ids == benAddress[0].regionCode);
237
+ beneficiary.registrationCountry = country ?? new Value();
238
+ beneficiary.registrationCity = city ?? new Value();
239
+ beneficiary.registrationMicroDistrict = beneficiary.response?.addresses[0].microRaion ?? '';
240
+ beneficiary.registrationNumberApartment = beneficiary.response?.addresses[0].apartmentNumber ?? '';
241
+ beneficiary.registrationNumberHouse = beneficiary.response?.addresses[0].blockNumber ?? '';
242
+ beneficiary.registrationProvince = province ?? new Value();
243
+ beneficiary.registrationQuarter = beneficiary.response?.addresses[0].kvartal ?? '';
244
+ beneficiary.registrationRegion = region ?? new Value();
245
+ beneficiary.registrationRegionType = localityType ?? new Value();
246
+ beneficiary.registrationStreet = beneficiary.response?.addresses[0].streetName ?? '';
247
+ }
245
248
  }
246
249
  }
247
250
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8-beta.39",
3
+ "version": "0.0.8-beta.40",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",