diff --git a/src/store/index.js b/src/store/index.js index d326a0b8..03541083 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -517,20 +517,43 @@ export const useMainStore = defineStore({ } }); } + const orderItemsArray = []; + const manuaGlassNamesArray = []; + const glassInformation = this.order.damage.glassToReplace; + glassInformation.forEach((glassPiece) => { + const glassPieceObject = { + name: glassPiece.glassLocation + }; + orderItemsArray.push(glassPieceObject); + manuaGlassNamesArray.push(glassPiece.glassLocation); + }); return new Promise((resolve, reject) => { globalMethods.callHttpClient({ method: endpoints.FinalDeductible.method, endpoint: endpoints.FinalDeductible.url, payload: { + referralCorrelationId: this.order.referralCorrelationId, + referralNumber: this.order.referralNumber, accountNumber: this.issConfig.parentAccountNumber?.toString() ?? '', - currentDeductible: this.order.currentDeductible, - noCoverage: this.order.policy.noCoverage, - endorsements: endorsementAnswersForPayload, + insured: { + address: { + state: this.order.customer.address.state + } + }, + lossInfo: { + vehicle: { + endorsements: endorsementAnswersForPayload + }, + manualGlassNames: manuaGlassNamesArray + }, policy: { - status: 'Active', // change to this.order.policy.status after changing back end request - policyState: this.order.vehicle.registration.state - } + policyState: this.order.customer.address.state, + status: this.order.policy.status, + currentDeductible: this.order.currentDeductible, + noCoverage: this.order.policy.noCoverage + }, + orderItems: orderItemsArray } }).then((r) => { this.updateDeductible(r.data);