package com.cool.store.enums.master;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <p>
 * 门店闭店原因枚举类
 * </p>
 *
 * @author wangff
 * @since 2025/9/16
 */
@Getter
@AllArgsConstructor
public enum StoreCloseReasonEnum {
    // 这里的描述跟标品略微不同，但是描述不要改！！！跟每刻保持一致！！！
    REASON0(0, "不进货（外购）", StoreCloseNatureEnum.REQUIRE_CLOSE),
    REASON1(1, "门店形象差（不升级）", StoreCloseNatureEnum.REQUIRE_CLOSE),
    REASON2(2, "顾客投诉率高", StoreCloseNatureEnum.REQUIRE_CLOSE),
    REASON3(3, "加盟老板失联", StoreCloseNatureEnum.REQUIRE_CLOSE),
    REASON4(4, "其他严重违反加盟规定", StoreCloseNatureEnum.REQUIRE_CLOSE),
    REASON5(5, "卫生操作不达标", StoreCloseNatureEnum.REQUIRE_CLOSE),

    REASON6(6, "人员不足", StoreCloseNatureEnum.ONESELF_CLOSE),
    REASON7(7, "商圈转移或拆迁", StoreCloseNatureEnum.ONESELF_CLOSE),
    REASON8(8, "生意差", StoreCloseNatureEnum.ONESELF_CLOSE),
    REASON9(9, "房东不租", StoreCloseNatureEnum.ONESELF_CLOSE),
    REASON19(10, "想转行或想长休", StoreCloseNatureEnum.ONESELF_CLOSE),

    ;


    private final Integer code;

    private final String desc;

    private final StoreCloseNatureEnum closeNature;

    public static String getDescByCode(Integer code) {
        for (StoreCloseReasonEnum value : StoreCloseReasonEnum.values()) {
            if (value.code.equals(code)) {
                return value.desc;
            }
        }
        return null;
    }

    public static StoreCloseReasonEnum getByCode(Integer code) {
        for (StoreCloseReasonEnum value : StoreCloseReasonEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
