payload changes
This commit is contained in:
parent
7fbf836316
commit
e0c9aacb72
1 changed files with 6 additions and 39 deletions
|
|
@ -525,32 +525,13 @@ export const useMainStore = defineStore({
|
|||
}
|
||||
});
|
||||
}
|
||||
const endorsementsAdditionalInfo = {
|
||||
schoolProperty: '',
|
||||
parkingLot: ''
|
||||
};
|
||||
if (endorsementAnswersForPayload.includes(endorsementOptions.EDUCATOR)) {
|
||||
endorsementsAdditionalInfo.schoolProperty = 'Yes';
|
||||
}
|
||||
if (endorsementAnswersForPayload.includes(endorsementOptions.PARKING_GUARD)) {
|
||||
endorsementsAdditionalInfo.parkingLot = 'Yes';
|
||||
}
|
||||
|
||||
const orderItemsArray = [];
|
||||
const manualGlassNamesArray = [];
|
||||
const glassInformation = this.order.damage.glassToReplace;
|
||||
glassInformation?.forEach((glassPiece) => {
|
||||
const glassPieceObject = {
|
||||
name: glassPiece?.glassLocation?.toUpperCase()
|
||||
};
|
||||
orderItemsArray.push(glassPieceObject);
|
||||
manualGlassNamesArray.push(glassPiece.glassLocation);
|
||||
});
|
||||
if (this.order.customer.address.state === 'FL' && this.order.damage.isRepair) {
|
||||
const damageLocationObject = {
|
||||
name: damageLocationsSelected.WINDSHIELD.toUpperCase()
|
||||
};
|
||||
orderItemsArray.push(damageLocationObject);
|
||||
manualGlassNamesArray.push(damageLocationsSelected.WINDSHIELD);
|
||||
}
|
||||
|
||||
|
|
@ -560,27 +541,13 @@ export const useMainStore = defineStore({
|
|||
endpoint: endpoints.FinalDeductible.url,
|
||||
payload: {
|
||||
referralCorrelationId: this.order.referralCorrelationId,
|
||||
referralNumber: this.order.referralNumber,
|
||||
accountNumber: this.issConfig.parentAccountNumber?.toString() ?? '',
|
||||
additionalInfo: endorsementsAdditionalInfo,
|
||||
insured: {
|
||||
address: {
|
||||
state: this.order.customer.address.state
|
||||
}
|
||||
},
|
||||
lossInfo: {
|
||||
vehicle: {
|
||||
endorsements: endorsementAnswersForPayload
|
||||
},
|
||||
manualGlassNames: manualGlassNamesArray
|
||||
},
|
||||
policy: {
|
||||
policyState: this.order.customer.address.state,
|
||||
status: this.order.policy.status,
|
||||
currentDeductible: this.order.currentDeductible,
|
||||
noCoverage: this.order.policy.noCoverage
|
||||
},
|
||||
orderItems: orderItemsArray
|
||||
endorsements: endorsementAnswersForPayload,
|
||||
manualGlassNames: manualGlassNamesArray,
|
||||
policyState: this.order.customer.address.state,
|
||||
status: this.order.policy.status,
|
||||
currentDeductible: this.order.currentDeductible,
|
||||
noCoverage: this.order.policy.noCoverage
|
||||
}
|
||||
}).then((r) => {
|
||||
this.updateDeductible(r.data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue