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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 会员收货地址「是否默认」枚举，与 {@code mall_member_address.is_default} 一致。
 *
 * @author jeesharp
 * @since 2026-04-28
 */
@Getter
@AllArgsConstructor
public enum MallMemberAddressDefaultEnum {

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

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

    private final Integer value;
    private final String desc;

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