package com.jeesharp.business.modules.marketing.memberTenant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 会员-店铺绑定状态枚举。
 *
 * @author jeesharp
 * @since 2026-06-25
 */
@Getter
@AllArgsConstructor
public enum MemberTenantBindStatusEnum {

    UNBOUND(0, "未绑定"),
    BOUND(1, "已绑定"),
    RELEASED(2, "已解绑");

    private final Integer value;
    private final String desc;

    public static MemberTenantBindStatusEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (MemberTenantBindStatusEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public static String getDescByValue(Integer value) {
        MemberTenantBindStatusEnum item = fromValue(value);
        return item != null ? item.getDesc() : "";
    }
}
