nuevas tablas
This commit is contained in:
parent
f69e8425a1
commit
eee7092c9e
@ -15,7 +15,9 @@ import { InstitucionModule } from './institucion/institucion.module';
|
|||||||
import { InstitucionCarreraModule } from './institucion-carrera/institucion-carrera.module';
|
import { InstitucionCarreraModule } from './institucion-carrera/institucion-carrera.module';
|
||||||
import { InstitucionDiaModule } from './institucion-dia/institucion-dia.module';
|
import { InstitucionDiaModule } from './institucion-dia/institucion-dia.module';
|
||||||
import { InstitucionInfraccionModule } from './institucion-infraccion/institucion-infraccion.module';
|
import { InstitucionInfraccionModule } from './institucion-infraccion/institucion-infraccion.module';
|
||||||
|
import { InstitucionProgramaModule } from './institucion-programa/institucion-programa.module';
|
||||||
import { InstitucionTipoCarritoModule } from './institucion-tipo-carrito/institucion-tipo-carrito.module';
|
import { InstitucionTipoCarritoModule } from './institucion-tipo-carrito/institucion-tipo-carrito.module';
|
||||||
|
import { InstitucionTipoEntradaModule } from './institucion-tipo-entrada/institucion-tipo-entrada.module';
|
||||||
import { ModuloModule } from './modulo/modulo.module';
|
import { ModuloModule } from './modulo/modulo.module';
|
||||||
import { MotivoModule } from './motivo/motivo.module';
|
import { MotivoModule } from './motivo/motivo.module';
|
||||||
import { MultaModule } from './multa/multa.module';
|
import { MultaModule } from './multa/multa.module';
|
||||||
@ -41,7 +43,9 @@ import { Institucion } from './institucion/entity/institucion.entity';
|
|||||||
import { InstitucionCarrera } from './institucion-carrera/entity/institucion-carrera.entity';
|
import { InstitucionCarrera } from './institucion-carrera/entity/institucion-carrera.entity';
|
||||||
import { InstitucionDia } from './institucion-dia/entity/institucion-dia.entity';
|
import { InstitucionDia } from './institucion-dia/entity/institucion-dia.entity';
|
||||||
import { InstitucionInfraccion } from './institucion-infraccion/entity/institucion-infraccion.entity';
|
import { InstitucionInfraccion } from './institucion-infraccion/entity/institucion-infraccion.entity';
|
||||||
|
import { InstitucionPrograma } from './institucion-programa/entity/institucion-programa.entity';
|
||||||
import { InstitucionTipoCarrito } from './institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
import { InstitucionTipoCarrito } from './institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
||||||
|
import { InstitucionTipoEntrada } from './institucion-tipo-entrada/entity/institucion-tipo-entrada.entity';
|
||||||
import { Modulo } from './modulo/entity/modulo.entity';
|
import { Modulo } from './modulo/entity/modulo.entity';
|
||||||
import { Motivo } from './motivo/entity/motivo.entity';
|
import { Motivo } from './motivo/entity/motivo.entity';
|
||||||
import { Multa } from './multa/entity/multa.entity';
|
import { Multa } from './multa/entity/multa.entity';
|
||||||
@ -83,7 +87,9 @@ import { SoapClientModule } from './soap-client/soap-client.module';
|
|||||||
InstitucionCarrera,
|
InstitucionCarrera,
|
||||||
InstitucionDia,
|
InstitucionDia,
|
||||||
InstitucionInfraccion,
|
InstitucionInfraccion,
|
||||||
|
InstitucionPrograma,
|
||||||
InstitucionTipoCarrito,
|
InstitucionTipoCarrito,
|
||||||
|
InstitucionTipoEntrada,
|
||||||
Modulo,
|
Modulo,
|
||||||
Motivo,
|
Motivo,
|
||||||
Multa,
|
Multa,
|
||||||
@ -112,7 +118,9 @@ import { SoapClientModule } from './soap-client/soap-client.module';
|
|||||||
InstitucionCarreraModule,
|
InstitucionCarreraModule,
|
||||||
InstitucionDiaModule,
|
InstitucionDiaModule,
|
||||||
InstitucionInfraccionModule,
|
InstitucionInfraccionModule,
|
||||||
|
InstitucionProgramaModule,
|
||||||
InstitucionTipoCarritoModule,
|
InstitucionTipoCarritoModule,
|
||||||
|
InstitucionTipoEntradaModule,
|
||||||
ModuloModule,
|
ModuloModule,
|
||||||
MotivoModule,
|
MotivoModule,
|
||||||
MultaModule,
|
MultaModule,
|
||||||
|
@ -28,7 +28,7 @@ export class InstitucionDia {
|
|||||||
@JoinColumn({ name: 'id_dia' })
|
@JoinColumn({ name: 'id_dia' })
|
||||||
dia: Dia;
|
dia: Dia;
|
||||||
|
|
||||||
@ManyToOne(() => Institucion, (institucion) => institucion.institucionDias)
|
@ManyToOne(() => Institucion, (institucion) => institucion.dias)
|
||||||
@JoinColumn({ name: 'id_institucion' })
|
@JoinColumn({ name: 'id_institucion' })
|
||||||
institucion: Institucion;
|
institucion: Institucion;
|
||||||
|
|
||||||
|
@ -26,10 +26,7 @@ export class InstitucionInfraccion {
|
|||||||
@JoinColumn({ name: 'id_infraccion' })
|
@JoinColumn({ name: 'id_infraccion' })
|
||||||
infraccion: Infraccion;
|
infraccion: Infraccion;
|
||||||
|
|
||||||
@ManyToOne(
|
@ManyToOne(() => Institucion, (institucion) => institucion.infracciones)
|
||||||
() => Institucion,
|
|
||||||
(institucion) => institucion.institucionInfracciones,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id_institucion' })
|
@JoinColumn({ name: 'id_institucion' })
|
||||||
institucion: Institucion;
|
institucion: Institucion;
|
||||||
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
import {
|
||||||
|
Column,
|
||||||
|
Entity,
|
||||||
|
JoinColumn,
|
||||||
|
ManyToOne,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
} from 'typeorm';
|
||||||
|
import { Institucion } from '../../institucion/entity/institucion.entity';
|
||||||
|
import { Programa } from '../../programa/entity/programa.entity';
|
||||||
|
|
||||||
|
@Entity()
|
||||||
|
export class InstitucionPrograma {
|
||||||
|
@PrimaryGeneratedColumn()
|
||||||
|
id_institucion_carrera: number;
|
||||||
|
|
||||||
|
@Column({ type: Boolean, nullable: false, default: false })
|
||||||
|
mostrar: boolean;
|
||||||
|
|
||||||
|
@ManyToOne(() => Programa, (programa) => programa.instituciones)
|
||||||
|
@JoinColumn({ name: 'id_programa' })
|
||||||
|
programa: Programa;
|
||||||
|
|
||||||
|
@ManyToOne(() => Institucion, (institucion) => institucion.programas)
|
||||||
|
@JoinColumn({ name: 'id_institucion' })
|
||||||
|
institucion: Institucion;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { InstitucionProgramaController } from './institucion-programa.controller';
|
||||||
|
|
||||||
|
describe('InstitucionProgramaController', () => {
|
||||||
|
let controller: InstitucionProgramaController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
controllers: [InstitucionProgramaController],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
controller = module.get<InstitucionProgramaController>(InstitucionProgramaController);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(controller).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,4 @@
|
|||||||
|
import { Controller } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Controller('institucion-programa')
|
||||||
|
export class InstitucionProgramaController {}
|
12
src/institucion-programa/institucion-programa.module.ts
Normal file
12
src/institucion-programa/institucion-programa.module.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { InstitucionProgramaController } from './institucion-programa.controller';
|
||||||
|
import { InstitucionProgramaService } from './institucion-programa.service';
|
||||||
|
import { InstitucionPrograma } from './entity/institucion-programa.entity';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [TypeOrmModule.forFeature([InstitucionPrograma])],
|
||||||
|
controllers: [InstitucionProgramaController],
|
||||||
|
providers: [InstitucionProgramaService],
|
||||||
|
})
|
||||||
|
export class InstitucionProgramaModule {}
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { InstitucionProgramaService } from './institucion-programa.service';
|
||||||
|
|
||||||
|
describe('InstitucionProgramaService', () => {
|
||||||
|
let service: InstitucionProgramaService;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
providers: [InstitucionProgramaService],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
service = module.get<InstitucionProgramaService>(InstitucionProgramaService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(service).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
12
src/institucion-programa/institucion-programa.service.ts
Normal file
12
src/institucion-programa/institucion-programa.service.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
import { Repository } from 'typeorm';
|
||||||
|
import { InstitucionPrograma } from './entity/institucion-programa.entity';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class InstitucionProgramaService {
|
||||||
|
constructor(
|
||||||
|
@InjectRepository(InstitucionPrograma)
|
||||||
|
private repository: Repository<InstitucionPrograma>,
|
||||||
|
) {}
|
||||||
|
}
|
@ -16,10 +16,7 @@ export class InstitucionTipoCarrito {
|
|||||||
@Column({ type: Boolean, nullable: false, default: false })
|
@Column({ type: Boolean, nullable: false, default: false })
|
||||||
mostrar: boolean;
|
mostrar: boolean;
|
||||||
|
|
||||||
@ManyToOne(
|
@ManyToOne(() => Institucion, (institucion) => institucion.tiposCarrito)
|
||||||
() => Institucion,
|
|
||||||
(institucion) => institucion.institucionTiposCarritos,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id_institucion' })
|
@JoinColumn({ name: 'id_institucion' })
|
||||||
institucion: Institucion;
|
institucion: Institucion;
|
||||||
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
import {
|
||||||
|
Column,
|
||||||
|
Entity,
|
||||||
|
JoinColumn,
|
||||||
|
ManyToOne,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
} from 'typeorm';
|
||||||
|
import { Institucion } from '../../institucion/entity/institucion.entity';
|
||||||
|
import { TipoEntrada } from '../../tipo-entrada/entity/tipo-entrada.entity';
|
||||||
|
|
||||||
|
@Entity()
|
||||||
|
export class InstitucionTipoEntrada {
|
||||||
|
@PrimaryGeneratedColumn()
|
||||||
|
id_institucion_carrera: number;
|
||||||
|
|
||||||
|
@Column({ type: Boolean, nullable: false, default: false })
|
||||||
|
mostrar: boolean;
|
||||||
|
|
||||||
|
@ManyToOne(() => TipoEntrada, (tipoEntrada) => tipoEntrada.instituciones)
|
||||||
|
@JoinColumn({ name: 'id_tipo_entrada' })
|
||||||
|
tipoEntrada: TipoEntrada;
|
||||||
|
|
||||||
|
@ManyToOne(() => Institucion, (institucion) => institucion.tiposEntrada)
|
||||||
|
@JoinColumn({ name: 'id_institucion' })
|
||||||
|
institucion: Institucion;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { InstitucionTipoEntradaController } from './institucion-tipo-entrada.controller';
|
||||||
|
|
||||||
|
describe('InstitucionTipoEntradaController', () => {
|
||||||
|
let controller: InstitucionTipoEntradaController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
controllers: [InstitucionTipoEntradaController],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
controller = module.get<InstitucionTipoEntradaController>(InstitucionTipoEntradaController);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(controller).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,4 @@
|
|||||||
|
import { Controller } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Controller('institucion-tipo-entrada')
|
||||||
|
export class InstitucionTipoEntradaController {}
|
@ -0,0 +1,12 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { InstitucionTipoEntradaController } from './institucion-tipo-entrada.controller';
|
||||||
|
import { InstitucionTipoEntradaService } from './institucion-tipo-entrada.service';
|
||||||
|
import { InstitucionTipoEntrada } from './entity/institucion-tipo-entrada.entity';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [TypeOrmModule.forFeature([InstitucionTipoEntrada])],
|
||||||
|
controllers: [InstitucionTipoEntradaController],
|
||||||
|
providers: [InstitucionTipoEntradaService],
|
||||||
|
})
|
||||||
|
export class InstitucionTipoEntradaModule {}
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { InstitucionTipoEntradaService } from './institucion-tipo-entrada.service';
|
||||||
|
|
||||||
|
describe('InstitucionTipoEntradaService', () => {
|
||||||
|
let service: InstitucionTipoEntradaService;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
providers: [InstitucionTipoEntradaService],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
service = module.get<InstitucionTipoEntradaService>(InstitucionTipoEntradaService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(service).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,12 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
import { Repository } from 'typeorm';
|
||||||
|
import { InstitucionTipoEntrada } from './entity/institucion-tipo-entrada.entity';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class InstitucionTipoEntradaService {
|
||||||
|
constructor(
|
||||||
|
@InjectRepository(InstitucionTipoEntrada)
|
||||||
|
private repository: Repository<InstitucionTipoEntrada>,
|
||||||
|
) {}
|
||||||
|
}
|
@ -2,7 +2,9 @@ import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
|||||||
import { InstitucionCarrera } from '../../institucion-carrera/entity/institucion-carrera.entity';
|
import { InstitucionCarrera } from '../../institucion-carrera/entity/institucion-carrera.entity';
|
||||||
import { InstitucionDia } from '../../institucion-dia/entity/institucion-dia.entity';
|
import { InstitucionDia } from '../../institucion-dia/entity/institucion-dia.entity';
|
||||||
import { InstitucionInfraccion } from '../../institucion-infraccion/entity/institucion-infraccion.entity';
|
import { InstitucionInfraccion } from '../../institucion-infraccion/entity/institucion-infraccion.entity';
|
||||||
|
import { InstitucionPrograma } from '../../institucion-programa/entity/institucion-programa.entity';
|
||||||
import { InstitucionTipoCarrito } from '../../institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
import { InstitucionTipoCarrito } from '../../institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
||||||
|
import { InstitucionTipoEntrada } from '../../institucion-tipo-entrada/entity/institucion-tipo-entrada.entity';
|
||||||
import { Modulo } from '../../modulo/entity/modulo.entity';
|
import { Modulo } from '../../modulo/entity/modulo.entity';
|
||||||
import { Operador } from '../../operador/entity/operador.entity';
|
import { Operador } from '../../operador/entity/operador.entity';
|
||||||
import { Usuario } from '../../usuario/entity/usuario.entity';
|
import { Usuario } from '../../usuario/entity/usuario.entity';
|
||||||
@ -12,7 +14,7 @@ export class Institucion {
|
|||||||
@PrimaryGeneratedColumn()
|
@PrimaryGeneratedColumn()
|
||||||
id_institucion: number;
|
id_institucion: number;
|
||||||
|
|
||||||
@Column({ type: Boolean, nullable: true, default:false })
|
@Column({ type: Boolean, nullable: true, default: false })
|
||||||
activo: boolean;
|
activo: boolean;
|
||||||
|
|
||||||
@Column({ type: String, nullable: true, length: 4 })
|
@Column({ type: String, nullable: true, length: 4 })
|
||||||
@ -52,19 +54,31 @@ export class Institucion {
|
|||||||
() => InstitucionDia,
|
() => InstitucionDia,
|
||||||
(institucionDia) => institucionDia.institucion,
|
(institucionDia) => institucionDia.institucion,
|
||||||
)
|
)
|
||||||
institucionDias: InstitucionDia[];
|
dias: InstitucionDia[];
|
||||||
|
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
() => InstitucionInfraccion,
|
() => InstitucionInfraccion,
|
||||||
(institucionInfraccion) => institucionInfraccion.institucion,
|
(institucionInfraccion) => institucionInfraccion.institucion,
|
||||||
)
|
)
|
||||||
institucionInfracciones: InstitucionInfraccion[];
|
infracciones: InstitucionInfraccion[];
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => InstitucionPrograma,
|
||||||
|
(institucionPrograma) => institucionPrograma.institucion,
|
||||||
|
)
|
||||||
|
programas: InstitucionPrograma[];
|
||||||
|
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
() => InstitucionTipoCarrito,
|
() => InstitucionTipoCarrito,
|
||||||
(institucionTipoCarrito) => institucionTipoCarrito.institucion,
|
(institucionTipoCarrito) => institucionTipoCarrito.institucion,
|
||||||
)
|
)
|
||||||
institucionTiposCarritos: InstitucionTipoCarrito[];
|
tiposCarrito: InstitucionTipoCarrito[];
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => InstitucionTipoEntrada,
|
||||||
|
(institucionTipoEntrada) => institucionTipoEntrada.institucion,
|
||||||
|
)
|
||||||
|
tiposEntrada: InstitucionTipoEntrada[];
|
||||||
|
|
||||||
@OneToMany(() => Modulo, (modulo) => modulo.institucion)
|
@OneToMany(() => Modulo, (modulo) => modulo.institucion)
|
||||||
modulos: Modulo[];
|
modulos: Modulo[];
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
import { CarreraPrograma } from '../../carrera-programa/entity/carrera-programa.entity';
|
import { CarreraPrograma } from '../../carrera-programa/entity/carrera-programa.entity';
|
||||||
import { Equipo } from '../../equipo/entity/equipo.entity';
|
import { Equipo } from '../../equipo/entity/equipo.entity';
|
||||||
|
import { InstitucionPrograma } from '../../institucion-programa/entity/institucion-programa.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class Programa {
|
export class Programa {
|
||||||
@ -18,4 +19,10 @@ export class Programa {
|
|||||||
|
|
||||||
@OneToMany(() => Equipo, (equipo) => equipo.programa)
|
@OneToMany(() => Equipo, (equipo) => equipo.programa)
|
||||||
equipos: Equipo[];
|
equipos: Equipo[];
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => InstitucionPrograma,
|
||||||
|
(institucionPrograma) => institucionPrograma.programa,
|
||||||
|
)
|
||||||
|
instituciones: InstitucionPrograma[];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
import { EquipoTipoEntrada } from '../../equipo/entity/equipo-tipo-entrada.entity';
|
import { EquipoTipoEntrada } from '../../equipo/entity/equipo-tipo-entrada.entity';
|
||||||
|
import { InstitucionTipoEntrada } from '../../institucion-tipo-entrada/entity/institucion-tipo-entrada.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class TipoEntrada {
|
export class TipoEntrada {
|
||||||
@ -14,4 +15,10 @@ export class TipoEntrada {
|
|||||||
(equipoTipoEntrada) => equipoTipoEntrada.tipoEntrada,
|
(equipoTipoEntrada) => equipoTipoEntrada.tipoEntrada,
|
||||||
)
|
)
|
||||||
equiposTipoEntrada: EquipoTipoEntrada[];
|
equiposTipoEntrada: EquipoTipoEntrada[];
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => InstitucionTipoEntrada,
|
||||||
|
(institucionTipoEntrada) => institucionTipoEntrada.tipoEntrada,
|
||||||
|
)
|
||||||
|
instituciones: InstitucionTipoEntrada[];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user