package com.sckw.core.model.enums;

/**
 * desc 合理损耗单位
 * author zk
 * date 2023/9/4 0004
 */
public enum TaxRateTypeEnum {

    //‰
    PERCENT(0, "‰", 1000),
    //%
    MILLIMETER(1, "%", 100);

    private final Integer code;

    private final String name;

    private final Integer value;

    TaxRateTypeEnum(Integer code, String name, Integer value){
        this.code = code;
        this.name = name;
        this.value = value;
    }

    public static TaxRateTypeEnum getName(Integer code){
        for (TaxRateTypeEnum typeEnum : values()) {
            if (typeEnum.getCode().equals(code)) {
                return typeEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public Integer getValue() {
        return value;
    }
}
