import apiClient from "@/infrastructure/apiClient";
import apiPath from "@/infrastructure/apiPath";

export default {
  async getDefaultPriceList(priceType) {
    var defaultPriceListModel = await apiClient
      .get(apiPath.price.getDefaultPriceList + priceType)
      .then((r) => {
        return r.data;
      })
      .catch((e) => {
        console.log(e);
        return {};
      });
    return defaultPriceListModel;
  },
  async updateDefaultPriceList(priceListModel) {
    var defaultPriceListModel = await apiClient
      .put(apiPath.price.updateDefaultPriceList, priceListModel)
      .then((r) => {
        return r.data;
      })
      .catch((e) => {
        console.log(e);
        return {};
      });
    return defaultPriceListModel;
  },
  async exportDefaultPriceList() {
    var result = await apiClient
      .get(apiPath.price.exportDefaultPriceList)
      .then((r) => {
        return r.data;
      })
      .catch((e) => {
        console.log(e);
        return {};
      });
    return result;
  },
  async checkFee(feeModel) {
    var checkFeeResult = await apiClient
      .post(apiPath.price.checkFee, feeModel)
      .then((r) => {
        return r.data;
      })
      .catch((e) => {
        console.log(e);
        return {};
      });
    return checkFeeResult;
  },
};
