package com.clx.performance.enums.collect;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

public enum CollectTruckWaitEnum {
    ;

    @Getter
    @AllArgsConstructor
    public enum ReportType {
        LOAD(1, "货源地排队"),
        UNLOAD(2, "目的地排队");
        private final Integer code;
        private final String msg;

        public static Optional<ReportType> getByCode(int code) {
            return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
        }
    }

    @Getter
    @AllArgsConstructor
    public enum waitType {
        NO(1, "无需排队"),
        INNER(2, "场内需要排队"),
        OUTER(3, "场外需要排队");
        private final Integer code;
        private final String msg;

        public static Optional<waitType> getByCode(int code) {
            return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
        }
    }

    @Getter
    @AllArgsConstructor
    public enum AuditStatus {
        UNAUDIT(0, "待审核"),
        AUDIT(1, "已审核");
        private final Integer code;
        private final String msg;

        public static Optional<AuditStatus> getByCode(int code) {
            return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
        }
    }

}
