package com.ruoyi.ss.changeBalance.domain.enums;

import lombok.Getter;

@Getter
public enum BusinessType {
    ORDER_INCOME("1", "订单收入："),
    REORDER_INCOME("2", "续单订单收入："),
    ORDER_REFUND("4", "订单退款："),
    WITHDRAW("5", "提现"),
    WITHDRAW_FAIL("6", "提现失败"),
    SMS_CHARGE("8", "短信扣费"),
    SYSTEM_MODIFY("9", "管理员加款");

    private final String code;
    private final String description;

    BusinessType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static BusinessType fromCode(String code) {
        for (BusinessType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null; // 或者抛出异常
    }
}
