package com.softwarebr.nunu.service.user;

import com.brframework.commondb.core.EntityService;
import com.softwarebr.nunu.domain.OrderOnlinePay;
import com.softwarebr.nunu.domain.WxPayOrder;
import com.softwarebr.nunu.entity.user.Order;
import com.softwarebr.nunu.domain.Calculation;

/**
 * @date 2020-02-27 12:00:43
 * @author lilin
 */

public interface OrderService extends EntityService<Order, Long, Object> {


    /**
     * 订单号查询订单
     * @param orderNo
     * @return
     */
    Order accessObjectByOrderNo(String orderNo);

    /**
     * 取消订单
     * @param orderNo 订单号
     */
    void cancelOrder(String orderNo);

    /**
     * 订单退款处理
     * @param orderId 订单id
     * @param orderStatus 订单状态 {@link Order}
     */
    void refundOrder(Long orderId, Integer orderStatus);

    /**
     * 确认订单
     * @param memberId 用户id
     * @param orderNo 订单号
     * @param activityId 活动id
     * @param orderAmount 订单数量
     * @return
     */
    Order confirmOrder(Long memberId, String orderNo, Long activityId, Integer orderAmount);

    /**
     *
     * 订单价格计算
     * @param activityId 活动Id
     * @param orderAmount 订单数量
     * @return
     */
    Calculation calculationOrder(Long activityId, Integer orderAmount);

    /**
     * 在线支付
     * @param orderNo 订单号
     * @param payType 支付方式
     * @return
     */
    OrderOnlinePay onlinePayOrder(String orderNo, Integer payType);

    /**
     * 在线支付成功
     * @param orderNo 订单号
     */
    void onlinePaySuccess(String orderNo);

}