/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.ctecinf.model;


import br.com.ctecinf.orm.Model;
import br.com.ctecinf.orm.Table;
import br.com.ctecinf.orm.Column;
import br.com.ctecinf.text.MaskFormatter;
import java.sql.Types;

/**
 *
 * @author Cássio Conceição
 * @since 21/08/2019 17:06:02
 * @version 201908
 * @see http://ctecinf.com.br/
 */
@Table("fornecedor")
public class Fornecedor extends Model {

    @Column(name = "cnpj", type = Types.VARCHAR, label = "CNPJ", mask = MaskFormatter.CNPJ, tableDisplay = true)
    private String cnpj;

    @Column(name = "razao_social", type = Types.VARCHAR, isNotNull = true, label = "Razão Social", tableDisplay = true)
    private String razaoSocial;

    @Column(name = "fone_1", type = Types.VARCHAR, label = "Fone 1", tableDisplay = true)
    private String fone1;

    @Column(name = "fone_2", type = Types.VARCHAR, label = "Fone 2", tableDisplay = true)
    private String fone2;

    @Column(name = "email", type = Types.VARCHAR, label = "Email", tableDisplay = true)
    private String email;

    @Column(name = "endereco", type = Types.VARCHAR, label = "Endereço")
    private String endereco;

    @Column(name = "complemento", type = Types.VARCHAR, label = "Complemento")
    private String complemento;

    @Column(name = "bairro", type = Types.VARCHAR, label = "Bairro")
    private String bairro;

    @Column(name = "cep", type = Types.VARCHAR, label = "Cep")
    private String cep;

    @Column(name = "municipio_id", type = Types.BIGINT, label = "Município", join = Municipio.class)
    private Municipio municipio;

    public String getCnpj() {
        return this.cnpj;
    }

    public void setCnpj(String cnpj) {
        this.cnpj = cnpj;
    }

    public String getRazaoSocial() {
        return this.razaoSocial;
    }

    public void setRazaoSocial(String razaoSocial) {
        this.razaoSocial = razaoSocial;
    }

    public String getFone1() {
        return this.fone1;
    }

    public void setFone1(String fone1) {
        this.fone1 = fone1;
    }

    public String getFone2() {
        return this.fone2;
    }

    public void setFone2(String fone2) {
        this.fone2 = fone2;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEndereco() {
        return this.endereco;
    }

    public void setEndereco(String endereco) {
        this.endereco = endereco;
    }

    public String getComplemento() {
        return this.complemento;
    }

    public void setComplemento(String complemento) {
        this.complemento = complemento;
    }

    public String getBairro() {
        return this.bairro;
    }

    public void setBairro(String bairro) {
        this.bairro = bairro;
    }

    public String getCep() {
        return this.cep;
    }

    public void setCep(String cep) {
        this.cep = cep;
    }

    public Municipio getMunicipio() {
        return municipio;
    }

    public void setMunicipio(Municipio municipio) {
        this.municipio = municipio;
    }

    @Override
    public String toString() {
        return razaoSocial == null ? "Fornecedor {" + (getId() == null ? "Não cadastrado" : "ID = " + getId()) + "}" : razaoSocial;
    }
}
