File size: 2,854 Bytes
b9a69cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

from datetime import datetime
from sqlalchemy import DateTime, Sequence, LargeBinary, JSON, func
from sqlalchemy_serializer import SerializerMixin
from ..ext.database import db
from flask_login import UserMixin

class User(db.Model, UserMixin):
    __tablename__ = 'users'
    id = db.Column(db.Integer, primary_key=True, nullable=False )
    nome = db.Column(db.String(128), nullable=False)
    sobrenome = db.Column(db.String(128), nullable=False)
    email = db.Column(db.String(128), nullable=False)
    username = db.Column(db.String(128), nullable=False)
    password = db.Column(db.String(128), nullable=False)
    dt_criacao = db.Column(DateTime, default=datetime.now(), nullable=False)
    status = db.Column(db.String(128), nullable=False)
    user_type = db.Column(db.String(128), nullable=False)



class Vagas(db.Model, SerializerMixin):
    __tablename__ = 'vagas'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, nullable=False )
    cargo = db.Column(db.String(128), nullable=False)
    departamento = db.Column(db.String(128), nullable=False)
    local = db.Column(db.String(128), nullable=False)
    nivel = db.Column(db.String(128), nullable=False)
    escopo_vaga = db.Column(db.Text, nullable=False)
    requisitos = db.Column(db.Text, nullable=False)
    qualificacoes = db.Column(db.Text, nullable=False)
    info_adicionais = db.Column(db.Text, nullable=True)
    data_abertura = db.Column(db.Date, default=datetime.now(), nullable=False)
    data_fechamento = db.Column(db.Date, nullable=True)
    status = db.Column(db.String(128), default='ativo', nullable=False)


class Candidatos(db.Model, SerializerMixin):
    __tablename__ = 'candidatos'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, nullable=False )
    vaga_id = db.Column(db.Integer, db.ForeignKey('vagas.id'), nullable=False)
    vaga = db.relationship('Vagas', backref='candidatos')
    nome = db.Column(db.String(128), nullable=True)
    idade = db.Column(db.String(128), nullable=True)
    email = db.Column(db.String(128), nullable=True)
    telefone = db.Column(db.String(128), nullable=True)
    localizacao = db.Column(db.String(128), nullable=True)
    experiencia = db.Column(JSON, nullable=True)
    educacao = db.Column(JSON, nullable=True)
    habilidades = db.Column(JSON, nullable=True)
    curriculo_pdf = db.Column(LargeBinary(length=(2**32)-1), nullable=False)
    status = db.Column(db.String(128), default='Currículo enviado', nullable=False)
    data_cadastro = db.Column(DateTime, nullable=False, server_default=func.now())
    data_encerramento = db.Column(DateTime, nullable=True)
    motivo_encerramento = db.Column(db.Text, nullable=True)
    resumo_ia = db.Column(db.Text, nullable=True)
    avaliacao_ia = db.Column(db.Text, nullable=True)