package com.yimeng.okr.enums;

import lombok.Getter;

@Getter
public enum Grade {
    S("S", 90, "卓越产出"),
    A("A", 75, "超出预期"),
    B("B", 60, "符合预期"),
    C("C", 0, "未达预期");

    private final String label;
    private final int minScore;
    private final String description;

    Grade(String label, int minScore, String description) {
        this.label = label;
        this.minScore = minScore;
        this.description = description;
    }

    public static Grade fromScore(double score) {
        for (Grade g : values()) {
            if (score >= g.minScore) return g;
        }
        return C;
    }
}
