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

/**
 * 卡冻结状态枚举
 * @author gao
 * @date 2025/11/4 16:29
 */
public enum CardFreezeStatusEnum {
    UNFREEZE_WAIT_PROCESS("wait_process", "1", "解冻待处理"),
    FREEZE_WAIT_PROCESS("wait_process", "2", "冻结待处理"),
    UNFREEZE_PROCESSING("processing", "1", "解冻中"),
    FREEZE_PROCESSING("processing", "2", "冻结中"),
    UNFREEZE_SUCCESS("success", "1", "正常"),
    FREEZE_SUCCESS("success", "2", "冻结"),
    UNFREEZE_FAIL("fail", "1", "冻结"),
    FREEZE_FAIL("fail", "2", "正常");

    private final String freezeStatus;
    private final String freezeType;
    private final String description;

    CardFreezeStatusEnum(String freezeStatus, String freezeType, String description) {
        this.freezeStatus = freezeStatus;
        this.freezeType = freezeType;
        this.description = description;
    }

    public String getFreezeStatus() {
        return freezeStatus;
    }

    public String getFreezeType() {
        return freezeType;
    }

    public String getDescription() {
        return description;
    }

    public static String matchCode(String freezeStatus, String freezeType) {
        if (freezeStatus == null || freezeType == null) {
            return "";
        }
        for (CardFreezeStatusEnum enumItem : values()) {
            if (enumItem.getFreezeStatus().equals(freezeStatus) && enumItem.getFreezeType().equals(freezeType)) {
                return enumItem.getDescription();
            }
        }
        return "";
    }
}
