package com.ycwl.basic.service.pc;

import com.github.pagehelper.PageInfo;
import com.ycwl.basic.dto.MobileOrderRequest;
import com.ycwl.basic.enums.OrderStateEnum;
import com.ycwl.basic.model.mobile.order.OrderAppPageReq;
import com.ycwl.basic.model.mobile.order.RefundOrderReq;
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
import com.ycwl.basic.model.pc.order.req.CreateBatchOrderReqVO;
import com.ycwl.basic.model.pc.order.req.CreateOrderReqVO;
import com.ycwl.basic.model.pc.order.req.OrderUpdateReq;
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
import com.ycwl.basic.order.dto.PaymentParamsRequest;
import com.ycwl.basic.order.dto.PaymentParamsResponse;
import com.ycwl.basic.pay.entity.PayResponse;
import com.ycwl.basic.pricing.dto.PriceCalculationResult;
import com.ycwl.basic.utils.ApiResponse;

import java.util.List;
import java.util.Map;

/**
 * @Author：longbinbin
 * @Date：2024/12/3 13:51
 */
public interface OrderService {
    ApiResponse<PageInfo<OrderRespVO>> pageQuery(OrderReqQuery query);
    ApiResponse<PageInfo<OrderRespVO>> pageQueryDetail(OrderReqQuery query);

    ApiResponse<List<OrderRespVO>> list(OrderReqQuery query);

    ApiResponse<OrderRespVO> detail(Long orderId);

//    ApiResponse<WxPayRespVO> add(OrderAddReq query) throws Exception;

    ApiResponse<Integer> update(OrderUpdateReq query);


    void updateOrderState(Long orderSn, OrderStateEnum orderStateEnum, String refundReason);

    ApiResponse<Integer> getOrderCountByUserId(Long userId);

    ApiResponse<PageInfo<OrderAppRespVO>> appPageQuery(OrderAppPageReq orderReqQuery);

    ApiResponse<OrderAppRespVO> appDetail(Long id);


    /**
     * 订单退款
     *
     * @param refundOrderReq
     * @return
     */
    ApiResponse<?> refundOrder(RefundOrderReq refundOrderReq);

    /**
     * 审核退款
     *
     * @param refundOrderReq
     * @return
     */
    ApiResponse<?> auditRefundOrder(RefundOrderReq refundOrderReq);

    void remarkOrder(Long orderId, OrderEntity query);

    ApiResponse<PageInfo<OrderRespVO>> refundPageQuery(OrderReqQuery query);

    ApiResponse<Map<String, Object>> createOrder(Long userId, CreateOrderReqVO orderAddReq) throws Exception;

    ApiResponse<Map<String, Object>> createBatchOrder(Long userId, CreateBatchOrderReqVO batchOrderReqVO) throws Exception;

    PayResponse queryOrder(Long orderId);

    Long createOrderCompact(Long userId, MobileOrderRequest request, PriceCalculationResult cachedResult);

    ApiResponse<PaymentParamsResponse> getPaymentParams(Long orderId, Long userId, PaymentParamsRequest request);
}
