package com.hzs.sale.ticket.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.member.ext.CuMemberAccountExt;
import com.hzs.common.domain.sale.ticket.SaTicket;
import com.hzs.common.domain.sale.ticket.ext.SaTicketExt;
import com.hzs.sale.order.param.OrderParam;
import com.hzs.sale.ticket.param.BuyTicketParam;
import com.hzs.sale.ticket.param.SaTicketParam;

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

/**
 * 门票主表 服务类
 */
public interface ISaTicketService extends IService<SaTicket> {

    /**
     * 验证会员账户余额，是否够支付
     *
     * @param cuMemberAccount 会员账户
     */
    void queryOrderSpendDetails(CuMemberAccountExt cuMemberAccount, BigDecimal payMoney, Long pkMember);

    /*
     * 查询购票记录
     **/
    List<SaTicketExt> querySaTicketByParam(SaTicketParam saTicketParam);

    /*
     * 修改门票
     **/
    Boolean updateSaTicketByParam(Long pkMember, List<BuyTicketParam> ticketParamList);

    /*
     * 查询销售门票数量
     **/
    Integer queryBuySaTicketNum(Long pkTicket);

    /*
     * 根据查询条件查询购买的门票
     **/
    SaTicket querySaTicketByParam(OrderParam orderParam, Long pkCreator);

    /*
     * 撤销门票
     **/
    void cancelSaTicket(SaTicket saTicket, Long pkCreator);

    /**
     * 点击支付按钮，输入密码，确认下单(注册订单)
     *
     * @param orderParam         订单
     * @param cuMemberAccountExt 支付账户信息
     */
    SaTicket paySaTicket(OrderParam orderParam, BigDecimal price, CuMemberAccountExt cuMemberAccountExt, String orderCode);

    /**
     * 在线支付生成订单编号
     */
    String querySaTicketOnlineOrderCode(OrderParam orderParam, BigDecimal price);

    /**
     * 在线支付回调
     */
    void paySaTicketOnlineOrderCode(Long pkMember, String orderCode);

    /**
     * 查询会员购买票数
     *
     * @param pkTicket 门票活动
     * @param pkMember 会员ID
     * @return
     */
    Integer sumQuantity(Long pkTicket, Long pkMember);
}
