/**
 * Copyright (C) 2018-2022
 * All rights reserved, Designed By www.yixiang.co
 */
package co.yixiang.yshop.module.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author moxiangrong
 * 订单详情状态枚举
 */
@Getter
@AllArgsConstructor
public enum OrderDetailStateEnum {

    NORMAL(1, "正常"),
    IN_AFTER_SALES(2, "售后中"),
    AFTER_SALES_COMPLETE(3, "售后完成");


    private Integer value;
    private String desc;

    public static OrderDetailStateEnum toType(int value) {
        return Stream.of(OrderDetailStateEnum.values())
                .filter(p -> p.value == value)
                .findAny()
                .orElse(null);
    }


}
