package com.fs.his.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum FsStoreOrderStatusEnum {
    STATUS_NE1(-1,"申请退款"),
    STATUS_NE2(-2,"退货成功"),
    STATUS_NE3(-3,"已取消"),
    STATUS_1(1,"待支付"),
    STATUS_2(2,"待发货"),
    STATUS_3(3,"待收货"),
    STATUS_4(4,"已完成"),

    REFUND_STATUS_0(0,"正常"),
    REFUND_STATUS_1(1,"退款中"),
    REFUND_STATUS_2(2,"已退款");



    private Integer value;
    private String desc;

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