package com.ywt.outpatient.domain.models.enums;


/**
 * 订单状态枚举
 */
public enum OrderStatusEnum {

    Pending_Payment("待付款", 10),
    Already_Paid("已付款", 20),
    Refunded("已退款", 30),
    Cancel("已取消", 40),
    Over("已结束", 50),
    PendingConfirm("待确认", 60),
    SubmitReport("已提交报告", 70),
    InformPatient("已通知用户", 80),
    Settlement("已结算", 90),
    Evaluate("已评价", 100);

    private final String displayName;

    private final int value;

    OrderStatusEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static OrderStatusEnum getOrderStatus(int value){
        for (OrderStatusEnum orderStatusEnum : OrderStatusEnum.values()) {
            if (value == orderStatusEnum.getValue()) {
                return orderStatusEnum;
            }
        }
        return Pending_Payment;
    }
    public static String getOrderStatusString(int value) {
        for (OrderStatusEnum orderStatusEnum : OrderStatusEnum.values()) {
            if (value == orderStatusEnum.getValue()) {
                return orderStatusEnum.getDisplayName();
            }
        }
        return "";
    }
}
