package com.vetti.common.enums;

/**
 * 岗位申请当前阶段
 */
public enum StageEnum {

    APPLIED("applied", "已申请"),
    SHORTLISTED("shortlisted", "入围"),
    INTERVIEW("interview", "面试"),
    OFFER("offer", "邀约"),
    HIRED("hired", "受雇"),
    REFUSE_OFFER("refuseOffer", "拒绝邀约"),
    INTERVIEW_FAIL("interviewFail", "面试失败"),

    ;

    private final String code;
    private final String info;

    StageEnum(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static StageEnum getByInfo(String code) {
        StageEnum[] entityEnums = values();
        for (StageEnum entityEnum : entityEnums) {
            if (entityEnum.getCode().equals(code)) {
                return entityEnum;
            }
        }
        return null;
    }
}
