package com.cyksj.service.coupon;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cyksj.model.entity.CouponUser;
import com.cyksj.model.entity.OrderDon;
import com.cyksj.model.request.ChannelPopularizeCouponReq;
import com.cyksj.model.request.CouponCollectReq;
import com.cyksj.model.views.CouponUserView;
import com.cyksj.model.views.CouponView;

import java.util.List;

/*
 *项目名: netflix
 *文件名: CouponFontService
 *创建者: JavaZou
 *创建时间:2022/11/18 13:34
 */
public interface CouponFontService {
	/**
	 * 领取优惠券
	 */
	void collectCoupon(CouponCollectReq couponCollectReq, Long userId);

	/**
	 * 领取推荐优惠券
	 */
	void collectRecommendCoupon(CouponCollectReq couponCollectReq, Long userId);

	/**
	 * 一键领取推荐优惠券
	 */
	void collectWholeRecommendCoupon(Long userId);

	/**
	 * 可用/不可用优惠券
	 */
	Page<CouponUserView> getAvailableCouponList(Long skuId, Long couponId, Long userId, Boolean isRenew, Long start, Long limit);

	/**
	 * 优惠券状态
	 */
	void setCouponUserStatus(CouponUserView data, DateTime now);

	Integer collectRecommendCouponNum(Long userId, Boolean isNewUser);

	/**
	 * 更新优惠券有效时间
	 */
	void updateCouponUserValidTime(Long couponId, CouponUser couponUser);

	/**
	 * 归还优惠券
	 */
	void updateOrderDonCouponStatus(OrderDon orderDon);

	/**
	 * 渠道推广用户领取优惠券
	 */
	void receiveChannelPopularizeCoupon(ChannelPopularizeCouponReq req);

	/**
	 * 渠道推广一键领取优惠券
	 */
	void collectAllChannelCoupons(long userId, Long popularizeId);

	/**
	 * 新用户福利优惠券
	 */
	CouponUserView getNewUserWelfareCoupons(long userId, Long couponId);

	CouponUserView getCouponDetailById(long userId, Long couponId);

	CouponUserView receiveCoupon(long userId, Long couponId, CouponUser.Channel channel);
	List<CouponView> getGoodsUserActivityCoupons(long userId) throws Exception;

	void collectAllGoodsActivityCoupons(long userId) throws Exception;
}
