package com.bohuikeji.delivery.backstage.service;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bohuikeji.delivery.backstage.entity.TOrder;
import com.bohuikeji.delivery.backstage.entity.discount.TDiscountOrder;
import com.bohuikeji.delivery.backstage.entity.discount.TDiscountRecord;


import java.math.BigDecimal;

/**
 * <p>
 * 客户下单使用优惠券 服务类
 * </p>
 *
 * @author zhouliwu
 * @since 2021-03-29
 */
public interface ITDiscountOrderService extends IService<TDiscountOrder> {

    /**
     * 下单使用优惠信息从新计算预估金额
     * 历史存入明细
     * @param order
     * @return
     */
    //BigDecimal useDiscount(TOrder order);

    /**
     * 下单时保存订单使用优惠记录
     * @param order
     * @return
     */
    boolean saveDiscount(TOrder order,TDiscountRecord discountRecord);

    /**
     * 支付时记录微信优惠记录
     * @param order
     * @return
     */
    boolean wxDiscount(TOrder order, JSONObject jsonObject);

    /**
     * 订单取消是退还优惠卷
     * @param order
     * @return
     */
    TOrder cancelOrderDisByVoucher(TOrder order);
}
