S4
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IsBoolean, IsInt, IsNotEmpty, IsNumber, IsString, IsOptional, Length,} from "class-validator";
|
||||
import { IsBoolean, IsInt, IsNotEmpty, IsNumber, IsString, IsOptional, Length} from "class-validator";
|
||||
|
||||
export class profesorDto{
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import { DatosAcademicos } from '../../datos_academicos/entities/datos_academico
|
||||
import { LineasInvestigacion } from '../../lineas_investigacion/entities/lineas_investigacion.entity';
|
||||
import { ProyectosAcademicos } from '../../proyectos_academicos/entities/proyectos_academicos.entity';
|
||||
import { AsignaturaCarreraProfesor } from '../../asignatura_carrera_profesor/entities/asignatura_carrera_profesor.entity';
|
||||
import { User } from 'src/users/entities/user.entity';
|
||||
|
||||
@Entity()
|
||||
export class Profesor {
|
||||
@@ -84,39 +85,28 @@ export class Profesor {
|
||||
})
|
||||
fecha_actualizacion: Date;
|
||||
|
||||
@ManyToOne(() => Edificio, (edificio) => edificio.profesores)
|
||||
@ManyToOne(() => Edificio, edificio => edificio.profesores)
|
||||
@JoinColumn({ name: 'id_edificio' })
|
||||
edificio: Edificio;
|
||||
|
||||
@ManyToOne(() => Adscripcion, (adscripcion) => adscripcion.profesores)
|
||||
@ManyToOne(() => Adscripcion, adscripcion => adscripcion.profesores)
|
||||
@JoinColumn({ name: 'id_adscripcion' })
|
||||
adscripcion: Adscripcion;
|
||||
|
||||
@ManyToOne(() => Categoria, (categoria) => categoria.profesores)
|
||||
@ManyToOne(() => Categoria, categoria => categoria.profesores)
|
||||
@JoinColumn({ name: 'id_categoria' })
|
||||
categoria: Categoria;
|
||||
|
||||
@OneToMany(
|
||||
() => DatosAcademicos,
|
||||
(datosAcademicos) => datosAcademicos.profesor,
|
||||
)
|
||||
@ManyToOne(() => User, user => user.profesores)
|
||||
@JoinColumn({ name: 'id_usuario' })
|
||||
user: User;
|
||||
|
||||
@OneToMany(() => DatosAcademicos, datosAcademicos => datosAcademicos.profesor)
|
||||
datosAcademicos: DatosAcademicos[];
|
||||
|
||||
@OneToMany(
|
||||
() => LineasInvestigacion,
|
||||
(lineasInvestigacion) => lineasInvestigacion.profesor,
|
||||
)
|
||||
@OneToMany(() => LineasInvestigacion, lineasInvestigacion => lineasInvestigacion.profesor)
|
||||
lineasInvestigacion: LineasInvestigacion[];
|
||||
|
||||
@OneToMany(
|
||||
() => ProyectosAcademicos,
|
||||
(proyectosAcademicos) => proyectosAcademicos.profesor,
|
||||
)
|
||||
@OneToMany(() => ProyectosAcademicos, proyectosAcademicos => proyectosAcademicos.profesor)
|
||||
proyectosAcademicos: ProyectosAcademicos[];
|
||||
|
||||
@OneToMany(
|
||||
() => AsignaturaCarreraProfesor,
|
||||
(acp) => acp.profesor,
|
||||
)
|
||||
asignaturaCarreraProfesores: AsignaturaCarreraProfesor[];
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ export class Asignatura {
|
||||
@Column({ type: 'varchar', length: 50, nullable: false })
|
||||
materia: string;
|
||||
|
||||
@OneToMany(() => AsignaturaCarreraProfesor, (acp) => acp.asignatura)
|
||||
@OneToMany(() => AsignaturaCarreraProfesor, acp => acp.asignatura)
|
||||
asignaturaCarreraProfesores: AsignaturaCarreraProfesor[];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
||||
import { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn, OneToMany } from 'typeorm';
|
||||
import { TipoUsuario } from "../../tipo_usuario/entities/tipo_usuario.entity";
|
||||
import { Profesor } from 'src/Profesor/entities/profesor.entity';
|
||||
|
||||
@Entity({ name: 'usuario' })
|
||||
export class User {
|
||||
@@ -31,4 +32,7 @@ export class User {
|
||||
@ManyToOne(() => TipoUsuario, tipoUsuario => tipoUsuario.users)
|
||||
@JoinColumn({ name: 'id_tipo_usuario' })
|
||||
tipoUsuario: TipoUsuario;
|
||||
|
||||
@OneToMany(() => Profesor, profesor => profesor.user)
|
||||
profesores: Profesor[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user