hl-core 0.0.10-beta.48 → 0.0.10-beta.49
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 +18 -5
- package/components/Input/FileInput.vue +1 -1
- package/components/Pages/ProductConditions.vue +27 -15
- package/composables/classes.ts +1 -0
- package/composables/index.ts +6 -4
- package/package.json +1 -1
- package/store/data.store.ts +41 -12
- package/types/enum.ts +1 -0
- package/types/index.ts +1 -0
package/api/base.api.ts
CHANGED
|
@@ -423,12 +423,14 @@ export class ApiClass {
|
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
async startApplication(data: any) {
|
|
426
|
+
async startApplication(data: any, processCodeEnum?: number) {
|
|
427
|
+
const params = processCodeEnum !== undefined ? { processCodeEnum } : undefined;
|
|
427
428
|
return await this.axiosCall<{
|
|
428
429
|
processInstanceId: string;
|
|
429
430
|
}>({
|
|
430
431
|
method: Methods.POST,
|
|
431
432
|
url: `/${this.productUrl}/api/Application/StartApplication`,
|
|
433
|
+
params: params,
|
|
432
434
|
data: data,
|
|
433
435
|
});
|
|
434
436
|
}
|
|
@@ -539,18 +541,22 @@ export class ApiClass {
|
|
|
539
541
|
});
|
|
540
542
|
}
|
|
541
543
|
|
|
542
|
-
async calculateWithoutApplication(data: Types.RecalculationDataType, product: string | undefined | null = this.productUrl) {
|
|
544
|
+
async calculateWithoutApplication(data: Types.RecalculationDataType, product: string | undefined | null = this.productUrl, processCodeEnum?: number) {
|
|
545
|
+
const params = processCodeEnum !== undefined ? { processCodeEnum } : undefined;
|
|
543
546
|
return await this.axiosCall<Types.RecalculationResponseType>({
|
|
544
547
|
method: Methods.POST,
|
|
545
548
|
url: `/${product}/api/Application/Calculate`,
|
|
549
|
+
params: params,
|
|
546
550
|
data: data,
|
|
547
551
|
});
|
|
548
552
|
}
|
|
549
553
|
|
|
550
|
-
async getDefaultCalculationData(product: string | undefined | null = this.productUrl) {
|
|
554
|
+
async getDefaultCalculationData(product: string | undefined | null = this.productUrl, processCodeEnum?: number) {
|
|
555
|
+
const params = processCodeEnum !== undefined ? { processCodeEnum } : undefined;
|
|
551
556
|
return await this.axiosCall<Types.RecalculationDataType>({
|
|
552
557
|
method: Methods.GET,
|
|
553
558
|
url: `/${product}/api/Application/DefaultCalculatorValues`,
|
|
559
|
+
params: params,
|
|
554
560
|
});
|
|
555
561
|
}
|
|
556
562
|
|
|
@@ -812,10 +818,10 @@ export class ApiClass {
|
|
|
812
818
|
});
|
|
813
819
|
}
|
|
814
820
|
|
|
815
|
-
async saveInsuredList(processInstanceId: string | number, data: any) {
|
|
821
|
+
async saveInsuredList(processInstanceId: string | number, newInsureds: boolean, data: any) {
|
|
816
822
|
return await this.axiosCall({
|
|
817
823
|
method: Methods.POST,
|
|
818
|
-
url: `/${this.productUrl}/api/Application/saveInsuredList/?processInstanceId=${processInstanceId}`,
|
|
824
|
+
url: `/${this.productUrl}/api/Application/saveInsuredList/?processInstanceId=${processInstanceId}&newInsureds=${newInsureds}`,
|
|
819
825
|
data: data,
|
|
820
826
|
});
|
|
821
827
|
}
|
|
@@ -828,6 +834,13 @@ export class ApiClass {
|
|
|
828
834
|
});
|
|
829
835
|
}
|
|
830
836
|
|
|
837
|
+
async getInsuredsData(processInstanceId: string | number) {
|
|
838
|
+
return await this.axiosCall<Types.ClientV2[]>({
|
|
839
|
+
method: Methods.GET,
|
|
840
|
+
url: `/${this.productUrl}/api/Application/GetInsuredsData/?processInstanceId=${processInstanceId}`,
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
|
|
831
844
|
async getProcessGfot(processCode: string | number) {
|
|
832
845
|
return await this.axiosCall<Value[]>({
|
|
833
846
|
method: Methods.GET,
|
|
@@ -215,16 +215,16 @@
|
|
|
215
215
|
append-inner-icon="mdi mdi-chevron-right"
|
|
216
216
|
@append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
|
|
217
217
|
/>
|
|
218
|
-
<base-form-input
|
|
219
|
-
v-if="hasFixInsSum"
|
|
220
|
-
v-model="productConditionsForm.fixInsSum"
|
|
221
|
-
:readonly="isDisabledFixInsSum"
|
|
222
|
-
:clearable="!isDisabled"
|
|
223
|
-
:rules="fixInsSumRule"
|
|
224
|
-
:label="$dataStore.t('productConditionsForm.fixInsSum')"
|
|
225
|
-
:suffix="$constants.currencySymbols.kzt"
|
|
226
|
-
@input="onInputFixInsSum"
|
|
227
|
-
|
|
218
|
+
<!-- <base-form-input-->
|
|
219
|
+
<!-- v-if="hasFixInsSum"-->
|
|
220
|
+
<!-- v-model="productConditionsForm.fixInsSum"-->
|
|
221
|
+
<!-- :readonly="isDisabledFixInsSum"-->
|
|
222
|
+
<!-- :clearable="!isDisabled"-->
|
|
223
|
+
<!-- :rules="fixInsSumRule"-->
|
|
224
|
+
<!-- :label="$dataStore.t('productConditionsForm.fixInsSum')"-->
|
|
225
|
+
<!-- :suffix="$constants.currencySymbols.kzt"-->
|
|
226
|
+
<!-- @input="onInputFixInsSum"-->
|
|
227
|
+
<!-- />-->
|
|
228
228
|
<base-form-input
|
|
229
229
|
v-if="hasRequestedSumInsured"
|
|
230
230
|
v-model="productConditionsForm.requestedSumInsured"
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
327
327
|
:readonly="isDisabledAgentCommission"
|
|
328
328
|
:clearable="!isDisabledAgentCommission"
|
|
329
|
-
:rules="
|
|
329
|
+
:rules="agencyPartRule"
|
|
330
330
|
/>
|
|
331
331
|
</base-form-section>
|
|
332
332
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
@@ -958,6 +958,7 @@ export default defineComponent({
|
|
|
958
958
|
const customPension = ref<boolean>(false);
|
|
959
959
|
const transferSum = ref<number>(0);
|
|
960
960
|
const firstAmount = ref<boolean>(true);
|
|
961
|
+
const isHalykBank = formStore.lfb.policyholder.clientData.iin.replace(/-/g, '') === '940140000385';
|
|
961
962
|
|
|
962
963
|
const isShownAdditionalTerms = computed(() => {
|
|
963
964
|
if (whichProduct.value === 'gons') {
|
|
@@ -1013,6 +1014,13 @@ export default defineComponent({
|
|
|
1013
1014
|
? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
|
|
1014
1015
|
: [],
|
|
1015
1016
|
);
|
|
1017
|
+
const agencyPartRule = computed(() => {
|
|
1018
|
+
if (formStore.lfb.add || isHalykBank) {
|
|
1019
|
+
return productConditionsForm.agentCommission === 0 ? [] : dataStore.rules.required;
|
|
1020
|
+
} else {
|
|
1021
|
+
return dataStore.rules.required.concat(dataStore.rules.numbers, dataStore.rules.agentCommission);
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1016
1024
|
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
1017
1025
|
const hasCalculated = computed(() => {
|
|
1018
1026
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
|
|
@@ -1271,6 +1279,9 @@ export default defineComponent({
|
|
|
1271
1279
|
return true;
|
|
1272
1280
|
});
|
|
1273
1281
|
const isDisabledAgentCommission = computed(() => {
|
|
1282
|
+
if (isHalykBank) {
|
|
1283
|
+
return true;
|
|
1284
|
+
}
|
|
1274
1285
|
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1275
1286
|
return true;
|
|
1276
1287
|
}
|
|
@@ -2058,7 +2069,7 @@ export default defineComponent({
|
|
|
2058
2069
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2059
2070
|
const setApplicationData = dataStore.getConditionsData();
|
|
2060
2071
|
const hasSetApplication = await dataStore.setApplication(setApplicationData);
|
|
2061
|
-
if (hasSetApplication) await dataStore.calculate(route.params.taskId as string);
|
|
2072
|
+
if (hasSetApplication && !isHalykBank) await dataStore.calculate(route.params.taskId as string);
|
|
2062
2073
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
2063
2074
|
} else {
|
|
2064
2075
|
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
@@ -2072,7 +2083,7 @@ export default defineComponent({
|
|
|
2072
2083
|
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
2073
2084
|
} else {
|
|
2074
2085
|
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
2075
|
-
await dataStore.calculate(route.params.taskId as string);
|
|
2086
|
+
await dataStore.calculate(route.params.taskId as string, isHalykBank);
|
|
2076
2087
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
2077
2088
|
}
|
|
2078
2089
|
}
|
|
@@ -2184,7 +2195,7 @@ export default defineComponent({
|
|
|
2184
2195
|
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
2185
2196
|
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
2186
2197
|
}
|
|
2187
|
-
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
2198
|
+
if (!formStore.lfb.add && !isHalykBank && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
2188
2199
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
2189
2200
|
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
2190
2201
|
return sum + Number(i.insSum);
|
|
@@ -2490,8 +2501,9 @@ export default defineComponent({
|
|
|
2490
2501
|
isSlavePensionForm,
|
|
2491
2502
|
|
|
2492
2503
|
// Rules
|
|
2493
|
-
coverPeriodRule,
|
|
2494
2504
|
fixInsSumRule,
|
|
2505
|
+
agencyPartRule,
|
|
2506
|
+
coverPeriodRule,
|
|
2495
2507
|
|
|
2496
2508
|
// Functions
|
|
2497
2509
|
submitForm,
|
package/composables/classes.ts
CHANGED
|
@@ -1439,6 +1439,7 @@ export class FormStoreClass {
|
|
|
1439
1439
|
insisWorkDataApp?: Types.InsisWorkDataApp;
|
|
1440
1440
|
addCoverDto?: Types.AddCover[];
|
|
1441
1441
|
slave?: any;
|
|
1442
|
+
insuredCount?: number;
|
|
1442
1443
|
};
|
|
1443
1444
|
policyholderForm: Member;
|
|
1444
1445
|
policyholderFormKey: StoreMembers.policyholderForm;
|
package/composables/index.ts
CHANGED
|
@@ -533,9 +533,9 @@ export const getStrValuePerEnv = (which: WhichValuePerEnv) => {
|
|
|
533
533
|
test: 'http://aml-dev.halyklife.nb/api',
|
|
534
534
|
},
|
|
535
535
|
lkaUrl: {
|
|
536
|
-
production: '
|
|
537
|
-
development: '
|
|
538
|
-
test: '
|
|
536
|
+
production: '/#/efo',
|
|
537
|
+
development: '/#/efo',
|
|
538
|
+
test: '/#/efo',
|
|
539
539
|
},
|
|
540
540
|
};
|
|
541
541
|
return valuesPerEnv[which][import.meta.env.VITE_MODE as EnvModes];
|
|
@@ -864,12 +864,13 @@ export class RoleController {
|
|
|
864
864
|
isSecurity = () => this.isRole(constants.roles.Security);
|
|
865
865
|
isURAP = () => this.isRole(constants.roles.URAP);
|
|
866
866
|
isTravelAgent = () => this.isRole(constants.roles.TravelAgent);
|
|
867
|
+
isHR = () => this.isRole(constants.roles.HR);
|
|
867
868
|
hasAccess = () => {
|
|
868
869
|
const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn() || this.isDsuioOrv();
|
|
869
870
|
return {
|
|
870
871
|
invoiceInfo: this.isAdmin() || this.isSupport(),
|
|
871
872
|
toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
|
|
872
|
-
toLKAv2: this.isAgent() || this.isManagerHalykBank() || this.isServiceManager() || baseAccessRoles,
|
|
873
|
+
toLKAv2: this.isAgent() || this.isManagerHalykBank() || this.isServiceManager() || this.isHR() || baseAccessRoles,
|
|
873
874
|
toAML: this.isCompliance() || baseAccessRoles,
|
|
874
875
|
toAULETTI: this.isAgentAuletti() || this.isManagerAuletti() || baseAccessRoles,
|
|
875
876
|
toLKA_A: this.isAgentAuletti() || baseAccessRoles,
|
|
@@ -929,6 +930,7 @@ export class RoleController {
|
|
|
929
930
|
this.isSecurity() ||
|
|
930
931
|
this.isURAP() ||
|
|
931
932
|
this.isTravelAgent() ||
|
|
933
|
+
this.isHR() ||
|
|
932
934
|
baseAccessRoles,
|
|
933
935
|
};
|
|
934
936
|
};
|
package/package.json
CHANGED
package/store/data.store.ts
CHANGED
|
@@ -1844,7 +1844,10 @@ export const useDataStore = defineStore('data', {
|
|
|
1844
1844
|
async getDefaultCalculationData(showLoader: boolean = false, product: string | null = null) {
|
|
1845
1845
|
this.isLoading = showLoader;
|
|
1846
1846
|
try {
|
|
1847
|
-
const calculationData = await this.api.getDefaultCalculationData(
|
|
1847
|
+
const calculationData = await this.api.getDefaultCalculationData(
|
|
1848
|
+
this.isCalculator ? product : undefined,
|
|
1849
|
+
this.isLifeBusiness || product === 'lifebusiness' || this.isGns || product === 'gns' ? Number(this.processCode) : undefined,
|
|
1850
|
+
);
|
|
1848
1851
|
return calculationData;
|
|
1849
1852
|
} catch (err) {
|
|
1850
1853
|
ErrorHandler(err);
|
|
@@ -1966,7 +1969,11 @@ export const useDataStore = defineStore('data', {
|
|
|
1966
1969
|
calculationData.contractEndDate = formatDate(this.formStore.productConditionsForm.contractEndDate as string)!.toISOString();
|
|
1967
1970
|
calculationData.calcDate = formatDate(this.formStore.productConditionsForm.calcDate as string)!.toISOString();
|
|
1968
1971
|
}
|
|
1969
|
-
const calculationResponse = await this.api.calculateWithoutApplication(
|
|
1972
|
+
const calculationResponse = await this.api.calculateWithoutApplication(
|
|
1973
|
+
calculationData,
|
|
1974
|
+
this.isCalculator ? product : undefined,
|
|
1975
|
+
this.isLifeBusiness || product === 'lifebusiness' || this.isGns || product === 'gns' ? Number(this.processCode) : undefined,
|
|
1976
|
+
);
|
|
1970
1977
|
if (calculationResponse.amount)
|
|
1971
1978
|
this.formStore.productConditionsForm.requestedSumInsured =
|
|
1972
1979
|
this.isGons || product === 'gons' ? this.getNumberWithSpacesAfterComma(calculationResponse.amount) : this.getNumberWithSpaces(calculationResponse.amount);
|
|
@@ -2012,14 +2019,20 @@ export const useDataStore = defineStore('data', {
|
|
|
2012
2019
|
return !!this.formStore.productConditionsForm.requestedSumInsured && !!this.formStore.productConditionsForm.insurancePremiumPerMonth;
|
|
2013
2020
|
}
|
|
2014
2021
|
},
|
|
2015
|
-
async calculate(taskId: string) {
|
|
2022
|
+
async calculate(taskId: string, isHalykBank: boolean = false) {
|
|
2016
2023
|
this.isLoading = true;
|
|
2017
2024
|
try {
|
|
2018
2025
|
const id = this.formStore.applicationData.processInstanceId;
|
|
2019
2026
|
if (!this.isPension && !(this.formStore.lfb.add && (this.isLifeBusiness || this.isGns))) await this.api.setApplication(this.getConditionsData());
|
|
2020
2027
|
const result = ref();
|
|
2021
|
-
|
|
2022
|
-
|
|
2028
|
+
let applicationData = null;
|
|
2029
|
+
if (!isHalykBank) result.value = await this.api.getCalculation(String(id));
|
|
2030
|
+
if (this.isLifeBusiness || this.isGns) {
|
|
2031
|
+
await this.getApplicationDataV2(taskId);
|
|
2032
|
+
return;
|
|
2033
|
+
} else {
|
|
2034
|
+
applicationData = await this.api.getApplicationData(taskId);
|
|
2035
|
+
}
|
|
2023
2036
|
this.formStore.applicationData = applicationData;
|
|
2024
2037
|
if (this.formStore.applicationData.addCoverDto) this.formStore.additionalInsuranceTerms = this.formStore.applicationData.addCoverDto;
|
|
2025
2038
|
if ((this.isKazyna || this.isGons) && this.currencies.usd) {
|
|
@@ -3735,7 +3748,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3735
3748
|
policyholder.parentContractId = localStorage.getItem('policyId');
|
|
3736
3749
|
}
|
|
3737
3750
|
try {
|
|
3738
|
-
const response = await this.api.startApplication(policyholder);
|
|
3751
|
+
const response = await this.api.startApplication(policyholder, Number(this.processCode));
|
|
3739
3752
|
this.sendToParent(constants.postActions.applicationCreated, response.processInstanceId);
|
|
3740
3753
|
return response.processInstanceId;
|
|
3741
3754
|
} catch (err) {
|
|
@@ -3807,9 +3820,8 @@ export const useDataStore = defineStore('data', {
|
|
|
3807
3820
|
});
|
|
3808
3821
|
}
|
|
3809
3822
|
|
|
3810
|
-
if (insuredApp
|
|
3811
|
-
|
|
3812
|
-
this.formStore.lfb.clients = res;
|
|
3823
|
+
if (insuredApp === null) {
|
|
3824
|
+
await this.getInsuredsData();
|
|
3813
3825
|
}
|
|
3814
3826
|
|
|
3815
3827
|
if (accidentIncidents && accidentIncidents.length) {
|
|
@@ -3935,9 +3947,9 @@ export const useDataStore = defineStore('data', {
|
|
|
3935
3947
|
return ErrorHandler(err);
|
|
3936
3948
|
}
|
|
3937
3949
|
},
|
|
3938
|
-
async saveInsuredList(insuredList: any) {
|
|
3950
|
+
async saveInsuredList(insuredList: any, newInsureds: boolean) {
|
|
3939
3951
|
try {
|
|
3940
|
-
await this.api.saveInsuredList(this.formStore.applicationData.processInstanceId, insuredList);
|
|
3952
|
+
await this.api.saveInsuredList(this.formStore.applicationData.processInstanceId, newInsureds, insuredList);
|
|
3941
3953
|
return true;
|
|
3942
3954
|
} catch (err) {
|
|
3943
3955
|
return ErrorHandler(err);
|
|
@@ -3951,6 +3963,18 @@ export const useDataStore = defineStore('data', {
|
|
|
3951
3963
|
return ErrorHandler(err);
|
|
3952
3964
|
}
|
|
3953
3965
|
},
|
|
3966
|
+
async getInsuredsData() {
|
|
3967
|
+
try {
|
|
3968
|
+
const result = await this.api.getInsuredsData(this.formStore.applicationData.processInstanceId);
|
|
3969
|
+
if (result && result.length) {
|
|
3970
|
+
this.formStore.applicationData.insuredApp = result;
|
|
3971
|
+
const res = await this.newInsuredList(result);
|
|
3972
|
+
this.formStore.lfb.clients = res;
|
|
3973
|
+
}
|
|
3974
|
+
} catch (err) {
|
|
3975
|
+
return ErrorHandler(err);
|
|
3976
|
+
}
|
|
3977
|
+
},
|
|
3954
3978
|
newInsuredList(list: any) {
|
|
3955
3979
|
const clients = list.map((item: any, index: number) => {
|
|
3956
3980
|
const client = item.insuredData;
|
|
@@ -3967,6 +3991,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3967
3991
|
hasAttachedFile: client.hasAttachedFile,
|
|
3968
3992
|
insrBeginDate: client.insuredPolicyData.insrBeginDate ?? 'no',
|
|
3969
3993
|
insrEndDate: client.insuredPolicyData.insrEndDate ?? 'no',
|
|
3994
|
+
tableNumber: client.tableNumber,
|
|
3970
3995
|
};
|
|
3971
3996
|
});
|
|
3972
3997
|
return clients;
|
|
@@ -4031,7 +4056,11 @@ export const useDataStore = defineStore('data', {
|
|
|
4031
4056
|
return false;
|
|
4032
4057
|
}
|
|
4033
4058
|
|
|
4034
|
-
|
|
4059
|
+
const isHalykBank = this.formStore.lfb.policyholder.clientData.iin.replace(/-/g, '') === '940140000385';
|
|
4060
|
+
if (this.formStore.lfb.clients.length === 0 && !isHalykBank) {
|
|
4061
|
+
await this.getInsuredsData();
|
|
4062
|
+
}
|
|
4063
|
+
if (this.formStore.lfb.clients && !isHalykBank) {
|
|
4035
4064
|
if (this.validateMultipleMembersV2('clients', 'insuredApp', 'застрахованных') === false) {
|
|
4036
4065
|
return false;
|
|
4037
4066
|
}
|
package/types/enum.ts
CHANGED