package com.crm.rely.backend.core.enums;

/**
 * 常用的状态管理
 *
 * @author y
 * @create 2022/1/21
 */
public enum SalesSalaryRecordType {


    SALARY(1, "SALARY"),
    MANUAL(2, "MANUAL"),
    WITHDRAWAL(3, "WITHDRAWAL"),
    ACTIVITY(4, "ACTIVITY");


    private final Integer code;
    private final String desc;

    SalesSalaryRecordType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static SalesSalaryRecordType matchCode(Integer code) {
        for (SalesSalaryRecordType type : SalesSalaryRecordType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }


}
