package com.yida.data.common.core.enums.leave;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum LeaveRequestTypeEnum {
    /**
     * 1：病假，2：事假，0：其他，3年假，4调休假，5婚嫁，6产假，7陪产假
     */
    OTHER(1, "其他"),
    SICK(1, "病假"),
    ABSENCE(2, "事假"),
    YEAR(3, "年假"),
    COMP(4, "调休假"),
    MAR(5, "婚嫁"),
    MATER(6, "产假"),
    PATER(7, "陪产假");

    /**
     * 类型
     */
    private final Integer type;

    /**
     * 描述
     */
    private final String name;

    
    public static String getName(Integer type) {
        for (LeaveRequestTypeEnum typeEnum : LeaveRequestTypeEnum.values()) {
            if (ObjectUtil.equals(typeEnum.type, type)) {
                return typeEnum.name;
            }
        }
        return null;
    }
}
