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.ext.SaTicketExt;
import com.hzs.common.domain.sale.ticket.SaTicket;
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;

/**
 * 门票主表 服务类
 *
 * @author hzs
 * @since 2025-01-09
 */
public interface ISaTicketService extends IService<SaTicket> {

    /**
     * 验证会员账户余额，是否够支付
     *
     * @param cuMemberAccount 会员账户
     * @Author: sui q
     * @Date: 2022/9/5 15:28
     */
    void queryOrderSpendDetails(CuMemberAccountExt cuMemberAccount, BigDecimal payMoney, Long pkMember);

    /*
     * @description: 查询购票记录
     * @author: sui q
     * @date: 2025/1/10 11:29
     * @param: null null
     **/
    List<SaTicketExt> querySaTicketByParam(SaTicketParam saTicketParam);

    /*
     * @description: 修改门票
     * @author: sui q
     * @date: 2025/1/22 9:41
     * @param: null null
     **/
    Boolean updateSaTicketByParam(Long pkMember, List<BuyTicketParam> ticketParamList);

    /*
     * @description: 查询销售门票数量
     * @author: sui q
     * @date: 2025/1/13 11:36
     * @param: null null
     **/
    Integer queryBuySaTicketNum(Long pkTicket);

    /*
     * @description: 根据查询条件查询购买的门票
     * @author: sui q
     * @date: 2025/2/21 10:08
     * @param: null null
     **/
    SaTicket querySaTicketByParam(OrderParam orderParam, Long pkCreator);

    /*
     * @description: 撤销门票
     * @author: sui q
     * @date: 2025/2/21 10:17
     * @param: null null
     **/
    void cancelSaTicket(SaTicket saTicket, Long pkCreator);

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

    /*
     * @description: 在线支付生成订单编号
     * @author: sui q
     * @date: 2025/1/14 15:07
     * @param: null null
     **/
    String querySaTicketOnlineOrderCode(OrderParam orderParam, BigDecimal price);

    /*
     * @description: 在线支付回调
     * @author: sui q
     * @date: 2025/1/14 15:07
     * @param: null null
     **/
    void paySaTicketOnlineOrderCode(Long pkMember, String orderCode);

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