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

import com.jeesharp.business.modules.common.enums.DisabledEnabledEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商城通用启用/禁用状态，与 {@code mall_brand.status}、{@code mall_spec.status}、{@code mall_spec_value.status} 等字段一致。
 *
 * @author jeesharp
 * @since 2026-05-07
 * @deprecated 使用 {@link DisabledEnabledEnum}
 */
@Deprecated
@Getter
@AllArgsConstructor
public enum MallDisabledEnabledStatusEnum {

    DISABLED(DisabledEnabledEnum.DISABLED.getValue(), DisabledEnabledEnum.DISABLED.getDesc()),
    ENABLED(DisabledEnabledEnum.ENABLED.getValue(), DisabledEnabledEnum.ENABLED.getDesc());

    private final Integer value;
    private final String desc;

    public static MallDisabledEnabledStatusEnum fromValue(Integer value) {
        DisabledEnabledEnum item = DisabledEnabledEnum.fromValue(value);
        if (item == null) {
            return null;
        }
        return item == DisabledEnabledEnum.DISABLED ? DISABLED : ENABLED;
    }

    public static String getDescByValue(Integer value) {
        return DisabledEnabledEnum.getDescByValue(value);
    }
}
