package com.microservices.zone.member.service;

import com.microservices.common.core.web.page.GenericsTableDataInfo;
import com.microservices.zone.member.domain.points.ZonePointsApply;
import com.microservices.zone.member.domain.vo.ZonePointsApplyDetailVo;
import com.microservices.zone.member.domain.vo.ZonePointsApplyInputVo;
import com.microservices.zone.member.domain.vo.ZonePointsApplySearchVo;
import com.microservices.zone.member.domain.vo.ZonePointsApplyUpdateVo;

import java.util.List;

/**
 * 积分申请表Service接口
 *
 * @author otto
 */
public interface IZonePointsApplyService {
    /**
     * 查询积分申请
     *
     * @param id 积分申请主键
     * @return 积分申请
     */
    public ZonePointsApply selectZonePointsApplyById(Long id);

    /**
     * 查询积分申请列表
     *
     * @param zonePointsApply 积分申请
     * @return 积分申请集合
     */
    public GenericsTableDataInfo<ZonePointsApplyDetailVo> selectZonePointsApplyList(ZonePointsApplySearchVo searchVo);

    /**
     * 新增积分申请
     *
     * @param inputVo 积分申请
     * @return 结果
     */
    public int insertZonePointsApply(ZonePointsApplyInputVo inputVo);

    /**
     * 修改积分申请
     *
     * @param updateVo 积分申请
     * @return 结果
     */
    public int updateZonePointsApply(ZonePointsApplyUpdateVo updateVo);

    /**
     * 批量删除积分申请
     *
     * @param ids 需要删除的积分申请主键
     * @return 结果
     */
    public int deleteZonePointsApplyByIds(Long[] ids);

    /**
     * 删除积分申请信息
     *
     * @param id 积分申请主键
     * @return 结果
     */
    public int deleteZonePointsApplyById(Long id);

    /**
     * 根据用户ID和专区ID查询积分申请列表
     *
     * @param userId 用户ID
     * @param zoneId 专区ID
     * @return 积分申请列表
     */
    List<ZonePointsApply> selectZonePointsApplyByUserIdAndZoneId(Long userId, Long zoneId);

    /**
     * 检查用户是否有某类型的待处理申请（幂等校验）
     *
     * @param userId    用户ID
     * @param zoneId    专区ID
     * @param applyType 申请类型
     * @return true=已有待处理申请
     */
    boolean hasPendingApply(Long userId, Long zoneId, String applyType);
}