package com.ycwl.basic.order.dto;

import lombok.Data;

/**
 * 支付回调响应DTO
 */
@Data
public class PaymentCallbackResponse {
    
    /**
     * 处理是否成功
     */
    private boolean success;
    
    /**
     * 响应消息
     */
    private String message;
    
    /**
     * 订单ID
     */
    private Long orderId;
    
    /**
     * 订单号
     */
    private String orderNo;
    
    /**
     * 支付状态变化类型
     */
    private String statusChangeType;
    
    /**
     * 创建成功响应
     */
    public static PaymentCallbackResponse success(Long orderId, String orderNo, String statusChangeType) {
        PaymentCallbackResponse response = new PaymentCallbackResponse();
        response.success = true;
        response.message = "回调处理成功";
        response.orderId = orderId;
        response.orderNo = orderNo;
        response.statusChangeType = statusChangeType;
        return response;
    }
    
    /**
     * 创建失败响应
     */
    public static PaymentCallbackResponse failure(String message) {
        PaymentCallbackResponse response = new PaymentCallbackResponse();
        response.success = false;
        response.message = message;
        return response;
    }
    
    /**
     * 创建失败响应（包含订单信息）
     */
    public static PaymentCallbackResponse failure(String message, Long orderId, String orderNo) {
        PaymentCallbackResponse response = new PaymentCallbackResponse();
        response.success = false;
        response.message = message;
        response.orderId = orderId;
        response.orderNo = orderNo;
        return response;
    }
}