package com.ycwl.basic.order.event;

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

import java.math.BigDecimal;
import java.util.Date;

/**
 * 退款状态变更事件
 */
@Data
public class RefundStatusChangeEvent {
    
    /**
     * 订单ID
     */
    private Long orderId;
    
    /**
     * 订单号
     */
    private String orderNo;
    
    /**
     * 退款记录ID
     */
    private Long refundId;
    
    /**
     * 退款单号
     */
    private String refundNo;
    
    /**
     * 旧的退款状态
     */
    private RefundStatus oldRefundStatus;
    
    /**
     * 新的退款状态
     */
    private RefundStatus newRefundStatus;
    
    /**
     * 退款金额
     */
    private BigDecimal refundAmount;
    
    /**
     * 变更时间
     */
    private Date changeTime;
    
    /**
     * 变更原因
     */
    private String changeReason;
    
    /**
     * 操作人ID
     */
    private Long operatorId;
    
    public RefundStatusChangeEvent(Long orderId, String orderNo, Long refundId, String refundNo,
                                 RefundStatus oldStatus, RefundStatus newStatus, 
                                 BigDecimal refundAmount, String changeReason, Long operatorId) {
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.refundId = refundId;
        this.refundNo = refundNo;
        this.oldRefundStatus = oldStatus;
        this.newRefundStatus = newStatus;
        this.refundAmount = refundAmount;
        this.changeReason = changeReason;
        this.operatorId = operatorId;
        this.changeTime = new Date();
    }
}