package com.hai.order.service;

import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.order.model.CreateOrderModel;

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

/**
 * @className: OrderService
 * @author: HuRui
 * @date: 2022/8/18
 **/
public interface OrderService {

    /**
     * 增加订单数据
     * @param order
     * @return
     */
    HighOrder insertOrderData(HighOrder order);

    /**
     * 修改订单数据
     * @param order
     * @return
     */
    HighOrder updateOrderData(HighOrder order);

    /**
     * 创建订单
     * @param createOrderModel 创建订单参数
     * @return
     */
    HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception;

    /**
     * 订单取消
     * @param orderNo  订单号
     * @param remarks  备注
     * @return
     */
    HighOrder cancelOrder(String orderNo,String remarks);

    /**
     * 订单退款
     * @param orderNo
     * @param remarks
     * @return
     */
    HighOrder refundOrder(String orderNo,String remarks);

    /**
     * 子订单退款
     * @param childOrderNo
     * @param remarks
     * @return
     */
    HighOrder refundChildOrder(String childOrderNo,String remarks);

    /**
     * 根据订单号查询交易订单号详情
     * @param orderNo  订单号
     * @return
     */
    HighOrder getOrderDetailByNo(String orderNo);

    /**
     * 根据子订单号查询子订单信息
     * @param childOrderNo
     * @return
     */
    HighChildOrder getChildOrderByNo(String childOrderNo);

    /**
     * 订单支付成功业务
     * @param order
     * @return
     */
    HighOrder orderPaySuccessBus(HighOrder order);

    /**
     * 异步处理订单支付成功业务
     * @param order
     * @return
     */
    void asyncOrderPaySuccess(HighOrder order);


    List<HighOrder> getOrderList(Map<String,Object> param);

}
