CSR-749 save-session additional data
This commit is contained in:
parent
ac528a861d
commit
610031f324
2 changed files with 58 additions and 42 deletions
|
|
@ -186,7 +186,6 @@ export default {
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
if (this.isRepair){
|
if (this.isRepair){
|
||||||
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
|
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
|
||||||
//todo: validation
|
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, {
|
await this.dispatchStoreAction(storeActions.SAVE_SERVICE_LOCATION, {
|
||||||
zipCode: this.serviceZipCode,
|
zipCode: this.serviceZipCode,
|
||||||
|
|
|
||||||
|
|
@ -805,48 +805,65 @@ export const actions = {
|
||||||
method: endpoints.SaveSession.method,
|
method: endpoints.SaveSession.method,
|
||||||
endpoint: endpoints.SaveSession.url,
|
endpoint: endpoints.SaveSession.url,
|
||||||
payload: {
|
payload: {
|
||||||
vehicle: {
|
applicationUser: {
|
||||||
carId: vehicle.carId,
|
crmCustomerId: applicationUser.crmCustomerId,
|
||||||
year: vehicle.year,
|
experiments: applicationUser.experiments,
|
||||||
make: vehicle.make,
|
lastPage: applicationUser.lastPageVisited,
|
||||||
model: vehicle.model,
|
pageData: applicationUser.pageData,
|
||||||
style: vehicle.style,
|
savedSessionId: applicationUser.savedSessionId,
|
||||||
vin: vehicle.vin,
|
},
|
||||||
registration: {
|
order: {
|
||||||
firstName: vehicle.registration.firstName,
|
vehicle: {
|
||||||
lastName: vehicle.registration.lastName,
|
carId: vehicle.carId,
|
||||||
streetAddress: vehicle.registration.address,
|
year: vehicle.year,
|
||||||
city: vehicle.registration.city,
|
make: vehicle.make,
|
||||||
state: vehicle.registration.state,
|
model: vehicle.model,
|
||||||
zipCode: vehicle.registration.zipCode,
|
style: vehicle.style,
|
||||||
licensePlateNumber: vehicle.registration.licensePlate,
|
vin: vehicle.vin,
|
||||||
|
registration: {
|
||||||
|
firstName: vehicle.registration.firstName,
|
||||||
|
lastName: vehicle.registration.lastName,
|
||||||
|
streetAddress: vehicle.registration.address,
|
||||||
|
city: vehicle.registration.city,
|
||||||
|
state: vehicle.registration.state,
|
||||||
|
zipCode: vehicle.registration.zipCode,
|
||||||
|
licensePlateNumber: vehicle.registration.licensePlate,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
customer: {
|
||||||
damage: {
|
emailAddress: order.customer.emailAddress,
|
||||||
numberOfChips: damage.numberOfChips,
|
},
|
||||||
glassToReplace: damage.glassToReplace,
|
damage: {
|
||||||
isRepair: damage.isRepair
|
numberOfChips: damage.numberOfChips,
|
||||||
},
|
glassToReplace: damage.glassToReplace,
|
||||||
customer: {
|
isRepair: damage.isRepair,
|
||||||
emailAddress: order.customer.emailAddress,
|
partQuestionAnswers: order.damage.partQuestionAnswers,
|
||||||
},
|
moldingQuestionAnswers: order.damage.moldingQuestionAnswers,
|
||||||
lineItems: {
|
capabilityQuestionAnswers: order.damage.capabilityQuestionAnswers
|
||||||
glassParts: lineItems.glassParts
|
},
|
||||||
},
|
lineItems: {
|
||||||
serviceLocation: {
|
glassParts: lineItems.glassParts
|
||||||
streetAddress: order.serviceLocation.address,
|
},
|
||||||
city: order.serviceLocation.city,
|
payment: {
|
||||||
state: order.serviceLocation.state,
|
InsuranceCoverage: {
|
||||||
zipCode: order.serviceLocation.zipCode
|
isVerified: order.payment.insuranceCoverage.isVerified ?? false
|
||||||
},
|
},
|
||||||
referralNumber: order.referralNumber?.toString(), // TODO It'd be nice to save these as strings in the first place
|
isInsurance: order.payment.isInsurance ?? false
|
||||||
referralDate: order.referralDate,
|
},
|
||||||
accountNumber: order.accountNumber?.toString(),
|
accountNumber: order.accountNumber?.toString(),
|
||||||
existingPromoCode: null,
|
providerNumber: "",
|
||||||
lastPage: applicationUser.lastPageVisited,
|
serviceLocation: {
|
||||||
crmCustomerId: applicationUser.crmCustomerId,
|
streetAddress: order.serviceLocation.address,
|
||||||
savedSessionId: applicationUser.savedSessionId,
|
city: order.serviceLocation.city,
|
||||||
experiments: applicationUser.experiments,
|
state: order.serviceLocation.state,
|
||||||
|
zipCode: order.serviceLocation.zipCode
|
||||||
|
},
|
||||||
|
existingPromoCode: null,
|
||||||
|
referralCorrelationId: order.referralCorrelationId,
|
||||||
|
referralDate: order.referralDate,
|
||||||
|
referralNumber: order.referralNumber?.toString(), // TODO It'd be nice to save these as strings in the first place
|
||||||
|
referralSequenceNumber: order.referralNumber?.toString(), // TODO Pass the referralSequence number once insurance flow creates it
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue