package com.inkasso.factoring.common.enums;

/**
 * @Description 采购合同状态枚举类
 * @Author Yafan Wang
 * @Date 2023/12/2 10:36
 */
public enum PurchContractManagementStatusEnum {

    /**
     * 已创建
     */
    CREATE("purch_contract_create", "已创建"),
    /**
     * 已录入
     */
    INPUT("purch_contract_input", "已录入"),
    /**
     * 已审核
     */
    FIRST_APPROVAL("purch_contract_first_approval", "已审核"),
    /**
     * 已驳回
     **/
    OVERRULE("purch_contract_overrule", "已驳回"),
    /**
     * 已签署
     */
    SIGN("purch_contract_sign", "已签署"),
    /**
     * 签署已审核
     **/
    CONFIRM("purch_contract_confirm", "签署已审核"),

    /**
     * 已录入(变更)
     **/
    INPUT_CHANGE("purch_contract_input_change", "已录入(变更)"),

    /**
     * 已审核(变更)
     **/
    APPROVAL_CHANGE("purch_contract_first_approval_change", "已审核(变更)"),
    /**
     * 已驳回
     **/
    OVERRULE_CHANGE("purch_contract_overrule_change", "已驳回(变更)"),
    /**
     * 已签署
     */
    SIGN_CHANGE("purch_contract_sign_change", "已签署(变更)"),
    /**
     * 签署已审核
     **/
    CONFIRM_CHANGE("purch_contract_confirm_change", "签署已审核(变更)"),

    /** 已终止 **/
    TERMINATED("purch_contract_terminated", "已终止");

    /** 编码 ***/
    private String code;
    /** 名称 **/
    private String cname;


    public String getCode() {
        return code;
    }

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

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    PurchContractManagementStatusEnum(String code, String cname){
        this.code = code;
        this.cname = cname;
    }

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

}
