package com.bohuikeji.delivery.backstage.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.bohuikeji.delivery.backstage.entity.TCustomer;
import com.bohuikeji.delivery.backstage.entity.TOrder;
import com.bohuikeji.delivery.backstage.entity.discount.TDiscountMall;
import com.bohuikeji.delivery.backstage.entity.discount.TDiscountRecord;

import java.math.BigDecimal;
import java.text.ParseException;

/**
 * <p>
 * 发放代金券 服务类
 * </p>
 *
 * @author zhouliwu
 * @since 2021-03-29
 */
public interface ITDiscountRecordService extends IService<TDiscountRecord> {

    /**
     * 客户领取优惠券新增记录
     * @param createVoucher
     * @param tCustomer
     * @return
     */
    boolean saveRecord(TDiscountMall createVoucher, TCustomer tCustomer);

    /**
     *
     * @param order
     * @return
     */
    //BigDecimal getMemberOrder(TOrder order);

    /**
     * 客户下单后整体优惠金额（会员+优惠卷）
     * @param order
     * @return
     */
    TOrder getDisOrder(TOrder order);

    /**
     * 优惠券使用后修改优惠信息
     * @param order
     * @return
     */
    boolean updateRecord(TOrder order);

    /**
     * 将已过期数据更改状态
     * @param customerId
     * @return
     */
    boolean updateOverdue(Integer customerId) throws ParseException;

    /**
     * 判断是否为会员用户
     * @param customerId
     * @return
     */
    boolean getWhetherMember(Integer customerId);


}
