package com.sonic.lion.domain.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;


/**
 * @author: code
 * @date: 2025/05/14
 * @Description:
 * @version: 1.0.0
 */
public enum InOrOut {

    IN(1, "收入"),

    OUT(2, "支出"),
    ;
    private final int value;

    private final String desc;

    InOrOut(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static InOrOut get(int value) {
        for (InOrOut inOrOut : values()) {
            if (inOrOut.getValue() == value) {
                return inOrOut;
            }
        }
        return null;
    }

    public String getDescInEnglish() {
        if (value == 1) {
            return "Income";
        }
        return "Outcome";
    }

}
