package com.fs.erp.dto.sdk.wangdian.enums;

public enum RefundStatus {
    NO_REFUND(0, "无退款"),
    CANCELED_REFUND(1, "取消退款"),
    REFUND_APPLIED(2, "已申请退款"),
    WAITING_FOR_RETURN(3, "等待退货"),
    WAITING_FOR_RECEIPT(4, "等待收货"),
    REFUND_SUCCESSFUL(5, "退款成功");

    private final int value;
    private final String description;

    RefundStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据状态值获取枚举实例
     *
     * @param value 状态值
     * @return 对应的枚举实例，如果找不到则返回 null
     */
    public static RefundStatus fromValue(int value) {
        for (RefundStatus status : RefundStatus.values()) {
            if (status.value == value) {
                return status;
            }
        }
        return null;
    }

    // 可选：添加售前退款场景的特定方法（如果需要更精细的控制）
    // 例如，可以根据具体的售前退款场景，提供一个方法来获取对应的 RefundStatus
    // public static RefundStatus fromPreSaleScenario(PreSaleRefundScenario scenario) { ... }

}
