package com.ylx.massage.enums;

import com.ylx.common.utils.StringUtils;
import lombok.Getter;
import org.apache.commons.compress.utils.Lists;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lixl
 * @date 2024-03-27 11:51
 * 订单待结算枚举
 */
@Getter
public enum OrderWStateEnum {

    //进行中(待接单,已接单,已到达,服务中)
    NO_ACCOUNT(0, "未结算"),

    WAIT_ACCOUNT(1, "待结算"),

    OK_ACCOUNT(2, "已结算");



    private final Integer code;
    private final String info;

    OrderWStateEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public static List<Enumproject> getStatusEnum() {

        ArrayList<Enumproject> objects = Lists.newArrayList();
        for (OrderWStateEnum value : OrderWStateEnum.values()) {
            Enumproject enumproject = new Enumproject();
            enumproject.setInfo(value.getInfo());
            enumproject.setCode(value.getCode());
            objects.add(enumproject);
        }
        return objects;
    }

    public static String getDescByCode(Integer code) {
        for (OrderWStateEnum value : OrderWStateEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getInfo();
            }
        }
        return StringUtils.EMPTY;
    }

}
