package com.sunxung.factoring.component.enums;

/**
 * @Description : 融资申请状态枚举项
 * @Author : L.Jia
 * @Date: 2023-12-27 11:31
 */
public enum FinancingStatusEnum {

    /**
     * 处理中
     */
    FINANCING_PROCESSING("financing_processing", "处理中"),

    /**
     * 已完成
     */
    FINANCING_COMPLETED("financing_completed", "已完成"),

    /**
     * 放款执行中
     */
    FINANCING_PAYMENT_EXECUTING("financing_payment_executing", "放款执行中"),

    /**
     * 还款中
     */
    FINANCING_REPAYMENT_EXECUTING("financing_repayment_executing", "还款中"),

    /**
     * 已逾期
     */
    FINANCING_OVERDUE("financing_overdue", "已逾期"),

    /**
     * 已终止
     */
    FINANCING_TERMINATED("financing_terminated", "已终止");

    String code;

    String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

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


    public static FinancingStatusEnum getByCode(String code) {
        for (FinancingStatusEnum ft : values()) {
            if (ft.code.equals(code)) {
                return ft;
            }
        }
        return null;
    }
}
