import * as actions from './actions'
import getters from './getters'
import mutations from './mutations'
import * as L from '../../../utils/localStorageKeys'

const state = {
  salesVoucherToRedeem: 0,
  salesVoucherSelectedProduct: {
    product: { sku: '', name: '' },
    dummy: { dummy_products: [] },
    quantity: 0,
  },
  applicationFormLink: null,
  salesVoucherSelectedVoucher: [],
  orderHistoryPaginationSize: 10,
  isRentalSaleOrder: 0,
  searchText: JSON.parse(localStorage.getItem(L.ORDER_HISTORY_SEARCH_TEXT)) || { doc: '', member: { user_id: '' } },
  ekSmartSearchText: JSON.parse(localStorage.getItem(L.EK_SMART_ORDER_HISTORY_SEARCH_TEXT)) || {
    doc: '',
    member: { user_id: '' },
  },
  showRedemptionModal: false,
  selectedDummies: JSON.parse(localStorage.getItem(L.SALES_EVOUCHER_SELECTED_DUMMY_IDS)) || { sizes: [], evoucher: [] },
}

export default {
  state,
  actions,
  mutations,
  getters,
}
