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

import com.ruoyi.common.exception.ServiceException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 辉
 * 2024/3/6
 */
@AllArgsConstructor
@Getter
public enum TransactionBillType {

    RECHARGE("1", "充值"),
    WITHDRAW("2", "提现");

    private final String type;
    private final String description;

    public static TransactionBillType parse(String type) {
        for (TransactionBillType value : TransactionBillType.values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        throw new ServiceException("非法的记录类型");
    }

}
