package com.ycwl.basic.order.event;

import com.ycwl.basic.order.enums.OrderStatus;
import lombok.Data;

import java.util.Date;

/**
 * 订单状态变更事件
 */
@Data
public class OrderStatusChangeEvent {
    
    /**
     * 订单ID
     */
    private Long orderId;
    
    /**
     * 订单号
     */
    private String orderNo;
    
    /**
     * 旧的订单状态
     */
    private OrderStatus oldOrderStatus;
    
    /**
     * 新的订单状态
     */
    private OrderStatus newOrderStatus;
    
    /**
     * 变更时间
     */
    private Date changeTime;
    
    /**
     * 变更原因
     */
    private String changeReason;
    
    /**
     * 操作人ID
     */
    private Long operatorId;
    
    public OrderStatusChangeEvent(Long orderId, String orderNo, 
                                OrderStatus oldStatus, OrderStatus newStatus, 
                                String changeReason, Long operatorId) {
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.oldOrderStatus = oldStatus;
        this.newOrderStatus = newStatus;
        this.changeReason = changeReason;
        this.operatorId = operatorId;
        this.changeTime = new Date();
    }
}