package com.ruoyi.bst.orderDevice.domain.enums;

import java.util.List;

import com.ruoyi.common.utils.collection.CollectionUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OrderDeviceStatus {

    WAIT_USE("WAIT_USE", "待使用"),
    USING("USING", "使用中"),
    FINISHED("FINISHED", "已完成");

    private String code;
    private String name;

    /**
     * 允许开始的订单设备状态
     * @return
     */
    public static List<String> canStart() {
        return CollectionUtils.map(OrderDeviceStatus::getCode, WAIT_USE);
    }

    /**
     * 允许结束的订单设备状态
     * @return
     */
    public static List<String> canFinish() {
        return CollectionUtils.map(OrderDeviceStatus::getCode, USING);
    }

    /**
     * 在使用的订单设备状态
     * @return
     */
    public static List<String> inUse() {
        return CollectionUtils.map(OrderDeviceStatus::getCode, USING);
    }
}
