package jnpf.model.cultivate.v2.enums;

import lombok.Getter;

/**
 * 我的考试枚举 (0: 待考试, 1: 待批阅, 2: 已逾期, 3: 合格, 4: 不合格, 5: 优秀)
 *
 * @author yanwenfu
 * @create 2026-03-04
 */
@Getter
public enum MyExamStatusEnum {

    /** 待考试 */
    WAIT(0, "待考试"),

    /** 待批阅 */
    WAIT_REVIEW(1, "待批阅"),

    /** 已逾期 */
    OVERDUE(2, "已逾期"),

    /** 合格 */
    QUALIFIED(3, "合格"),

    /** 不合格 */
    UNQUALIFIED(4, "不合格"),

    /** 优秀 */
    EXCELLENT(5, "优秀"),
    ;

    private final Integer code;
    private final String description;

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

    public static MyExamStatusEnum getByCode(Integer code) {
        for (MyExamStatusEnum statusEnum : values()) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum;
            }
        }
        return null;
    }
}
