Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Forked from cezarpretto/Endereco.js
Created January 31, 2017 16:50
Show Gist options
  • Select an option

  • Save wilcorrea/fbb148b2074f6a0492f1a12bb3dc1fa5 to your computer and use it in GitHub Desktop.

Select an option

Save wilcorrea/fbb148b2074f6a0492f1a12bb3dc1fa5 to your computer and use it in GitHub Desktop.
import Model from './Model';
import Genero from './Genero'
import Escolaridade from './Escolaridade';
import { required } from 'vuelidate/lib/validators';
import { validarCpf } from '../services/Utils';
class Candidato extends Model {
constructor() {
super();
this.cpf = undefined;
this.nome = undefined;
this.dtCadastro = new Date();
this.dtNascimento = undefined;
this.genero = new Genero();
this.fone = undefined;
this.escolaridade = new Escolaridade();
this.estudante = false;
this.turno = undefined;
this.cnh = false;
this.cnhCategoria = undefined;
this.veiculo = false;
this.veiculoTipo = undefined;
this.informatica = false;
this.cursos = [];
}
}
const CandidatoValidation = {
cpf: {
required,
cpfValido(value) {
return validarCpf(value)
}
},
nome: {
required
},
dtCadastro: {
required
},
dtNascimento: {
required
},
genero: {
id: {
required(value) {
return value === 0 ? false : true;
}
}
},
fone: {
required
},
escolaridade: {
id: {
required(value) {
return value === 0 ? false : true;
}
}
},
}
export { Candidato, CandidatoValidation }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment