package com.haha.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.haha.entity.CouponTemplate;
import com.haha.entity.dto.CouponCreateDTO;
import com.haha.entity.dto.CouponQueryDTO;

import java.util.List;
import java.util.Map;

public interface CouponTemplateService extends IService<CouponTemplate> {

    IPage<CouponTemplate> getPage(CouponQueryDTO queryDTO);

    CouponTemplate getDetail(Long id);

    CouponTemplate create(CouponCreateDTO dto, Long creatorId, String creatorName);

    CouponTemplate update(CouponCreateDTO dto);

    boolean updateStatus(Long id, Integer status);

    boolean deleteTemplate(Long id);

    List<CouponTemplate> getAvailableTemplates();

    /**
     * 获取可领取优惠券列表（含用户已领取状态）
     *
     * @param userId 用户ID
     * @return 已填充 alreadyReceived 状态的优惠券模板列表
     */
    List<CouponTemplate> getAvailableTemplatesWithStatus(Long userId);

    boolean decreaseRemainCount(Long id);

    boolean increaseRemainCount(Long id);

    List<Long> getCouponShopIds(Long templateId);

    List<Long> getCouponProductIds(Long templateId);

    Map<String, Object> getStatistics(Long templateId);
}
