INSR-10442: Add function for customizing claim registration payload for specific clients
Needed to be able to include ITAC fields for USAA
This commit is contained in:
parent
90fc7f734d
commit
0cc245ca84
3 changed files with 23 additions and 0 deletions
5
src/constants/parent-account-numbers.js
Normal file
5
src/constants/parent-account-numbers.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
const parentAccountNumber = Object.freeze({
|
||||
USAA: 900040
|
||||
});
|
||||
|
||||
export default parentAccountNumber;
|
||||
16
src/helpers/coverage-helper.js
Normal file
16
src/helpers/coverage-helper.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import parentAccountNumber from "@/constants/parent-account-numbers";
|
||||
import { useMainStore } from "@/store";
|
||||
|
||||
export function updateClientSpecificFieldsForClaimRegistration(payload) {
|
||||
const mainStore = useMainStore();
|
||||
switch (mainStore.order.parentAccountNumber) {
|
||||
case parentAccountNumber.USAA:
|
||||
payload.additionalInfo = {
|
||||
offeredItac: mainStore.isITAC.toString(),
|
||||
qualifiedForItac: mainStore.isITAC.toString()
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ import { getDateForSavedSessionTimeout } from '@/helpers/session-helper';
|
|||
import { isMobileDevice } from '@/helpers/useragent-helper';
|
||||
import issPageValues from '@/router/router-constants/issPage-values';
|
||||
import { getNonFalseValuesOfPropertyInArrayOfObjects, sortArrayOfObjectsByPropertyValue } from '@/helpers/object-helper';
|
||||
import { updateClientSpecificFieldsForClaimRegistration } from '@/helpers/coverage-helper';
|
||||
|
||||
const storeId = 'main';
|
||||
|
||||
|
|
@ -713,6 +714,7 @@ export const useMainStore = defineStore({
|
|||
if (this.issConfig.useMemberNumber) {
|
||||
payload.memberNumber = this.order.policy.policyNumber;
|
||||
}
|
||||
updateClientSpecificFieldsForClaimRegistration(payload);
|
||||
const response = await globalMethods.callHttpClient({
|
||||
method: endpoints.RegisterClaim.method,
|
||||
endpoint: endpoints.RegisterClaim.url,
|
||||
|
|
|
|||
Loading…
Reference in a new issue