@@ -26,12 +26,7 @@
@@ -61,6 +56,7 @@ import {
} from '@/helpers/cms-content-helper';
export default {
name: 'servicePackageRadio',
+ emits:['link-event'],
mixins: [inputButtonWrapperMixin],
components: {
baseInputButton,
@@ -85,8 +81,13 @@ export default {
.split('- ') //At some point we'll want a better delimiter
.filter((lineItem) => lineItem);
}
+ },
+ textLinkEmit(copy) {
+ this.$parent.$emit('link-event', {
+ args: getRouterLinkRouteFromCopy(copy)
+ });
}
- },
+ }
};
diff --git a/src/layouts/service-packages/service-packages.vue b/src/layouts/service-packages/service-packages.vue
index 1104bbd8..14adb371 100644
--- a/src/layouts/service-packages/service-packages.vue
+++ b/src/layouts/service-packages/service-packages.vue
@@ -12,7 +12,7 @@
groupName="ServicePackageQuestion"
:availableLineItems="availableLineItems"
@vapsItemsSelected="vapsItemsSelectedAction"
- v-on="{ 'buttonEvent.openModal': openModalAction }"
+ v-on:link-event="openModalAction"
validationRules="option-required"
isRequired />
// Components
+ import baseFormMixin from '@/mixins/base-form-mixin';
import siteHeader from '@/iss-components/site-header/site-header';
import siteFooter from '@/iss-components/site-footer/site-footer';
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
@@ -51,11 +52,12 @@
defineRule('option-required', required(errorMessages.OPTION_REQUIRED));
+ const store = useMainStore();
+
export default {
name: 'service-packages',
+ mixins: [baseFormMixin],
async beforeRouteEnter(to, from, next) {
- const store = useMainStore();
-
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
@@ -104,18 +106,17 @@
},
data() {
return {
- selectedVaps: null,
- availableLineItems: null,
- supportingItems: null,
- pricedGlassParts: null
+ selectedVaps: [],
+ availableLineItems: [],
+ supportingItems: [],
+ pricedGlassParts: []
};
},
methods: {
openModalAction(modalName) {
- this.$refs[modalName].openModal();
+ this.$refs[modalName.args].openModal();
},
arePagePrerequisitesValid() {
- const store = useMainStore();
return (
store.order.serviceLocation.zipCode &&
store.order.serviceLocation.zipCodeCtu &&
@@ -132,8 +133,48 @@
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
forwardButtonAction() {
- //TODO: save items
+ if (!this.allGlassPartsAndItemsHavePrices()) {
+ console.error('One or more items have no price assigned!');
+ }
+ if (this.pricedGlassParts.length > 0) {
+
+ store.saveGlassParts(this.pricedGlassParts);
+ }
+ store.saveSupportingItems(this.supportingItems);
+ store.saveVaps(this.selectedVaps);
+
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
+ },
+ allGlassPartsAndItemsHavePrices() {
+ if (this.pricedGlassParts) {
+ for (let i = 0; i < this.pricedGlassParts.length; i++) {
+ if (this.priceIsNullOrZero(this.pricedGlassParts[i])) {
+ return false;
+ }
+ }
+ }
+ if (this.supportingItems) {
+ for (let i = 0; i < this.supportingItems.length; i++) {
+ if (this.priceIsNullOrZero(this.supportingItems[i])) {
+ return false;
+ }
+ }
+ }
+ if (this.selectedVaps) {
+ for (let i = 0; i < this.selectedVaps.length; i++) {
+ if (this.priceIsNullOrZero(this.selectedVaps[i])) {
+ return false;
+ }
+ }
+ }
+ return true;
+ },
+ priceIsNullOrZero(lineItem) {
+ return (
+ (lineItem.kitPrice == null || lineItem.kitPrice == 0) &&
+ (lineItem.laborAmount == null || lineItem.laborAmount == 0) &&
+ (lineItem.sellingPrice == null || lineItem.sellingPrice == 0)
+ );
}
},
components: {
diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.vue b/src/layouts/tpa-confirmation/tpa-confirmation.vue
new file mode 100644
index 00000000..d3157c9f
--- /dev/null
+++ b/src/layouts/tpa-confirmation/tpa-confirmation.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/layouts/tpa-search/tpa-search.vue b/src/layouts/tpa-search/tpa-search.vue
new file mode 100644
index 00000000..f3bb24f5
--- /dev/null
+++ b/src/layouts/tpa-search/tpa-search.vue
@@ -0,0 +1,71 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js
index fcbafd26..634a5dc3 100644
--- a/src/mixins/analytics-mixin.js
+++ b/src/mixins/analytics-mixin.js
@@ -144,18 +144,18 @@ export default {
const response = await useMainStore().initializeSession(payload);
- if (response.data) {
- if (response.data.sessionKey && skey === 0) {
+ if (response?.data) {
+ if (response?.data.sessionKey && skey === 0) {
setCookieProperties(
- { [cookieNames.SESSION_KEY]: response.data.sessionKey },
+ { [cookieNames.SESSION_KEY]: response?.data.sessionKey },
{
useDefaultFunnelCookieAttributes: false,
}
);
}
- if (response.data.sessionId && sid === "00000000-0000-0000-0000-000000000000") {
+ if (response?.data.sessionId && sid === "00000000-0000-0000-0000-000000000000") {
setCookieProperties(
- { [cookieNames.SESSION_ID]: response.data.sessionId },
+ { [cookieNames.SESSION_ID]: response?.data.sessionId },
{
maxAge: 60 * 30, // 30 minutes
}
diff --git a/src/router/router-constants/issPage-values.js b/src/router/router-constants/issPage-values.js
index 1416cf10..10b5d315 100644
--- a/src/router/router-constants/issPage-values.js
+++ b/src/router/router-constants/issPage-values.js
@@ -10,6 +10,7 @@ export const issPageValues = {
COVERAGE_STATEMENT: 'coverage-statement',
LICENSE_PLATE_LOOKUP: 'license-plate-lookup',
MOLDING_QUESTIONS: 'molding-questions',
+ ORDER_CONFIRMATION: 'order-confirmation',
PAYMENT_PAGE: 'payment-page',
PART_QUESTIONS: 'part-questions',
POLICY_HOLDER_DETAILS: 'policy-holder-details',
@@ -17,6 +18,7 @@ export const issPageValues = {
REVIEW_PAGE: 'review-page',
REVEAL: 'reveal',
SERVICE_LOCATION: 'service-location',
+ TPA_CONFIRMATION:'tpa-confirmation',
SERVICE_PACKAGES: 'service-packages',
SCHEDULE_PAGE: 'schedule-page',
VEHICLE_DAMAGE: 'vehicle-damage',
@@ -27,6 +29,8 @@ export const issPageValues = {
VEHICLE_STYLE: 'vehicle-style',
VEHICLE_YEAR: 'vehicle-year',
VIN_LOOKUP: 'vin-lookup',
- TPA_SUBMIT: 'tpa-submit'
+ TPA_SUBMIT: 'tpa-submit',
+ BAILOUT_PAGE: 'bailout-page',
+ TPA_SEARCH: 'tpa-search'
};
\ No newline at end of file
diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js
index 61978b87..7767781d 100644
--- a/src/router/router-constants/navigation-scenarios.js
+++ b/src/router/router-constants/navigation-scenarios.js
@@ -41,9 +41,11 @@ const navigationScenarios = {
CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS: "CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS",
CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS: "CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS",
- CLICKED_FORWARD_COVERAGE_STATEMENT: "CLICKED_FORWARD_COVERAGE_STATEMENT",
-
+ //Provider Preference
CLICKED_FORWARD_WITH_SAFELITE: "CLICKED_FORWARD_WITH_SAFELITE",
+ CLICKED_FORWARD_WITH_TPA: "CLICKED_FORWARD_WITH_TPA"
+
+
};
diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js
index 5c21f8ce..8048a922 100644
--- a/src/router/router-constants/routing-table.js
+++ b/src/router/router-constants/routing-table.js
@@ -421,7 +421,7 @@ const routingTable = function(store) {
destinationIssPageValue: issPageValues.CAPABILITY_QUESTIONS
},
{
- scenario: navigationScenarios.CLICKED_FORWARD_COVERAGE_STATEMENT,
+ scenario: navigationScenarios.CLICKED_FORWARD,
destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE
}
]
@@ -487,7 +487,7 @@ const routingTable = function(store) {
},
{
scenario: navigationScenarios.CLICKED_FORWARD,
- destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE
+ destinationIssPageValue: issPageValues.REVIEW_PAGE
}
]
},
@@ -497,11 +497,11 @@ const routingTable = function(store) {
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
- destinationIssPageValue: issPageValues.CONTACT_DETAILS,
+ destinationIssPageValue: issPageValues.CONTACT_DETAILS
},
{
scenario: navigationScenarios.CLICKED_FORWARD,
- destinationIssPageValue: issPageValues.PAYMENT_PAGE,
+ destinationIssPageValue: issPageValues.PAYMENT_PAGE
},
],
@@ -513,9 +513,26 @@ const routingTable = function(store) {
{
scenario: navigationScenarios.CLICKED_BACK,
destinationIssPageValue: issPageValues.REVIEW_PAGE
+ },
+ {
+ scenario: navigationScenarios.CLICKED_FORWARD,
+ destinationIssPageValue: issPageValues.ORDER_CONFIRMATION,
}
]
},
+
+ {
+ issPageValue: issPageValues.TPA_CONFIRMATION,
+ maps: [
+
+ {
+ scenario: navigationScenarios.CLICKED_FORWARD,
+ destinationIssPageValue: issPageValues.WELCOME_PAGE
+ },
+
+ ],
+ },
+
{
issPageValue: issPageValues.TPA_SUBMIT,
maps: [
@@ -528,6 +545,30 @@ const routingTable = function(store) {
destinationIssPageValue: issPageValues.TPA_CONFIRMATION,
},
]
+ },
+ {
+ issPageValue: issPageValues.ORDER_CONFIRMATION,
+ maps: [
+
+ {
+ scenario: navigationScenarios.CLICKED_FORWARD,
+ destinationIssPageValue: issPageValues.WELCOME_PAGE
+ },
+
+ ],
+ },
+ {
+ issPageValue: issPageValues.TPA_SEARCH,
+ maps: [
+ {
+ scenario: navigationScenarios.CLICKED_BACK,
+ destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE
+ },
+ {
+ scenario: navigationScenarios.CLICKED_FORWARD,
+ destinationIssPageValue: issPageValues.TPA_SUBMIT,
+ },
+ ]
}
];
};
diff --git a/src/store/index.js b/src/store/index.js
index eec2a8c4..0c28351f 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -97,7 +97,7 @@ const getDefaultState = () => {
},
issConfig: {
clientName: "Generic Insurance", // this is the default and will be overriden by the client's name
- clientDisplayName: "Generic Insurance",
+ clientDisplayName: "Generic Insurance", // this is the default and will be overridden by the client's name or client display name.
styleSheet: "",
accountNumber: 0,
isCoverageEnabled: false, // Indicates if we should be calling coverage on this flow.
@@ -497,8 +497,8 @@ export const useMainStore = defineStore({
///WARNING
///TODO: this is temp test code until serviceLocation is complete.
/// and ctu is available. Also, EON may need to be implemented.
- zipCodeToUse = "44902"
- ctuToUse = "01820"
+ zipCodeToUse = "44902";
+ ctuToUse = "01820";
let queryString =
`ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` +
`&CTU=${ctuToUse}` +
@@ -905,7 +905,15 @@ export const useMainStore = defineStore({
// Save new values
this.updateCapabilityQuestionAnswers(capabilityQuestionAnswersArray);
},
-
+ saveGlassParts(glassParts) {
+ this.order.lineItems.glassParts = glassParts;
+ },
+ saveSupportingItems(supportingItems) {
+ this.order.lineItems.supportingItems = supportingItems;
+ },
+ saveVaps(vaps) {
+ this.order.lineItems.vaps = vaps;
+ },
addEventToBus (event) {
this.applicationUser.eventBus.push(event);
},
@@ -973,7 +981,14 @@ export const useMainStore = defineStore({
endpoint: endpoints.LogPageView.url,
payload: payload,
logApiCall: false
- });
+ }).then(
+ (response) => {
+ return response;
+ },
+ (error) => {
+ console.log("Analytics Service Error: " + error.data);
+ }
+ );
},
logCustomEvent({ userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser})
{
@@ -999,7 +1014,14 @@ export const useMainStore = defineStore({
endpoint: endpoints.LogCustomEvent.url,
payload: payload,
logApiCall: false
- });
+ }).then(
+ (response) => {
+ return response;
+ },
+ (error) => {
+ console.log("Analytics Service Error: " + error.data);
+ }
+ );
},
initializeSession({ userId, sessionId, userAgent, referrer }) {
var payload = {
@@ -1018,7 +1040,14 @@ export const useMainStore = defineStore({
endpoint: endpoints.InitializeSession.url,
payload: payload,
logApiCall: false
- });
+ }).then(
+ (response) => {
+ return response;
+ },
+ (error) => {
+ console.log("Analytics Service Error: " + error.data);
+ }
+ );
},
updateLastPageVisited(lastPageVisited) {
@@ -1157,7 +1186,7 @@ export const useMainStore = defineStore({
resetPartsAndDependencies() {
this.resetGlassPartsState();
this.updateSupportingItems(null);
- },
+ }
},
persist: true
});