package com.fs.provider.enums;

/**
 * 结算状态
 */
public enum SettlementStatusEnum {

    UNSETTLED(0L, "未结算"),
    SETTLED(1L, "已结算");

    private final Long code;
    private final String desc;

    SettlementStatusEnum(Long code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Long getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static SettlementStatusEnum fromCode(Long code) {
        for (SettlementStatusEnum e : values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        throw new IllegalArgumentException("未知结算状态：" + code);
    }
}
