56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { Carrera } from '../../carrera/entity/carrera.entity';
|
|
import { InstitucionDia } from '../../institucion-dia/institucion-dia.entity';
|
|
import { InstitucionInfraccion } from '../../institucion-infraccion/institucion-infraccion.entity';
|
|
import { Modulo } from '../../modulo/entity/modulo.entity';
|
|
import { Operador } from '../../operador/operador.entity';
|
|
import { Usuario } from '../../usuario/usuario.entity';
|
|
|
|
@Entity()
|
|
export class Institucion {
|
|
@PrimaryGeneratedColumn()
|
|
id_institucion: number;
|
|
|
|
@Column({ type: Number, nullable: false, default: 7 })
|
|
dias_multa_retraso: number;
|
|
|
|
@Column({ type: String, nullable: false })
|
|
institucion: string;
|
|
|
|
@Column({ type: String, nullable: false, length: 50 })
|
|
logo: string;
|
|
|
|
@Column({ type: Number, nullable: false, default: 15 })
|
|
tiempo_entrega: number;
|
|
|
|
@Column({ type: Number, nullable: false, default: 120 })
|
|
tiempo_prestamo: number;
|
|
|
|
@Column({ type: Number, nullable: false, default: 10 })
|
|
tiempo_recoger: number;
|
|
|
|
@OneToMany(() => Carrera, (carrera) => carrera.institucion)
|
|
carreras: Carrera[];
|
|
|
|
@OneToMany(
|
|
() => InstitucionDia,
|
|
(institucionDia) => institucionDia.institucion,
|
|
)
|
|
institucionDias: InstitucionDia[];
|
|
|
|
@OneToMany(
|
|
() => InstitucionInfraccion,
|
|
(institucionInfraccion) => institucionInfraccion.institucion,
|
|
)
|
|
institucionInfracciones: InstitucionInfraccion[];
|
|
|
|
@OneToMany(() => Modulo, (modulo) => modulo.institucion)
|
|
modulos: Modulo[];
|
|
|
|
@OneToMany(() => Operador, (operador) => operador.institucion)
|
|
operadores: Operador[];
|
|
|
|
@OneToMany(() => Usuario, (usuario) => usuario.institucion)
|
|
usuarios: Usuario[];
|
|
}
|