From e4bceb5fe73f2430058232f70b19c9e040b1ce77 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 28 Apr 2026 15:52:35 -0400 Subject: [PATCH 1/2] CASH-699 add input fields for insurance-details page CASH-699 add input fields for insurance-details page --- package-lock.json | 129 +++++++++ package.json | 1 + src/constants/error-messages.js | 6 + src/constants/store-actions.js | 2 + src/constants/store-mutations.js | 4 + .../date-picker-popup/date-picker-popup.vue | 274 ++++++++++++++++++ .../coverage-statement/coverage-statement.vue | 29 +- .../insurance-details/insurance-details.vue | 235 ++++++++++++++- src/router/constants/navigation-scenarios.js | 2 + src/router/constants/routing-table.js | 8 + src/store/index.js | 49 ++++ 11 files changed, 729 insertions(+), 10 deletions(-) create mode 100644 src/digital-components/date-picker-popup/date-picker-popup.vue diff --git a/package-lock.json b/package-lock.json index 2e45411d6..d920027d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@adyen/adyen-web": "^6.27.0", "@iframe-resizer/child": "^5.3.3", + "@vuepic/vue-datepicker": "^12.1.0", "axios": "^0.30.2", "bootstrap": "^5.3.3", "core-js": "^3.38.1", @@ -1910,6 +1911,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@date-fns/tz": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.4.1.tgz", + "integrity": "sha512-P5LUNhtbj6YfI3iJjw5EL9eUAG6OitD0W3fWQcpQjDRc/QIsL0tRNuO1PcDvPccWL1fSTXXdE1ds+l95DV/OFA==" + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -2045,6 +2051,63 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz", + "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==", + "dependencies": { + "@floating-ui/utils": "^0.2.11" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz", + "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==", + "dependencies": { + "@floating-ui/core": "^1.7.5", + "@floating-ui/utils": "^0.2.11" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + }, + "node_modules/@floating-ui/vue": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@floating-ui/vue/-/vue-1.1.11.tgz", + "integrity": "sha512-HzHKCNVxnGS35r9fCHBc3+uCnjw9IWIlCPL683cGgM9Kgj2BiAl8x1mS7vtvP6F9S/e/q4O6MApwSHj8hNLGfw==", + "dependencies": { + "@floating-ui/dom": "^1.7.6", + "@floating-ui/utils": "^0.2.11", + "vue-demi": ">=0.13.0" + } + }, + "node_modules/@floating-ui/vue/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -3572,6 +3635,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.21", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", + "integrity": "sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==" + }, "node_modules/@types/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", @@ -4536,6 +4604,58 @@ "dev": true, "license": "MIT" }, + "node_modules/@vuepic/vue-datepicker": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-12.1.0.tgz", + "integrity": "sha512-QuWcO+CqIGYFoRNCagp9xUY9sMK/OHUlVIDxBYjw7HjCTWXfuE/r3l3loB00faEtb0Teo3DeBn26hT3tYA5pgg==", + "dependencies": { + "@date-fns/tz": "^1.4.1", + "@floating-ui/vue": "^1.1.9", + "@vueuse/core": "^14.1.0", + "date-fns": "^4.1.0" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "vue": ">=3.5.0" + } + }, + "node_modules/@vueuse/core": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-14.2.1.tgz", + "integrity": "sha512-3vwDzV+GDUNpdegRY6kzpLm4Igptq+GA0QkJ3W61Iv27YWwW/ufSlOfgQIpN6FZRMG0mkaz4gglJRtq5SeJyIQ==", + "dependencies": { + "@types/web-bluetooth": "^0.0.21", + "@vueuse/metadata": "14.2.1", + "@vueuse/shared": "14.2.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/@vueuse/metadata": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-14.2.1.tgz", + "integrity": "sha512-1ButlVtj5Sb/HDtIy1HFr1VqCP4G6Ypqt5MAo0lCgjokrk2mvQKsK2uuy0vqu/Ks+sHfuHo0B9Y9jn9xKdjZsw==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-14.2.1.tgz", + "integrity": "sha512-shTJncjV9JTI4oVNyF1FQonetYAiTBd+Qj7cY89SWbXSkx7gyhrgtEdF2ZAVWS1S3SHlaROO6F2IesJxQEkZBw==", + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -6693,6 +6813,15 @@ "node": ">=10" } }, + "node_modules/date-fns": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/debounce": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", diff --git a/package.json b/package.json index c55259920..2db948652 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dependencies": { "@adyen/adyen-web": "^6.27.0", "@iframe-resizer/child": "^5.3.3", + "@vuepic/vue-datepicker": "^12.1.0", "axios": "^0.30.2", "bootstrap": "^5.3.3", "core-js": "^3.38.1", diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 8b8c98881..6899c2aec 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -38,6 +38,12 @@ const errorMessages = { STYLE_REQUIRED: "Please select your vehicle style", PROMO_REQUIRED: "Please enter a promo code", INSURANCE_COMPANY_REQUIRED: "Please select an insurance company", + INSURANCE_COMPANY_NAME_REQUIRED: "Please enter your insurance company name", + POLICY_NUMBER_REQUIRED: "Please enter your policy number", + DATE_OF_LOSS_REQUIRED: "Please enter your date of damage", + DAMAGE_TYPES_REQUIRED: "How damage occurred is required", + ZIP_CODE_REQUIRED: "Please enter your ZIP code", + ZIP_CODE_FORMAT: "Zip must be 5 digits", }; export { errorMessages }; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 0246654a5..702f7c737 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -109,6 +109,8 @@ const storeActions = { SAVE_VAPS: "saveVaps", SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS: "saveActiveAndOrInactivePromos", SAVE_CUSTOMER_DETAILS: "saveCustomerDetails", + SAVE_INSURANCE_DETAILS: "saveInsuranceDetails", + SAVE_DAMAGE_DETAILS: "saveDamageDetails", SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes", SAVE_CCTOKEN: "saveCCToken", SAVE_PAYPAL_TOKEN: "savePaypalToken", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index f3abae544..c43e737d3 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -51,6 +51,10 @@ const storeMutations = { UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails", UPDATE_CUSTOMER_WAITLIST_REQUESTED: "updateCustomerWaitListRequested", + // INSURANCE / DAMAGE MUTATIONS + UPDATE_INSURANCE_DETAILS: "updateInsuranceDetails", + UPDATE_DAMAGE_DETAILS: "updateDamageDetails", + // ORDER MUTATIONS UPDATE_REFERRAL_NUMBER: "updateReferralNumber", UPDATE_REFERRAL_SEQUENCE_NUMBER: "updateReferralSequenceNumber", diff --git a/src/digital-components/date-picker-popup/date-picker-popup.vue b/src/digital-components/date-picker-popup/date-picker-popup.vue new file mode 100644 index 000000000..a1e30459a --- /dev/null +++ b/src/digital-components/date-picker-popup/date-picker-popup.vue @@ -0,0 +1,274 @@ + + + + + diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue index 081424f7c..adc35ba37 100644 --- a/src/layouts/coverage-statement/coverage-statement.vue +++ b/src/layouts/coverage-statement/coverage-statement.vue @@ -25,7 +25,7 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import navbar from "@/fmg-components/nav-bar/nav-bar"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import { Form } from "vee-validate"; - +import store from "@/store"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -33,7 +33,10 @@ export default { name: "coverage-statement", mixins: [], data() { - return {}; + return { + isClaimAndCoverage: this.isClaimAndCoverageFromStore(), + isRecalibrationOnOrder: this.isRecalibrationOnOrderFromStore(), + }; }, components: { Form, @@ -58,7 +61,29 @@ export default { }, methods: { + isClaimAndCoverageFromStore() { + return store.getters.order?.payment?.isClaimAndCoverage; + }, + isRecalibrationOnOrderFromStore() { + return store.getters.isRecalibrationOnOrder; + }, backButtonAction() { + if (!this.isClaimAndCoverage) { + this.$router.navigateWithoutSaving( + this.navigationScenarios.CLICKED_BACK_NON_CLAIM_AND_COVERAGE, + this.pageName + ); + return; + } + + if (this.isRecalibrationOnOrder) { + this.$router.navigateWithoutSaving( + this.navigationScenarios.CLICKED_BACK_RECALIBRATION_INFO, + this.pageName + ); + return; + } + this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_BACK, this.pageName diff --git a/src/layouts/insurance-details/insurance-details.vue b/src/layouts/insurance-details/insurance-details.vue index 47db3b136..4f938c6e3 100644 --- a/src/layouts/insurance-details/insurance-details.vue +++ b/src/layouts/insurance-details/insurance-details.vue @@ -1,13 +1,105 @@