package com.cool.store.enums;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @Author suzhuhong
 * @Date 2025/5/13 9:57
 * @Version 1.0
 */
public enum ExtendFieldTypeEnum {

    TEST_STORE_MANAGER_MOBILE("extend_field_1746670633436","店长手机号"),
    TEST_SIGNATORY_NAME_1("extend_field_1746670645231","签约人1名称"),
    TEST_SIGNATORY_MOBILE_1("extend_field_1746670652805","签约人1手机号"),
    TEST_SIGNATORY_NAME_2("extend_field_1746670671614","签约人2名称"),
    TEST_SIGNATORY_MOBILE_2("extend_field_1746670686307","签约人2手机号"),
    TEST_ORDER_NAME("extend_field_1747103227333","订单小程序名称"),
    TEST_JOIN_MODE("extend_field_1749175173890","加盟模式"),
    TEST_STORE_TYPE("extend_field_1749175177455","门店类型"),
    TEST_BRAND("extend_field_1749177175079","品牌"),
    ONLINE_STORE_MANAGER_MOBILE("extend_field_1746598536903","店长手机号"),
    ONLINE_SIGNATORY_NAME_1("extend_field_1746598562255","签约人1名称"),
    ONLINE_SIGNATORY_MOBILE_1("extend_field_1746598570479","签约人1手机号"),
    ONLINE_SIGNATORY_NAME_2("extend_field_1746598584139","签约人2名称"),
    ONLINE_SIGNATORY_MOBILE_2("extend_field_1746598594140","签约人2手机号"),
    ONLINE_ORDER_NAME("extend_field_1746599049206","订单小程序名称"),
    ONLINE_JOIN_MODE("extend_field_1748315801670","加盟模式"),
    ONLINE_STORE_TYPE("extend_field_1748315809671","门店类型"),
    ONLINE_BRAND("extend_field_1749176993442","品牌"),;

    private String key;

    private String msg;

    ExtendFieldTypeEnum(String key,String msg){
        this.key = key;
        this.msg = msg;
    }
    public static Map<String, ExtendFieldTypeEnum> getConfigMapByActive(String active){
        Map<String, ExtendFieldTypeEnum> configMap =new HashMap<>();
        switch (active){
            case "online":
                configMap.put(ONLINE_STORE_MANAGER_MOBILE.getMsg(),ONLINE_STORE_MANAGER_MOBILE);
                configMap.put(ONLINE_SIGNATORY_NAME_1.getMsg(),ONLINE_SIGNATORY_NAME_1);
                configMap.put(ONLINE_SIGNATORY_MOBILE_1.getMsg(),ONLINE_SIGNATORY_MOBILE_1);
                configMap.put(ONLINE_SIGNATORY_NAME_2.getMsg(),ONLINE_SIGNATORY_NAME_2);
                configMap.put(ONLINE_SIGNATORY_MOBILE_2.getMsg(),ONLINE_SIGNATORY_MOBILE_2);
                configMap.put(ONLINE_ORDER_NAME.getMsg(),ONLINE_ORDER_NAME);
                configMap.put(ONLINE_JOIN_MODE.getMsg(),ONLINE_JOIN_MODE);
                configMap.put(ONLINE_STORE_TYPE.getMsg(),ONLINE_STORE_TYPE);
                configMap.put(ONLINE_BRAND.getMsg(),ONLINE_BRAND);
                break;
            default:
                configMap.put(TEST_STORE_MANAGER_MOBILE.getMsg(),TEST_STORE_MANAGER_MOBILE);
                configMap.put(TEST_SIGNATORY_NAME_1.getMsg(),TEST_SIGNATORY_NAME_1);
                configMap.put(TEST_SIGNATORY_MOBILE_1.getMsg(),TEST_SIGNATORY_MOBILE_1);
                configMap.put(TEST_SIGNATORY_NAME_2.getMsg(),TEST_SIGNATORY_NAME_2);
                configMap.put(TEST_SIGNATORY_MOBILE_2.getMsg(),TEST_SIGNATORY_MOBILE_2);
                configMap.put(TEST_ORDER_NAME.getMsg(),TEST_ORDER_NAME);
                configMap.put(TEST_JOIN_MODE.getMsg(),TEST_JOIN_MODE);
                configMap.put(TEST_STORE_TYPE.getMsg(),TEST_STORE_TYPE);
                configMap.put(TEST_BRAND.getMsg(),TEST_BRAND);
                break;
        }
        return configMap;
    }
    public static Map<String, ExtendFieldTypeEnum> configMap(){
        return Arrays.stream(ExtendFieldTypeEnum.values())
                .collect(Collectors.toMap(
                        ExtendFieldTypeEnum::getKey,
                        e -> e
                ));
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
