import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 邮寄资费最优方案视图对象
 */
export interface CrmShippingTariffVO {
  tariffId: string | number;
  province: string;
  weightKg: number;
  queryCond: string;
  solutionName: string;
  price: number;
  remark: string;
}

/**
 * 查询最优惠方案
 * @param province 省份
 * @param weight 重量
 */
export const getBestSolution = (province: string, weight: number): AxiosPromise<CrmShippingTariffVO> => {
  return request({
    url: '/oa/crm/shippingTariff/getBestSolution',
    method: 'get',
    params: { province, weight }
  });
};
