package com.hzs.activity.draw.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.activity.draw.param.AcDrawRewardNumParam;
import com.hzs.activity.draw.param.PurchasedTimesParam;
import com.hzs.common.domain.activity.draw.AcDrawRewardNum;
import com.hzs.common.domain.activity.draw.ext.AcDrawRewardNumExt;
import com.hzs.common.domain.member.account.CuMemberAccount;
import com.hzs.common.domain.member.ext.CuMemberAccountExt;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;

import java.util.List;

/**
 * 会员可抽奖次数记录 服务类
 *
 * @author hzs
 * @since 2023-04-21
 */
public interface IAcDrawRewardNumService extends IService<AcDrawRewardNum> {

    /*
     * @description: 查询会员抽奖活动,查询会员的抽奖次数
     * @author: sui q
     * @date: 2023/4/22 10:11
     * @param: null null
     **/
    AcDrawRewardNum queryAcDrawRewardNum(AcDrawRewardNumParam acDrawRewardNumParam);

    /*
     * @description: 会员后台查询抽奖次数
     * @author: sui q
     * @date: 2023/6/1 10:36
     * @param: null null
     **/
    List<AcDrawRewardNumExt> queryDrawRewardExtNumByCondition(AcDrawRewardNumParam acDrawRewardNumParam);

    /*
     * @description: 更新会员抽奖次数
     * @author: sui q
     * @date: 2023/4/22 10:43
     * @param: null null
     **/
    Boolean updateAcDrawRewardNum(AcDrawRewardNum acDrawRewardNum);

    /**
     * 查询会员账户状态，账户信息
     *
     * @param cuMemberAccount 会员账户条件信息
     * @return: List<CuMemberAccountExt>
     * @Author: sui q
     * @Date: 2022/9/5 11:57
     */
    List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount);

    /*
     * @description: 查询
     * @author: sui q
     * @date: 2023/4/27 15:14
     * @param: null null
     **/
    AcDrawRewardNumExt queryDrawRewardNumByCondition(AcDrawRewardNumParam acDrawRewardNumParam);

    /*
     * @description: 支付抽奖次数
     * @author: sui q
     * @date: 2023/4/27 15:34
     * @param: null null
     **/
    void payDrawRewardNum(CuMemberAccountExt cuMemberAccountExt, Integer payNum, AcDrawRewardNumExt acDrawRewardNumExt);

    /*
     * @description: 在线支付确认生成待支付订单
     * @author: sui q
     * @date: 2023/4/27 17:54
     * @param: null null
     **/
    String confirmDrawRewardPayNum(AcDrawRewardNumParam acDrawRewardNumParam, AcDrawRewardNumExt acDrawRewardNum);

    /*
     * @description: 赠送抽奖次数
     * @author: sui q
     * @date: 2023/4/28 11:27
     * @param: null null
     **/
    Boolean giveMemberDrawNum(SaOrderExt saOrderExt);

    /*
     * @description: 撤单时回退抽奖次数
     * @author: sui q
     * @date: 2023/5/9 9:46
     * @param: null null
     **/
    Boolean backGiveMemberDrawNum(SaOrderExt saOrderExt);

    /**
     * 充值已购买次数(审批发起)
     *
     * @param purchasedTimesParam
     */
    void purchasedTimes(PurchasedTimesParam purchasedTimesParam);

    /**
     * 修改已购买次数 （更新）
     *
     * @param pkMember
     * @param num
     * @param pkBaseId
     */
    Boolean updatePurchasedTimesByBaseId(Long pkMember, Integer num, Long pkBaseId);

    /**
     * 修改已购买次数 审批通过
     *
     * @param approvalBusinessResultDTO
     * @return
     */
    String approvalAgree(ApprovalBusinessResultDTO approvalBusinessResultDTO);

    /**
     * 修改已购买次数 审批驳回
     *
     * @param approvalBusinessResultDTO
     * @return
     */
    String approvalReject(ApprovalBusinessResultDTO approvalBusinessResultDTO);

    /**
     * 充值未购买次数 (审批发起)
     *
     * @param purchasedTimesParam
     * @return
     */
    void unpurchasedTimes(PurchasedTimesParam purchasedTimesParam);

    /**
     * 充值已购买次数
     *
     * @param approvalBusinessResultDTO
     */
    void rechargePurchasedTimes(ApprovalBusinessResultDTO approvalBusinessResultDTO);

    /**
     * 充值未购买次数
     *
     * @param approvalBusinessResultDTO
     */
    void unRechargePurchasedTimes(ApprovalBusinessResultDTO approvalBusinessResultDTO);
}
