package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.biz.dal.dto.ActivityPlanRewardDto;
import com.yonge.cooleshow.biz.dal.vo.ActivityPlanRewardVo;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityPlanRewardSearch;
import com.yonge.cooleshow.biz.dal.entity.ActivityPlanReward;

import java.util.List;

/**
 * 活动计划奖品表 服务类
 *
 * @author liweifan
 * @date 2022-08-17
 */
public interface ActivityPlanRewardService extends IService<ActivityPlanReward> {

    /**
     * 查询详情
     *
     * @author liweifan
     * @date 2022-08-17
     */
    ActivityPlanRewardVo detail(Long id);

    ActivityPlanReward detailByActivityIdAndRewardId(Long activityId, Long rewardId, String group);
    /**
     * 分页查询
     *
     * @author liweifan
     * @date 2022-08-17
     */
    IPage<ActivityPlanRewardVo> selectPage(IPage<ActivityPlanRewardVo> page, ActivityPlanRewardSearch query);

    /**
     * 查询活动下的奖品
     *
     * @param activityId
     * @return
     */
    List<ActivityPlanRewardDto> queryActivityPlanReward(Long activityId);

    /**
     * 查询活动被删除的奖品
     *
     * @param activityId 活动id
     * @param rewardIds 当前奖品
     * @return
     */
    List<ActivityPlanReward> getDelRewardList(Long activityId, List<Long> rewardIds);

    /**
     * 新增或修改活动奖品
     * @param rewardDto
     * @return
     */
    Boolean saveOrUpdateReward(ActivityPlanRewardDto rewardDto);
    /**
     * 回收活动奖品
     * @param activityId
     * @return
     */
    Boolean recoveryReward(Long activityId);
    /**
     * 回收活动奖品
     * @param reward
     * @return
     */
    Boolean recoveryReward(ActivityPlanReward reward);
	/**
	 * 减少库存
	 * @param activityId 活动id
	 * @param activityRewardId  活动关闻奖品id
	 * @return
	 */
    int reduceStock(Long activityId, Long activityRewardId);
}