package com.aircraft.modules.order.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *
 * 订单确认状态枚举
 *
 * @author chenxiky
 * @version 1.0.0
 * @since 2025/7/31
 */
@Getter
@AllArgsConstructor
public enum ConfirmStatusEnum {
    /**
     * 默认值
     */
    NOT_CONFIRM(0, "默认值"),
    /**
     * 飞行员已确认
     */
    PILOT_CONFIRMED(1, "飞行员已确认"),

    /**
     * 客户已确认
     */
    CUSTOMER_CONFIRMED(2, "客户已确认"),
    ;

    /**
     * 状态码
     */
    private final Integer code;

    /**
     * 描述
     */
    private final String description;

    /**
     * 根据code获取枚举
     *
     * @param code ~
     * @return ~
     */
    public static ConfirmStatusEnum getInstance(Integer code) {
        for (ConfirmStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
