package com.ywt.domain.models.enums;


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

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

    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){
        switch (value){
            case 10:
                return Pending_Payment;
            case 20:
                return Already_Paid;
            case 30:
                return Refunded;
            case 40:
                return Cancel;
            case 50:
                return Over;
            case 60:
                return PendingConfirm;
            case 70:
                return SubmitReport;
            case 80:
                return InformPatient;
            default:
                return Pending_Payment;
        }
    }
}
