package com.czg.market.service;

import com.czg.market.dto.PpPackageOrderDTO;
import com.czg.market.vo.PpOrderListVO;
import com.czg.order.dto.GbOrderQueryParam;
import com.czg.order.vo.GbOrderCountVO;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.czg.market.entity.PpPackageOrder;

/**
 * 套餐推广订单 服务层。
 *
 * @author gyj
 * @since 2025-12-18
 */
public interface PpPackageOrderService extends IService<PpPackageOrder> {

    /**
     * 创建推广订单
     */
    Long createPackageOrder(Long packageId, Long shopId);

    /**
     * 根据订单 Id 查询推广订单详情
     */
    PpPackageOrderDTO getOrderDetailById(Long orderId, Long userId);

    /**
     * 助力订单
     */
    boolean helpOrder(Long orderId);

    /**
     * 查询订单分页
     */
    Page<PpOrderListVO> queryOrderList(Long shopId, Long userId, GbOrderQueryParam param);

    /**
     * 订单统计
     */
    GbOrderCountVO orderCount(Long shopId, GbOrderQueryParam param);

    /**
     * 取消订单
     */
    boolean cancelOrder(Long orderId);

    /**
     * 申请退款
     */
    boolean applyRefund(Long orderId, Long userId, String refundReason);

    /**
     * 确认退款
     */
    void confirmRefund(Long orderId, Long shopId);

    /**
     * 取消退款
     */
    boolean cancelRefund(Long orderId, Long userId, String refundReason);

    /**
     * 支付成功
     */
    void paySuccess(Long orderId, Long payOrderId);

    /**
     * 核销
     */
    boolean checkout(String verifyCode, Long shopId);

    /**
     * 过期订单
     */
    void expiredOrder(Long orderId);
}
