import '@/types/Shopee/Seller/Marketing';
import { apiShopeeSeller } from '@/api/shopee/seller/init';

/**
 * @param type
 * @returns {Promise<ShopeeVoucherList[]>}
 */
export const getListVoucherAll = async (type = 0) => {
  const payload = {
    limit: 20,
    offset: 0,
    promotion_type: type,
  };

  const result = await apiShopeeSeller.get('/api/marketing/v3/voucher/list/', {
    params: payload,
  });
  return result.data.voucher_list;
};

export const getListVoucherActive = async () => {
  return getListVoucherAll(2);
};
