package com.srs.common.enums;

public enum QgzxApplyStatus {
    SAVED("0", "保存"),                     // 0: 保存
    SUBMITTED("1", "已提交待审核"),           // 1: 已提交待审核
    COUNSELOR_APPROVED("3", "辅导员审核通过"), // 3: 辅导员审核通过
    INSTRUCTOR_APPROVED("2", "指导老师审核通过"), // 2: 指导员审核通过
    CENTER_OPINION("4", "资助办中心意见"),      // 4: 资助办中心意见
    APPROVED("5", "通过"),                   // 5: 通过
    REJECTED("10", "拒绝"),                   // 10: 拒绝
    RETURN("11", "驳回"),                   // 11: 驳回
    REPLY("14", "已重新提交");                 // 14: 已重新提交

    private final String code;
    private final String description;

    QgzxApplyStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 通过状态码获取对应的枚举
    public static QgzxApplyStatus fromCode(String code) {
        for (QgzxApplyStatus status : QgzxApplyStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的状态码: " + code);
    }
}


