package cn.iocoder.yudao.module.member.enums;

import cn.iocoder.yudao.module.member.dal.dataobject.order.DishOrderDO;
import cn.iocoder.yudao.module.member.dal.dataobject.orderspacecapsule.OrderSpaceCapsuleDO;
import cn.iocoder.yudao.module.member.dal.dataobject.storeorder.StoreOrderDO;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.poi.ss.formula.functions.T;

@AllArgsConstructor
@Getter
public enum BillingEnum {
    //0食堂发票,1超市发票,2太空舱;
    BILLING_CANTEEN(0,"食堂"),
    BILLING_SUPERMARKET(1,"超市"),
    BILLING_SPACE_CAPSULE(2,"太空舱"),
    BILLING_SPACE_DANWEI(3,"单位");
    /**
     * 编码
     */
    private final Integer code;
    /**
     * 类型
     */
    private final String name;
    // 根据 code 查找对应的枚举实例
    public static BillingEnum fromCode(int code) {
        for (BillingEnum type : BillingEnum.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid code for BillingEnum: " + code);
    }

}
