package com.wzj.soopin.transaction.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 分账规则的商户类型
 */
@Getter
@AllArgsConstructor
public enum DivideRuleDetailType {


    /**
     * 商家
     */
    SELLER(1, "商家"),
    /**
     * 平台
     */
    PLATFORM(2, "平台"),
    /**
     * 代理
     */
    PROXY(3, "代理"),
    /**
     * 达人
     */
    REFERENCE(4, "达人"),;

    private final int value;

    private final String desc;

    public static DivideRuleDetailType getEnum(int value) {
        for (DivideRuleDetailType type : DivideRuleDetailType.values()) {
            if (type.getValue() == value) {
                return type;
            }
        }
        return null;
    }
}
