package com.ga.core.vo.commission;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 유지보수수당 기준 개월수 (V43 persistency_bonus_rule.retention_month)
 * 13/25/37/49개월 유지율 충족 시 각각 1회 지급.
 */
public enum RetentionMonth {
    M13(13),
    M25(25),
    M37(37),
    M49(49);

    private final int months;

    RetentionMonth(int months) {
        this.months = months;
    }

    @JsonValue
    public int getMonths() {
        return months;
    }

    public static RetentionMonth ofMonths(int months) {
        for (RetentionMonth rm : values()) {
            if (rm.months == months) return rm;
        }
        throw new IllegalArgumentException("Unsupported retention month: " + months);
    }
}
