hl-core 0.0.9-beta.27 → 0.0.9-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,7 @@ export const useDataStore = defineStore('data', {
49
49
  isCheckContract: state => state.product === 'checkcontract',
50
50
  isCheckContragent: state => state.product === 'checkcontragent',
51
51
  isDSO: state => state.product === 'dso',
52
+ isUU: state => state.product === 'uu',
52
53
  isEveryFormDisabled: state => Object.values(state.formStore.isDisabled).every(i => i === true),
53
54
  hasClientAnketa: state => state.formStore.additionalInsuranceTerms.find(i => i.coverTypeCode === 10),
54
55
  isClientAnketaCondition: state =>
@@ -298,6 +299,7 @@ export const useDataStore = defineStore('data', {
298
299
  },
299
300
  async resetSelected(route: RouteType) {
300
301
  this.settings.open = false;
302
+ this.rightPanel.open = false;
301
303
  this.panel.open = false;
302
304
  this.panelAction = null;
303
305
  this.menu.selectedItem = new MenuItem();
@@ -1102,7 +1104,7 @@ export const useDataStore = defineStore('data', {
1102
1104
  this.isLoading = false;
1103
1105
  }
1104
1106
  },
1105
- async setINSISWorkData() {
1107
+ async setINSISWorkData(loading: boolean = true) {
1106
1108
  if (!this.formStore.applicationData.insisWorkDataApp) return;
1107
1109
  const data: InsisWorkDataApp = {
1108
1110
  id: this.formStore.applicationData.insisWorkDataApp.id,
@@ -1121,7 +1123,7 @@ export const useDataStore = defineStore('data', {
1121
1123
  insuranceProgramType: this.formStore.applicationData.insisWorkDataApp.insuranceProgramType,
1122
1124
  };
1123
1125
  try {
1124
- this.isLoading = true;
1126
+ this.isLoading = loading;
1125
1127
  await this.api.setINSISWorkData(data);
1126
1128
  } catch (err) {
1127
1129
  ErrorHandler(err);
@@ -1777,6 +1779,10 @@ export const useDataStore = defineStore('data', {
1777
1779
  }
1778
1780
  if (this.isLifeBusiness) {
1779
1781
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(result.value);
1782
+ if (applicationData.insuredApp && applicationData.insuredApp.length) {
1783
+ const res = await this.newInsuredList(applicationData.insuredApp);
1784
+ this.formStore.lfb.clients = res;
1785
+ }
1780
1786
  }
1781
1787
 
1782
1788
  this.showToaster('success', this.t('toaster.calculated'), 1000);
@@ -3013,7 +3019,7 @@ export const useDataStore = defineStore('data', {
3013
3019
  if (economySectorCode) member.economySectorCode = economySectorCode;
3014
3020
  },
3015
3021
  async startApplicationV2(policyholder: MemberV2) {
3016
- if (!policyholder.personalData.iin) return false;
3022
+ if (!policyholder.iin) return false;
3017
3023
  try {
3018
3024
  const response = await this.api.startApplication(policyholder);
3019
3025
  this.sendToParent(constants.postActions.applicationCreated, response.processInstanceId);
@@ -3066,16 +3072,16 @@ export const useDataStore = defineStore('data', {
3066
3072
  this.formStore.applicationData.processInstanceId = applicationData.processInstanceId;
3067
3073
  this.formStore.lfb.policyholder = clientData;
3068
3074
  this.formStore.lfb.clientId = clientId;
3069
- this.formStore.lfb.policyholder.clientPower.date = reformatDate(clientData.clientPower.date);
3075
+ this.formStore.lfb.policyholder.authorityDetails.date = reformatDate(clientData.authorityDetails.date);
3070
3076
 
3071
- if (clientData && clientData.activityTypes !== null) {
3072
- this.formStore.lfb.policyholderActivities = clientData.activityTypes;
3077
+ if (clientData && clientData.organizationInfo.activityTypes !== null) {
3078
+ this.formStore.lfb.policyholderActivities = clientData.organizationInfo.activityTypes;
3073
3079
  }
3074
3080
 
3075
3081
  if (beneficialOwnerApp && beneficialOwnerApp.length) {
3076
3082
  this.formStore.lfb.beneficialOwners = beneficialOwnerApp;
3077
3083
  this.formStore.lfb.beneficialOwners.forEach(beneficial => {
3078
- beneficial.beneficialOwnerData.identityCard!.validity = reformatDate(beneficial.beneficialOwnerData.identityCard!.validity as string);
3084
+ beneficial.beneficialOwnerData.identityDocument!.validUntil = reformatDate(beneficial.beneficialOwnerData.identityDocument!.validUntil as string);
3079
3085
  });
3080
3086
  }
3081
3087
 
@@ -3153,9 +3159,9 @@ export const useDataStore = defineStore('data', {
3153
3159
  return ErrorHandler(err);
3154
3160
  }
3155
3161
  },
3156
- async saveInsured(insuredId: any) {
3162
+ async saveInsured(insured: any) {
3157
3163
  try {
3158
- const response = await this.api.saveInsured(this.formStore.applicationData.processInstanceId, insuredId.id, insuredId);
3164
+ const response = await this.api.saveInsured(this.formStore.applicationData.processInstanceId, insured.id, insured);
3159
3165
  return response;
3160
3166
  } catch (err) {
3161
3167
  return ErrorHandler(err);
@@ -3166,11 +3172,11 @@ export const useDataStore = defineStore('data', {
3166
3172
  const client = item.insuredData;
3167
3173
  return {
3168
3174
  id: index,
3169
- fullName: client.personalData.longName,
3170
- sex: client.personalData.sex,
3171
- position: item.position,
3172
- birthDate: client.personalData.birthDate,
3173
- iin: client.personalData.iin,
3175
+ fullName: client.longName,
3176
+ gender: client.gender,
3177
+ position: item.workDetails?.position,
3178
+ birthDate: client.birthDate,
3179
+ iin: client.iin,
3174
3180
  insSum: client.insuredPolicyData.insSum,
3175
3181
  premium: client.insuredPolicyData.premium,
3176
3182
  };
@@ -3233,7 +3239,7 @@ export const useDataStore = defineStore('data', {
3233
3239
  }
3234
3240
 
3235
3241
  if (this.formStore.lfb.policyholderActivities) {
3236
- if (this.formStore.lfb.policyholderActivities.length !== this.formStore.applicationData.clientApp.clientData.activityTypes.length) {
3242
+ if (this.formStore.lfb.policyholderActivities.length !== this.formStore.applicationData.clientApp.clientData.organizationInfo.activityTypes.length) {
3237
3243
  this.showToaster('error', this.t('toaster.notSavedMember', { text: 'деятельности Страхователя' }), 3000);
3238
3244
  return false;
3239
3245
  }
@@ -0,0 +1,17 @@
1
+ import type { PiniaCustomStateProperties, StoreActions, StoreGeneric, StoreGetters, StoreState } from 'pinia';
2
+ import type { ToRefs } from 'vue';
3
+ import { isReactive, isRef, toRaw, toRef } from 'vue';
4
+ type Extracted<SS> = ToRefs<StoreState<SS> & StoreGetters<SS> & PiniaCustomStateProperties<StoreState<SS>>> & StoreActions<SS>;
5
+ export function extractStore<SS extends StoreGeneric>(store: SS): Extracted<SS> {
6
+ const rawStore = toRaw(store);
7
+ const refs: Record<string, unknown> = {};
8
+
9
+ for (const [key, value] of Object.entries(rawStore)) {
10
+ if (isRef(value) || isReactive(value)) {
11
+ refs[key] = toRef(store, key);
12
+ } else if (typeof value === 'function') {
13
+ refs[key] = value;
14
+ }
15
+ }
16
+ return refs as Extracted<SS>;
17
+ }
package/types/form.ts ADDED
@@ -0,0 +1,73 @@
1
+ export {};
2
+
3
+ export enum FieldTypes {
4
+ TEXT = 'text',
5
+ NUMBER = 'number',
6
+ SWITCH = 'switch',
7
+ EMAIL = 'email',
8
+ PASSWORD = 'password',
9
+ FILE = 'file',
10
+ }
11
+
12
+ declare global {
13
+ type InputType = TextInput | NumberInput | FileInput | SwitchInput;
14
+ type FormMasks = 'numbers' | 'iin' | 'otp' | 'phone' | 'date' | 'post' | 'threeDigit' | 'iik';
15
+ type FormIcons = 'arrowRight' | 'search' | 'sms' | null;
16
+ type Suffix = 'kzt' | 'usd' | 'percent' | null;
17
+
18
+ export interface DynamicForm {
19
+ formRef: any;
20
+ sections: SectionType[];
21
+ fieldOrder?: string[];
22
+ }
23
+
24
+ type InputBase = {
25
+ modelValue?: any;
26
+ clearable?: boolean;
27
+ label?: string;
28
+ placeholder?: string;
29
+ readonly?: boolean;
30
+ disabled?: boolean;
31
+ arrowRight?: boolean;
32
+ maxLength?: number | null;
33
+ rules?: ValidationRule[];
34
+ iconName?: FormIcons;
35
+ value?: number;
36
+ suffix?: Suffix | null;
37
+ hint?: string | undefined;
38
+ maska?: FormMasks | null;
39
+ };
40
+
41
+ type FormControl<T extends InputType> = T & {
42
+ valid: boolean;
43
+ dirty: boolean;
44
+ touched: boolean;
45
+ };
46
+
47
+ type FileInput = InputBase & {
48
+ type: FieldTypes.FILE;
49
+ };
50
+
51
+ type TextInput = InputBase & {
52
+ type: FieldTypes.TEXT;
53
+ };
54
+
55
+ type SwitchInput = InputBase & {
56
+ type: FieldTypes.SWITCH;
57
+ labeling: boolean | null;
58
+ direction: 'horizontal' | 'vertical';
59
+ falseValue: boolean | string | null;
60
+ trueValue: boolean | string | null;
61
+ };
62
+
63
+ type NumberInput = InputBase & {
64
+ type: FieldTypes.NUMBER;
65
+ };
66
+
67
+ type ValidationRule = (value: string) => boolean | string;
68
+
69
+ type SectionType = {
70
+ title?: string;
71
+ fields: InputType[];
72
+ };
73
+ }
package/types/index.ts CHANGED
@@ -23,12 +23,13 @@ declare global {
23
23
  | 'checkcontract'
24
24
  | 'checkcontragent'
25
25
  | 'daskamkorlyk'
26
- | 'dso';
26
+ | 'dso'
27
+ | 'uu';
27
28
  type MemberKeys = keyof ReturnType<typeof useFormStore>;
28
29
  type MemberFormTypes = 'policyholderForm' | 'insuredForm' | 'beneficiaryForm' | 'beneficialOwnerForm' | 'policyholdersRepresentativeForm' | 'productConditionsForm';
29
30
  type SingleMember = 'policyholderForm' | 'policyholdersRepresentativeForm';
30
31
  type MultipleMember = 'insuredForm' | 'beneficiaryForm' | 'beneficialOwnerForm';
31
- type PanelTypes = 'settings' | 'panel';
32
+ type PanelTypes = 'settings' | 'panel' | 'rightPanel';
32
33
  type FileActions = 'view' | 'download';
33
34
  type RouteType = RouteLocationNormalizedLoaded | RouteLocationNormalized;
34
35
  type InputVariants = 'solo' | 'filled' | 'outlined' | 'plain' | 'underlined';
@@ -272,7 +273,7 @@ declare global {
272
273
  id: string | number;
273
274
  iin: string;
274
275
  fullName: string;
275
- sex: number;
276
+ gender: number;
276
277
  birthDate: string;
277
278
  insSum: number;
278
279
  premium?: number;