package com.jeesharp.business.modules.mall.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单明细是否赠品，与 {@code mall_order_item.is_gift} 一致。
 *
 * @author jeesharp
 * @since 2026-05-15
 */
@Getter
@AllArgsConstructor
public enum MallOrderItemGiftEnum {

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

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

    private final Integer value;
    private final String desc;

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