import {
  GENERATE_BUNDLE as URL_PREFIX,
  GENERATE_BUNDLE_SELECT_PRODUCTS,
  GENERATE_BUNDLE_BUNDLE_INFO,
} from '@/config/url-prefix'
import validatedRouteMixin from '@/app/_global/mixins/validatedRouteMixin'
import { mapGetters } from 'vuex'

export default {
  mixins: [validatedRouteMixin],
  data() {
    let self = this
    return {
      routingOrder: [
        {
          id: 1,
          path: `${URL_PREFIX}/${GENERATE_BUNDLE_SELECT_PRODUCTS}/1`,
          match: `${URL_PREFIX}/${GENERATE_BUNDLE_SELECT_PRODUCTS}`,
          previous: this.$t('Common.Back'), // text for previous step
          next: this.$t('Common.Next'), // text for next step
          validate: async () => {
            return self.getBundleCartDetails.bundleItems.length > 0
          },
        },
        {
          id: 2,
          path: `${URL_PREFIX}/${GENERATE_BUNDLE_BUNDLE_INFO}`,
          match: `${URL_PREFIX}/${GENERATE_BUNDLE_BUNDLE_INFO}`,
          previous: this.$t('Common.Back'), // text for previous step
          next: this.$t('Common.Next'), // text for next step
          complete: this.$t('Common.Confirm'),
          update: this.$t('Common.Update'),
        },
      ],
    }
  },
  computed: {
    ...mapGetters('myBundle', ['getBundleCartDetails']),
  },
}
