package com.czg.account.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;
import java.util.List;

/**
 * 店铺经营模式枚举
 *
 * @author tankaikai
 * @since 2025-04-03 16:53
 */
@Getter
@RequiredArgsConstructor
public enum ShopTypeEnum {
    /**
     * 单店
     */
    ONLY("only", "单店"),
    /**
     * 连锁店
     */
    CHAIN("chain", "连锁店"),
    /**
     * 加盟店
     */
    JOIN("join", "加盟店"),
    ;

    private final String value;
    private final String text;


    public static List<String> getValues() {
        return Arrays.stream(values()).map(ShopTypeEnum::getValue).toList();
    }

    public static String getText(String value) {
        ShopTypeEnum item = Arrays.stream(values()).filter(obj -> value.equals(obj.getValue())).findFirst().orElse(null);
        if (item != null) {
            return item.getText();
        }
        return null;
    }

}
