package com.fs.store.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum AfterStatusEnum {

    STATUS_0(0,"已提交等待平台审核"),
    STATUS_1(1,"平台已审核,等待用户发货"),
    STATUS_2(2,"用户已发货,等待仓库审核"),
    STATUS_3(3,"财务审核"),
    STATUS_4(4,"已完成"),

    AFTER_STATUS_0(0,"售后中"),
    AFTER_STATUS_1(1,"用户取消"),
    AFTER_STATUS_2(2,"商家拒绝"),
    AFTER_STATUS_3(3,"已完成");


    private Integer value;
    private String desc;

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

}
