package jnpf.enums.attendance;

import lombok.Getter;

/**
 * 适配范围业务类型
 *
 * @author yanwenfu
 * @create 2025-09-18
 */
@Getter
public enum ScopeBizType {

    /** 加班规则 */
    OVERTIME_RULE("overtime_rule", "加班规则"),
    /** 公休规则 */
    PUBLIC_HOLIDAY_RULE("public_holiday_rule", "公休规则"),
    /** 节日规则 */
    FESTIVAL_RULES("festival_rules", "节日规则"),
    /** 假期规则 */
    LEAVE_RULES("leave_rules", "假期规则"),
    /** 考勤机规则 */
    ATTENDANCE_MACHINE("attendance_machine", "考勤机规则"),
    /** 考勤本配置 */
    ATTENDANCE_BOOK("attendance_book", "考勤本配置"),
    ;

    private final String value;

    private final String description;

    ScopeBizType(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public static ScopeBizType getScopeBizType(String value) {

        ScopeBizType[] values = ScopeBizType.values();
        for (ScopeBizType v : values) {
            if (v.getValue().equals(value)) {
                return v;
            }
        }
        return null;
    }
}
