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

/**
 * type(参考ywt_center.config id 为20的记录)：服务类型，1-互联网就诊，2-问诊，3-随访订单，4-会诊订单，5-转诊订单，6-外诊订单
 */
public enum CommonBillTypeEnum {
    OFFLINE_CONSULTATION("互联网就诊", 1),
    CONSULT_ORDER("问诊", 2),
    FOLLOW_UP_ORDER("随访订单", 3),
    TREATMENT("会诊订单", 4),
    TRANSFER_TREATMENT("转诊订单", 5),
    ATTENDING_TREATMENT("外诊订单", 6),
    WITHDRAW("提现", 7),
    UNKNOWN("未知", 0);

    private final String displayName;

    private final int value;

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

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static CommonBillTypeEnum valueOf(int value) {
        for (CommonBillTypeEnum typeEnum : CommonBillTypeEnum.values()) {
            if (typeEnum.getValue() == value) {
                return typeEnum;
            }
        }
        return UNKNOWN;
    }

}
