package com.haha.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.haha.entity.UserCoupon;
import com.haha.entity.dto.CouponDistributeDTO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface UserCouponService extends IService<UserCoupon> {

    IPage<UserCoupon> getMyCoupons(Long userId, Integer status, int page, int pageSize);

    List<UserCoupon> getAvailableCoupons(Long userId);

    UserCoupon receiveCoupon(Long userId, Long templateId);

    void distributeCoupon(CouponDistributeDTO dto, Long operatorId, String operatorName);

    UserCoupon getDetail(Long id, Long userId);

    boolean useCoupon(Long id, Long userId, Long orderId, BigDecimal discountAmount);

    void expireCoupons();

    int countAvailableCoupons(Long userId);

    Map<String, Object> getCouponStatistics(Long templateId);

    IPage<UserCoupon> getUserCouponList(Long userId, String couponCode, Integer status, int page, int pageSize);

    int countReceivedByUser(Long userId, Long templateId);
}
