package com.crm.rely.backend.core.constant;

/**
 * 钱包出金状态枚举
 */
public enum CardWalletWithdrawStatusEnum {
    PENDING("1","待处理"),
    PROCESSING("2", "处理中"),
    SUCCESS("3", "成功"),
    FAILED("4", "失败");

    private final String status;
    private final String description;

    CardWalletWithdrawStatusEnum(String status, String description) {
        this.status = status;
        this.description = description;
    }

    public String getStatus() {
        return status;
    }

    public String getDescription() {
        return description;
    }


    public static CardWalletWithdrawStatusEnum fromStatus(String status) {
        if (status == null) {
            return null;
        }
        for (CardWalletWithdrawStatusEnum statusEnum : values()) {
            if (statusEnum.getStatus().equals(status)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static String matchCode(String status) {
        CardWalletWithdrawStatusEnum statusEnum = fromStatus(status);
        return statusEnum != null ? statusEnum.getDescription() : "";
    }
}
