package com.fs.hisStore.enums;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum OrderAuditStateEnum {
    COMPANY_PENDING(0, "待销售审核"),
    COMPANY_REJECT(1, "销售审核拒绝"),
    ADMIN_PENDING(2, "待总后台审核"),
    ADMIN_REJECT(3, "总后台审核拒绝"),
    APPROVED(4, "审核通过"),
    ;

    private final Integer value;
    private final String desc;

    OrderAuditStateEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static OrderAuditStateEnum getOrderAuditStateEnum(Integer value) {
        return Arrays.stream(values())
                .filter(orderAuditStateEnum -> orderAuditStateEnum.getValue().equals(value))
                .findFirst()
                .orElse(null);
    }
}
