listo institucion tipo carrito
This commit is contained in:
@@ -10,6 +10,7 @@ import { HoraExcepcionModule } from './hora-excepcion/hora-excepcion.module';
|
||||
import { InstitucionModule } from './institucion/institucion.module';
|
||||
import { InstitucionDiaModule } from './institucion-dia/institucion-dia.module';
|
||||
import { InstitucionInfraccionModule } from './institucion-infraccion/institucion-infraccion.module';
|
||||
import { InstitucionTipoCarritoModule } from './institucion-tipo-carrito/institucion-tipo-carrito.module';
|
||||
import { ModuloModule } from './modulo/modulo.module';
|
||||
import { MotivoModule } from './motivo/motivo.module';
|
||||
import { MultaModule } from './multa/multa.module';
|
||||
@@ -35,6 +36,7 @@ import { Infraccion } from './institucion-infraccion/entity/infraccion.entity';
|
||||
import { Institucion } from './institucion/entity/institucion.entity';
|
||||
import { InstitucionDia } from './institucion-dia/entity/institucion-dia.entity';
|
||||
import { InstitucionInfraccion } from './institucion-infraccion/entity/institucion-infraccion.entity';
|
||||
import { InstitucionTipoCarrito } from './institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
||||
import { Modulo } from './modulo/entity/modulo.entity';
|
||||
import { Motivo } from './motivo/entity/motivo.entity';
|
||||
import { Multa } from './multa/entity/multa.entity';
|
||||
@@ -72,6 +74,7 @@ import { Usuario } from './usuario/entity/usuario.entity';
|
||||
Institucion,
|
||||
InstitucionDia,
|
||||
InstitucionInfraccion,
|
||||
InstitucionTipoCarrito,
|
||||
Modulo,
|
||||
Motivo,
|
||||
Multa,
|
||||
@@ -106,6 +109,7 @@ import { Usuario } from './usuario/entity/usuario.entity';
|
||||
TipoEntradaModule,
|
||||
TipoUsuarioModule,
|
||||
UsuarioModule,
|
||||
InstitucionTipoCarritoModule,
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { Institucion } from '../../institucion/entity/institucion.entity';
|
||||
import { TipoCarrito } from '../../tipo-carrito/entity/tipo-carrito.entity';
|
||||
|
||||
@Entity()
|
||||
export class InstitucionTipoCarrito {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_institucion_tipo_carrito: number;
|
||||
|
||||
@Column({ type: Boolean, nullable: false, default: false })
|
||||
mostrar: boolean;
|
||||
|
||||
@ManyToOne(
|
||||
() => Institucion,
|
||||
(institucion) => institucion.institucionTiposCarritos,
|
||||
)
|
||||
@JoinColumn({ name: 'id_institucion' })
|
||||
institucion: Institucion;
|
||||
|
||||
@ManyToOne(
|
||||
() => TipoCarrito,
|
||||
(tipoCarrito) => tipoCarrito.institucionesTipoCarrito,
|
||||
)
|
||||
@JoinColumn({ name: 'id_tipo_carrito' })
|
||||
tipoCarrito: TipoCarrito;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { InstitucionTipoCarritoController } from './institucion-tipo-carrito.controller';
|
||||
|
||||
describe('InstitucionTipoCarritoController', () => {
|
||||
let controller: InstitucionTipoCarritoController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [InstitucionTipoCarritoController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<InstitucionTipoCarritoController>(InstitucionTipoCarritoController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Controller, Get, Put } from '@nestjs/common';
|
||||
import { InstitucionTipoCarritoService } from './institucion-tipo-carrito.service';
|
||||
|
||||
@Controller('institucion-tipo-carrito')
|
||||
export class InstitucionTipoCarritoController {
|
||||
constructor(
|
||||
private institucionTipoCarritoService: InstitucionTipoCarritoService,
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
get() {}
|
||||
|
||||
@Put()
|
||||
update() {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { InstitucionTipoCarritoController } from './institucion-tipo-carrito.controller';
|
||||
import { InstitucionTipoCarritoService } from './institucion-tipo-carrito.service';
|
||||
import { InstitucionTipoCarrito } from './entity/institucion-tipo-carrito.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([InstitucionTipoCarrito])],
|
||||
controllers: [InstitucionTipoCarritoController],
|
||||
providers: [InstitucionTipoCarritoService],
|
||||
})
|
||||
export class InstitucionTipoCarritoModule {}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { InstitucionTipoCarritoService } from './institucion-tipo-carrito.service';
|
||||
|
||||
describe('InstitucionTipoCarritoService', () => {
|
||||
let service: InstitucionTipoCarritoService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [InstitucionTipoCarritoService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<InstitucionTipoCarritoService>(InstitucionTipoCarritoService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class InstitucionTipoCarritoService {}
|
||||
@@ -2,6 +2,7 @@ import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Carrera } from '../../carrera/entity/carrera.entity';
|
||||
import { InstitucionDia } from '../../institucion-dia/entity/institucion-dia.entity';
|
||||
import { InstitucionInfraccion } from '../../institucion-infraccion/entity/institucion-infraccion.entity';
|
||||
import { InstitucionTipoCarrito } from '../../institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
||||
import { Modulo } from '../../modulo/entity/modulo.entity';
|
||||
import { Operador } from '../../operador/entity/operador.entity';
|
||||
import { Usuario } from '../../usuario/entity/usuario.entity';
|
||||
@@ -44,6 +45,12 @@ export class Institucion {
|
||||
)
|
||||
institucionInfracciones: InstitucionInfraccion[];
|
||||
|
||||
@OneToMany(
|
||||
() => InstitucionTipoCarrito,
|
||||
(institucionTipoCarrito) => institucionTipoCarrito.institucion,
|
||||
)
|
||||
institucionTiposCarritos: InstitucionTipoCarrito[];
|
||||
|
||||
@OneToMany(() => Modulo, (modulo) => modulo.institucion)
|
||||
modulos: Modulo[];
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Carrito } from '../../carrito/entity/carrito.entity';
|
||||
import { InstitucionTipoCarrito } from '../../institucion-tipo-carrito/entity/institucion-tipo-carrito.entity';
|
||||
|
||||
@Entity()
|
||||
export class TipoCarrito {
|
||||
@@ -14,4 +15,7 @@ export class TipoCarrito {
|
||||
|
||||
@OneToMany(() => Carrito, (carrito) => carrito.tipoCarrito)
|
||||
carritos: Carrito[];
|
||||
|
||||
@OneToMany(() => InstitucionTipoCarrito, (institucionTipoCarrito) => institucionTipoCarrito.tipoCarrito)
|
||||
institucionesTipoCarrito: InstitucionTipoCarrito[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user