package com.hai.order.service;

import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.entity.HighOrderRefund;
import com.hai.order.model.RefundPriceModel;
import com.hai.order.type.OrderPayType;
import com.hai.order.type.OrderRefundOpUserType;

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

/**
 * 订单退款业务
 * @className: OrderRefundService
 * @author: HuRui
 * @date: 2022/9/1
 **/
public interface OrderRefundService {

    /**
     * 修改
     * @param orderRefund
     */
    void update(HighOrderRefund orderRefund);

    /**
     * 交易订单退款
     * @param order     交易订单
     * @param remarks   退款备注
     */
    HighOrder createOrderRefund(String refundOrderNo, HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;

    /**
     * 子订单退款
     * @param orderChild          子订单
     * @param refundOrderNo       退款单号
     * @param refundGoodsCount   退款商品数量
     * @param remarks            退款备注
     */
    HighOrderRefund createOrderChildRefund(HighChildOrder orderChild, String refundOrderNo, Integer refundGoodsCount, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;

    /**
     * 交易退钱
     * @param order
     * @param orderPayType
     * @param refundPrice
     * @param refundIntegral
     * @return
     */
    RefundPriceModel refundPrice(String refundOrderNo, HighOrder order, OrderPayType orderPayType, BigDecimal refundPrice, Integer refundIntegral) throws Exception;

    /**
     * 获取退款订单列表
     * @param param
     * @return
     */
    List<HighOrderRefund> getRefundOrderList(Map<String, Object> param);

    /**
     * 查询退款订单详情
     * @param refundOrderNo
     * @return
     */
    List<HighOrderRefund> getRefundByRefundNo(String refundOrderNo);

}
