package com.jeesharp.business.modules.common.bizscene.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务业态场景分组枚举，用于管理端下拉分组展示。
 *
 * @author jeesharp
 * @since 2026-07-03
 */
@Getter
@AllArgsConstructor
public enum BizSceneGroupEnum {

    SCENIC("SCENIC", "景区与导览"),
    STAY("STAY", "住宿与休闲"),
    CONTENT("CONTENT", "内容与活动"),
    MALL("MALL", "商城与优惠");

    private final String code;
    private final String desc;

    public static BizSceneGroupEnum fromCode(String code) {
        if (code == null || code.isBlank()) {
            return null;
        }
        String c = code.trim();
        for (BizSceneGroupEnum item : values()) {
            if (item.code.equalsIgnoreCase(c)) {
                return item;
            }
        }
        return null;
    }

    public static String getDescByCode(String code) {
        BizSceneGroupEnum item = fromCode(code);
        return item != null ? item.getDesc() : "";
    }
}
