Merge pull request #1711 from Safelite/feature/CSR-1511-ajc

CSR-1511: use coverage data from store
This commit is contained in:
AdamCaouetteSafelite 2024-01-30 09:06:51 -05:00 committed by GitHub
commit 428986cb4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1453,7 +1453,7 @@ export const actions = {
) { ) {
const order = context.state.order; const order = context.state.order;
const vehicle = context.state.order.vehicle; const vehicle = context.state.order.vehicle;
const payment = context.state.order.payment;
let lineItems = [ let lineItems = [
...(order.lineItems.supportingItems ?? []), ...(order.lineItems.supportingItems ?? []),
...(order.lineItems.vaps ?? []), ...(order.lineItems.vaps ?? []),
@ -1475,15 +1475,15 @@ export const actions = {
endDate: endDate, endDate: endDate,
shopAppointmentType: shopAppointmentType, shopAppointmentType: shopAppointmentType,
applicationName: applicationConfig.APPLICATION_NAME, applicationName: applicationConfig.APPLICATION_NAME,
parentAccountNumber: context.getters.payment.parentAccountNumber, parentAccountNumber: payment.parentAccountNumber,
carId: vehicle.carId, carId: vehicle.carId,
lineItems: lineItems, lineItems: lineItems,
glassPieces: glassPieces, glassPieces: glassPieces,
eon: order.eon, eon: order.eon,
coverage: { coverage: {
status: "", status: payment.insuranceCoverage.coverageStatus,
deductible: 0, deductible: order.policy.currentDeductible,
additionalAuthFlag: "", additionalAuthFlag: order.policy.additionalAuthFlag,
}, },
partSelection: { partSelection: {
hasAnsweredPartQuestions: !!order.damage.partQuestionAnswers?.length, hasAnsweredPartQuestions: !!order.damage.partQuestionAnswers?.length,
@ -1521,6 +1521,7 @@ export const actions = {
getMobileTimeSlots(context, { payload: { startDate, endDate }, pageNameToLog }) { getMobileTimeSlots(context, { payload: { startDate, endDate }, pageNameToLog }) {
const order = context.state.order; const order = context.state.order;
const vehicle = context.state.order.vehicle; const vehicle = context.state.order.vehicle;
const payment = context.state.order.payment;
let lineItems = [ let lineItems = [
...(order.lineItems.supportingItems ?? []), ...(order.lineItems.supportingItems ?? []),
...(order.lineItems.vaps ?? []), ...(order.lineItems.vaps ?? []),
@ -1539,15 +1540,15 @@ export const actions = {
startDate: startDate, startDate: startDate,
endDate: endDate, endDate: endDate,
applicationName: applicationConfig.APPLICATION_NAME, applicationName: applicationConfig.APPLICATION_NAME,
parentAccountNumber: context.getters.payment.parentAccountNumber, parentAccountNumber: payment.parentAccountNumber,
carId: vehicle.carId, carId: vehicle.carId,
lineItems: lineItems, lineItems: lineItems,
glassPieces: glassPieces, glassPieces: glassPieces,
eon: order.eon, eon: order.eon,
coverage: { coverage: {
status: "", status: payment.insuranceCoverage.coverageStatus,
deductible: 0, deductible: order.policy.currentDeductible,
additionalAuthFlag: "", additionalAuthFlag: order.policy.additionalAuthFlag,
}, },
partSelection: { partSelection: {
hasAnsweredPartQuestions: !!order.damage.partQuestionAnswers?.length, hasAnsweredPartQuestions: !!order.damage.partQuestionAnswers?.length,
@ -1566,6 +1567,7 @@ export const actions = {
}, },
zipCode: order.serviceLocation.zipCode, zipCode: order.serviceLocation.zipCode,
}; };
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetMobileTimeSlots.method, method: endpoints.GetMobileTimeSlots.method,
endpoint: endpoints.GetMobileTimeSlots.url, endpoint: endpoints.GetMobileTimeSlots.url,