From ebc30c7776a3e795be3e7d0acdf3629a1ffecc02 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 16 Mar 2022 13:14:07 -0400 Subject: [PATCH] More implementations for license plate lookup --- src/constants/endpoints.js | 4 + src/constants/store-actions.js | 2 + .../license-plate-lookup.vue | 232 +++++++++++------- src/router/router-constants/routing-table.js | 12 + src/store/index.js | 21 +- 5 files changed, 176 insertions(+), 95 deletions(-) diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 780501cc8..d62111d9d 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -43,6 +43,10 @@ const endpoints = { url: "/vehicle/api/v1/vehicle/Lookup", method: "POST", }, + LookupVinByPlate: { + url: "/vehicle/api/v1/vehicle/lookup-vin-by-plate", + method: "POST", + }, GetPartsOrQuestions: { url: "/parts/api/v1/parts/parts-or-questions", method: "POST", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index e83b44096..23b6330aa 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -11,7 +11,9 @@ const storeActions = { GET_EVOX_IMAGE: "getEvoxImage", LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms", LOOKUP_VEHICLE_BY_VIN: "lookupVehicleByVin", + LOOKUP_VIN_BY_PLATE: "lookupVinByPlate", GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions", + VALIDATE_ZIP: "validateZip", // DEPENDENCY MUTATIONS RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleAndDependencies", diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 43680361d..fb2c2bfbf 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -1,15 +1,15 @@ diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 97353d754..c30afcc7e 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -117,6 +117,18 @@ const routingTable = [ scenario: navigationScenarios.CLICKED_BACK, destinationFmgPageValue: fmgPageValues.ESTIMATE, }, + { + scenario: navigationScenarios.CONTINUING_WITH_PARTS_QUESTION, + destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, + }, + { + scenario: navigationScenarios.CONTINUING_WITH_MULTIPLE_PARTS, + destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, + }, + { + scenario: navigationScenarios.CONTINUING_WITH_SINGLE_PART, + destinationFmgPageValue: fmgPageValues.REVEAL, + }, ], }, ]; diff --git a/src/store/index.js b/src/store/index.js index 19055d449..2cdac764d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -50,12 +50,6 @@ export const state = { eventBus: [], pageData: {} }, - serviceLocation: { - zip: null, - }, - customer: { - emailAddress: null, - }, } // Export Mutations @@ -226,6 +220,15 @@ export const actions = { }, }); }, + lookupVinByPlate(context, { plate }) { + return globalMethods.callHttpClient({ + method: endpoints.LookupVinByPlate.method, + endpoint: endpoints.LookupVinByPlate.url, + payload: { + plate: plate, + }, + }); + }, getVehicleMakes(context, { year }) { return globalMethods.callHttpClient({ method: endpoints.GetVehicleMakes.method, @@ -270,6 +273,12 @@ export const actions = { payload: {}, }); }, + validateZip(context, {zip}) { + return globalMethods.callHttpClient({ + methods: endpoints.ValidateZip.method, + endpoint: `${endpoints.ValidateZip.url}/${zip}` + }) + }, // DEPENDENCY ACTIONS resetVehicleAndDependencies(context) {