package com.jeesharp.business.modules.finance.invoice.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 发票抬头是否默认枚举，与 {@code app_invoice_title.is_default} 一致。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Getter
@AllArgsConstructor
public enum InvoiceTitleDefaultEnum {

    /** 否 */
    NO(0, "否"),

    /** 是 */
    YES(1, "是");

    private final Integer value;
    private final String desc;

    public static InvoiceTitleDefaultEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (InvoiceTitleDefaultEnum e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }
}
