sin modulo equipo tipo entrada
This commit is contained in:
parent
dc3ff745f3
commit
f9c3984916
@ -22,7 +22,6 @@ import { TipoUsuarioModule } from './tipo-usuario/tipo-usuario.module';
|
||||
import { UsuarioModule } from './usuario/usuario.module';
|
||||
import { CarreraModule } from './carrera/carrera.module';
|
||||
import { TipoEntradaModule } from './tipo-entrada/tipo-entrada.module';
|
||||
import { EquipoTipoEntradaModule } from './equipo-tipo-entrada/equipo-tipo-entrada.module';
|
||||
import { CarreraProgramaModule } from './carrera-programa/carrera-programa.module';
|
||||
|
||||
import { Carrera } from './carrera/entity/carrera.entity';
|
||||
@ -30,7 +29,7 @@ import { CarreraPrograma } from './carrera-programa/entity/carrera-programa.enti
|
||||
import { Carrito } from './carrito/entity/carrito.entity';
|
||||
import { Dia } from './institucion-dia/entity/dia.entity';
|
||||
import { Equipo } from './equipo/entity/equipo.entity';
|
||||
import { EquipoTipoEntrada } from './equipo-tipo-entrada/entity/equipo-tipo-entrada.entity';
|
||||
import { EquipoTipoEntrada } from './equipo/entity/equipo-tipo-entrada.entity';
|
||||
import { HoraExcepcion } from './hora-excepcion/entity/hora-excepcion.entity';
|
||||
import { Infraccion } from './institucion-infraccion/entity/infraccion.entity';
|
||||
import { Institucion } from './institucion/entity/institucion.entity';
|
||||
@ -92,7 +91,6 @@ import { Usuario } from './usuario/entity/usuario.entity';
|
||||
CarreraProgramaModule,
|
||||
CarritoModule,
|
||||
EquipoModule,
|
||||
EquipoTipoEntradaModule,
|
||||
HoraExcepcionModule,
|
||||
InstitucionModule,
|
||||
InstitucionDiaModule,
|
||||
|
@ -1,8 +0,0 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { EquipoTipoEntrada } from './entity/equipo-tipo-entrada.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([EquipoTipoEntrada])],
|
||||
})
|
||||
export class EquipoTipoEntradaModule {}
|
@ -1,5 +1,5 @@
|
||||
import { Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Equipo } from '../../equipo/entity/equipo.entity';
|
||||
import { Equipo } from './equipo.entity';
|
||||
import { TipoEntrada } from '../../tipo-entrada/entity/tipo-entrada.entity';
|
||||
|
||||
@Entity()
|
@ -7,7 +7,7 @@ import {
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { Carrito } from '../../carrito/entity/carrito.entity';
|
||||
import { EquipoTipoEntrada } from '../../equipo-tipo-entrada/entity/equipo-tipo-entrada.entity';
|
||||
import { EquipoTipoEntrada } from './equipo-tipo-entrada.entity';
|
||||
import { Motivo } from '../../motivo/entity/motivo.entity';
|
||||
import { Prestamo } from '../../prestamo/entity/prestamo.entity';
|
||||
import { Programa } from '../../programa/entity/programa.entity';
|
||||
@ -18,39 +18,39 @@ export class Equipo {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_equipo: number;
|
||||
|
||||
@Column()
|
||||
@Column({ type: String, nullable: false, length: 2 })
|
||||
equipo: string;
|
||||
|
||||
@Column()
|
||||
@Column({ type: String, nullable: false, length: 25 })
|
||||
numero_inventario: string;
|
||||
|
||||
@Column()
|
||||
@Column({ type: String, nullable: false, length: 25 })
|
||||
numero_serie: string;
|
||||
|
||||
@Column()
|
||||
@Column({ type: Boolean, nullable: false, default: false })
|
||||
prestado: boolean;
|
||||
|
||||
@ManyToOne(() => Carrito, (carrito) => carrito.equipos)
|
||||
@JoinColumn({ name: 'id_carrito' })
|
||||
carrito: Carrito;
|
||||
|
||||
@ManyToOne(() => Status, (status) => status.equipos)
|
||||
@JoinColumn({ name: 'id_status' })
|
||||
status: Status;
|
||||
|
||||
@ManyToOne(() => Programa, (programa) => programa.equipos)
|
||||
@JoinColumn({ name: 'id_programa' })
|
||||
programa: Programa;
|
||||
|
||||
@OneToMany(() => Motivo, (motivo) => motivo.equipo)
|
||||
motivos: Motivo[];
|
||||
|
||||
@OneToMany(() => Prestamo, (prestamo) => prestamo.equipo)
|
||||
prestamos: Prestamo[];
|
||||
@ManyToOne(() => Status, (status) => status.equipos)
|
||||
@JoinColumn({ name: 'id_status' })
|
||||
status: Status;
|
||||
|
||||
@OneToMany(
|
||||
() => EquipoTipoEntrada,
|
||||
(equipoTipoEntrada) => equipoTipoEntrada.tipoEntrada,
|
||||
)
|
||||
equipoTipoEntradas: EquipoTipoEntrada[];
|
||||
|
||||
@OneToMany(() => Motivo, (motivo) => motivo.equipo)
|
||||
motivos: Motivo[];
|
||||
|
||||
@OneToMany(() => Prestamo, (prestamo) => prestamo.equipo)
|
||||
prestamos: Prestamo[];
|
||||
}
|
||||
|
@ -3,9 +3,10 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { EquipoController } from './equipo.controller';
|
||||
import { EquipoService } from './equipo.service';
|
||||
import { Equipo } from './entity/equipo.entity';
|
||||
import { EquipoTipoEntrada } from './entity/equipo-tipo-entrada.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Equipo])],
|
||||
imports: [TypeOrmModule.forFeature([Equipo, EquipoTipoEntrada])],
|
||||
controllers: [EquipoController],
|
||||
providers: [EquipoService],
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { EquipoTipoEntrada } from '../../equipo-tipo-entrada/entity/equipo-tipo-entrada.entity';
|
||||
import { EquipoTipoEntrada } from '../../equipo/entity/equipo-tipo-entrada.entity';
|
||||
|
||||
@Entity()
|
||||
export class TipoEntrada {
|
||||
|
Loading…
Reference in New Issue
Block a user