package com.cool.store.enums.order;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @Auther zx_szh
 * @Date 2026/3/18 14:24
 * @Version 1.0
 */
public enum WishlistStatusEnum {

    AGREE(0, "待完善加盟资质"),
    COMPLETE_POINT(5, "待绑定铺位"),
    LI_GUI_APPROVE(10, "待立规审核"),
    PASS(20, "通过"),
    REJECT(15, "拒绝"),
    ;

    private final Integer code;
    private final String desc;

    WishlistStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<Integer, WishlistStatusEnum> MAP = Arrays.stream(values())
            .collect(Collectors.toMap(WishlistStatusEnum::getCode, Function.identity(), (a, b) -> a));

    public static WishlistStatusEnum of(Integer code) {
        return MAP.get(code);
    }

}
