package jnpf.model.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @Title:FtbPersonnelsCofigEnum
 * @Author:peng.hao
 * @create: 2024/2/210:58
 */
@Getter
@RequiredArgsConstructor
public enum FtbPersonnelsCofigEnum {
    //1 入职审批配置  2 转正审批配置  3 调岗审批配置 4 离职审批配置 5 晋升审批配置
    ONBOARDING_APPROVAL_CONFIGURATION(1, "入职审批配置"),
    CONVERSION_APPROVAL_CONFIGURATION(2, "转正审批配置"),
    POST_TRANSFER_APPROVAL_CONFIGURATION(3, "调岗审批配置"),
    RESIGNATION_APPROVAL_CONFIGURATION(4, "离职审批配置"),
    PROMOTION_APPROVAL_CONFIGURATION(5, "晋升审批配置");

    private final Integer configType;
    private final String configName;


    public static String getConfigName(Integer configType) {
        FtbPersonnelsCofigEnum[] values = FtbPersonnelsCofigEnum.values();
        for (FtbPersonnelsCofigEnum value : values) {
            if (value.getConfigType() == configType) {
                return value.getConfigName();
            }
        }
        return null;
    }

    public static FtbPersonnelsCofigEnum getConfigType(int code) {
        FtbPersonnelsCofigEnum[] values = FtbPersonnelsCofigEnum.values();
        for (FtbPersonnelsCofigEnum value : values) {
            if (value.getConfigType() == code) {
                return value;
            }
        }
        return null;
    }
}
