package cn.iocoder.yudao.module.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.module.shop.entity.ShopCoupon;
import cn.iocoder.yudao.module.shop.entity.ShopCouponTemplate;


import java.util.List;

/**
 * 优惠券Service接口
 *
 * @author ruoyi
 * @date 2023-07-31
 */
public interface IShopCouponService extends IService<ShopCoupon>
{
    /**
     * 查询优惠券
     *
     * @param couponId 优惠券主键
     * @return 优惠券
     */
    public ShopCoupon selectShopCouponByCouponId(Long couponId);

    /**
     * 查询优惠券列表
     *
     * @param shopCoupon 优惠券
     * @return 优惠券集合
     */
    public IPage<ShopCoupon> selectShopCouponList(Page<ShopCoupon> page, ShopCoupon shopCoupon);

    /**
     * 新增优惠券
     *
     * @param shopCoupon 优惠券
     * @return 结果
     */
    public int insertShopCoupon(ShopCoupon shopCoupon);

    /**
     * 修改优惠券
     *
     * @param shopCoupon 优惠券
     * @return 结果
     */
    public int updateShopCoupon(ShopCoupon shopCoupon);
    public int hfStatus(ShopCoupon shopCoupon);


    /**
     * 批量删除优惠券
     *
     * @param couponIds 需要删除的优惠券主键集合
     * @return 结果
     */
    public int deleteShopCouponByCouponIds(Long[] couponIds);

    /**
     * 删除优惠券信息
     *
     * @param couponId 优惠券主键
     * @return 结果
     */
    public int deleteShopCouponByCouponId(Long couponId);

    public IPage<ShopCoupon> selectShopCouponByUserId(Page<ShopCoupon> page, ShopCoupon shopCoupon);

    public IPage<ShopCoupon> availableCouponsListByUserId(Page<ShopCoupon> page, ShopCoupon shopCoupon);

    public IPage<ShopCoupon> unAvailableCouponsListByUserId(Page<ShopCoupon> page,ShopCoupon shopCoupon);

    public int getOffsetCouponCount(Long userId, Long goodId);

    public List<ShopCoupon> getQxCouponList(Long userId, Long goodId);

    public List<ShopCoupon> unGetQxCouponList(Long userId, Long goodId);

    List<ShopCoupon>  canUseCoupon(Integer goodsId, String bindMoudle);
    Integer  canUseCouponCount(Integer goodsId, String bindMoudle);
    List<ShopCouponTemplate> canLedCoupon(Long partnerId);
    void drawDownCoupon(Long partnerId);

    List<ShopCouponTemplate> canLedCouponPlatform();
    void drawDownCouponPlatform();
}
