import { defineStore } from "pinia"; import { endpoints } from "@/constants/endpoints.js"; import globalMethods from "@/global-methods"; import { storeActions } from "@/constants/store-actions"; export const issStore = defineStore({ id: 'issStore', state() { return { order: { vehicle: { year: null, make: null, model: null, style: null, carId: null, category: null, vin: null, imageUrl: null, imageVifNumber: null, imageColor: null, registration: { licensePlate: null, address: null, city: null, state: null, zipCode: null, firstName: null, lastName: null, }, }, serviceLocation: { address: null, city: null, state: null, zipCode: null, }, customer: { emailAddress: null, }, damage: { isRepair: null, numberOfChips: null, glassToReplace: null, partQuestionAnswers: null, moldingQuestionAnswers: null, capabilityQuestionAnswers: null }, lineItems: { glassParts: null }, payment: { isInsurance: null, insuranceCoverage: { isVerified: null } }, referralNumber: null, referralDate: null, referralCorrelationId: null, accountNumber: 0, eon: null }, }; }, getters: {}, actions: { updateYear(state, year) { state.order.vehicle.year = year; }, updateMake(state, make) { state.order.vehicle.make = make; }, updateModel(state, model) { state.order.vehicle.model = model; }, // Vehicle saveVehicleYear(year) { if (this.$state.order.vehicle.year !== year) { this.updateYear(this.$state,year); } }, }, persist: true });