Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into lucas
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas0headshot committed May 22, 2024
2 parents 8c73180 + c8d5b0f commit b2b7241
Show file tree
Hide file tree
Showing 28 changed files with 579 additions and 251 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.senac.gestaocurso.enterprise;

public class ValidationException extends RuntimeException {
public ValidationException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.senac.gestaocurso.models;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;


Expand All @@ -18,15 +19,22 @@ public class Certificacoes extends EntityID {
@Column(nullable = false)
private LocalDate dataEmissao;

@ManyToOne(cascade = CascadeType.ALL)
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "funcionario_id")
@JsonIgnore
private Funcionario funcionario;



public Certificacoes() {
}

public Certificacoes(String nome, Integer cargaHoraria, LocalDate dataEmissao, Funcionario funcionario) {
this.nome = nome;
this.cargaHoraria = cargaHoraria;
this.dataEmissao = dataEmissao;
this.funcionario = funcionario;
}

public Funcionario getFuncionario() {
return funcionario;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@



import com.fasterxml.jackson.annotation.JsonIgnore;
import com.senac.gestaocurso.enums.TipoContaBancaria;
import jakarta.persistence.*;

Expand All @@ -20,15 +21,23 @@ public class DadosBancarios extends EntityID {
@Enumerated(EnumType.STRING)
private TipoContaBancaria tipoContaBancaria;

@ManyToOne(cascade = CascadeType.ALL)
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "funcionario_id")
@JsonIgnore
private Funcionario funcionario;



public DadosBancarios() {
}

public DadosBancarios(String banco, String agencia, String conta, TipoContaBancaria tipoContaBancaria, Funcionario funcionario) {
this.banco = banco;
this.agencia = agencia;
this.conta = conta;
this.tipoContaBancaria = tipoContaBancaria;
this.funcionario = funcionario;
}

public Funcionario getFuncionario() {
return funcionario;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@



import com.fasterxml.jackson.annotation.JsonIgnore;
import com.senac.gestaocurso.enums.Escolaridade;
import jakarta.persistence.*;

Expand All @@ -11,25 +12,31 @@

@Entity
public class Dependentes extends EntityID {
@Column(nullable = false)
@Column
private String nome;

@Enumerated(EnumType.STRING)
private Escolaridade escolaridade;

@Column(nullable = false)
@Column
private LocalDate dataNasc;

@ManyToOne

@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "funcionario_id")
@JsonIgnore
private Funcionario funcionario;



public Dependentes() {
}


public Dependentes(String nome, Escolaridade escolaridade, LocalDate dataNasc, Funcionario funcionario) {
this.nome = nome;
this.escolaridade = escolaridade;
this.dataNasc = dataNasc;
this.funcionario = funcionario;
}

public String getNome() {
return nome;
Expand Down
29 changes: 17 additions & 12 deletions backend/src/main/java/com/senac/gestaocurso/models/ExpAnterior.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@



import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;

import java.time.LocalDate;

Expand All @@ -24,18 +22,25 @@ public class ExpAnterior extends EntityID {
private LocalDate periodoFinal;

@Column(nullable = false)
private LocalDate peridoInicial;
private LocalDate periodoInicial;

@ManyToOne
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "funcionario_id")
@JsonIgnore
private Funcionario funcionario;



public ExpAnterior() {
}


public ExpAnterior(String descricao, Cargo cargo, LocalDate periodoFinal, LocalDate peridoInicial, Funcionario funcionario) {
this.descricao = descricao;
this.cargo = cargo;
this.periodoFinal = periodoFinal;
this.periodoInicial = peridoInicial;
this.funcionario = funcionario;
}

public Funcionario getFuncionario() {
return funcionario;
Expand Down Expand Up @@ -69,12 +74,12 @@ public void setPeriodoFinal(LocalDate periodoFinal) {
this.periodoFinal = periodoFinal;
}

public LocalDate getPeridoInicial() {
return peridoInicial;
public LocalDate getPeriodoInicial() {
return periodoInicial;
}

public void setPeridoInicial(LocalDate peridoInicial) {
this.peridoInicial = peridoInicial;
public void setPeriodoInicial(LocalDate peridoInicial) {
this.periodoInicial = peridoInicial;
}


Expand All @@ -85,7 +90,7 @@ public String toString() {
"descricao='" + descricao + '\'' +
", cargo=" + cargo +
", periodoFinal=" + periodoFinal +
", peridoInicial=" + peridoInicial +
", peridoInicial=" + periodoInicial +
'}';
}
}
Loading

0 comments on commit b2b7241

Please sign in to comment.