INSR-10442: Fix circular dependency
This commit is contained in:
parent
ac8b485760
commit
696a673ec7
3 changed files with 8 additions and 12 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import { useMainStore } from '@/store';
|
||||
// USAA coverage overrides
|
||||
export function updateClaimRegistrationPayload(payload) {
|
||||
const mainStore = useMainStore();
|
||||
export function updateClaimRegistrationPayload(payload, order) {
|
||||
const isITAC = order.insuranceCoverage.coverageType === coverageType.ITAC;
|
||||
payload.additionalInfo = {
|
||||
offeredItac: mainStore.isITAC.toString(),
|
||||
qualifiedForItac: mainStore.isITAC.toString()
|
||||
offeredItac: isITAC.toString(),
|
||||
qualifiedForItac: isITAC.toString()
|
||||
};
|
||||
}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
import { useMainStore } from '@/store';
|
||||
|
||||
export async function updateClientSpecificFieldsForClaimRegistration(payload) {
|
||||
const mainStore = useMainStore();
|
||||
const parentAccountNumber = mainStore?.order?.parentAccountNumber;
|
||||
export async function updateClientSpecificFieldsForClaimRegistration(payload, order) {
|
||||
const parentAccountNumber = order.parentAccountNumber;
|
||||
if (!parentAccountNumber) { return; }
|
||||
|
||||
let clientMapper;
|
||||
|
|
@ -14,6 +11,6 @@ export async function updateClientSpecificFieldsForClaimRegistration(payload) {
|
|||
}
|
||||
|
||||
if (typeof clientMapper.updateClaimRegistrationPayload === 'function') {
|
||||
await clientMapper.updateClaimRegistrationPayload(payload);
|
||||
await clientMapper.updateClaimRegistrationPayload(payload, order);
|
||||
}
|
||||
}
|
||||
|
|
@ -714,7 +714,7 @@ export const useMainStore = defineStore({
|
|||
if (this.issConfig.useMemberNumber) {
|
||||
payload.memberNumber = this.order.policy.policyNumber;
|
||||
}
|
||||
await updateClientSpecificFieldsForClaimRegistration(payload);
|
||||
await updateClientSpecificFieldsForClaimRegistration(payload, this.order);
|
||||
const response = await globalMethods.callHttpClient({
|
||||
method: endpoints.RegisterClaim.method,
|
||||
endpoint: endpoints.RegisterClaim.url,
|
||||
|
|
|
|||
Loading…
Reference in a new issue