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

import com.ruoyi.common.utils.collection.CollectionUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

@Getter
@AllArgsConstructor
public enum FaultStatus {

    REJECTED("0", "已驳回"),
    PENDING("1", "待处理"),
    REPAIRING("2", "维修中"),
    COMPLETED("3", "已完成");

    private final String code;
    private final String name;

    // 可以审核的故障审核状态
    public static List<String> canVerify() {
        return CollectionUtils.map(FaultStatus::getCode, PENDING);
    }

    // 可以完成的故障审核状态
    public static List<String> canComplete() {
        return CollectionUtils.map(FaultStatus::getCode, REPAIRING);
    }

}
