package com.seer.teach.mall.handler;

import com.seer.teach.mall.entity.GoodsEntity;
import com.seer.teach.mall.entity.OrderChildEntity;
import com.seer.teach.mall.entity.OrderEntity;
import com.seer.teach.mall.entity.OrderGoodsEntity;

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

public interface OrderHandler {

    /**
     * 订单创建后
     *
     * @param order 订单
     * @param orderItems 订单项
     */
    default void afterOrderCreate(OrderEntity order, List<OrderGoodsEntity> orderItems, Map<Integer, GoodsEntity> goodsEntityMap) {}

    /**
     * 订单取消后
     *
     * @param order 订单
     * @param orderItems 订单项
     */
    default void afterOrderCancel(OrderEntity order, List<OrderGoodsEntity> orderItems) {}

    /**
     * 子订单取消后
     *
     * @param order 订单
     * @param childOrder 子订单
     * @param orderItems 订单项
     */
    default void afterOrderCancel(OrderEntity order,OrderChildEntity childOrder, List<OrderGoodsEntity> orderItems) {}
}