package com.ycwl.basic.order.event;

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

import java.util.Date;

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