From 72ef8b1f3b0b39bd35e9cb4a9a68d77163e750c1 Mon Sep 17 00:00:00 2001 From: xXpuma99Xx <51341582+xXpuma99Xx@users.noreply.github.com> Date: Sun, 17 Apr 2022 22:01:41 -0500 Subject: [PATCH] listo motivo --- src/app.module.ts | 2 +- src/equipo/entity/equipo.entity.ts | 2 +- src/modulo/modulo.controller.ts | 2 +- src/motivo/{ => entity}/motivo.entity.ts | 20 ++++++++++---------- src/motivo/motivo.controller.ts | 8 +++++++- src/motivo/motivo.module.ts | 2 +- src/motivo/motivo.service.ts | 4 ++-- src/operador/operador.entity.ts | 2 +- src/status/status.entity.ts | 2 +- 9 files changed, 25 insertions(+), 19 deletions(-) rename src/motivo/{ => entity}/motivo.entity.ts (64%) diff --git a/src/app.module.ts b/src/app.module.ts index 518fbec..583a612 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -39,7 +39,7 @@ 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 { Modulo } from './modulo/entity/modulo.entity'; -import { Motivo } from './motivo/motivo.entity'; +import { Motivo } from './motivo/entity/motivo.entity'; import { Multa } from './multa/multa.entity'; import { Operador } from './operador/operador.entity'; import { Prestamo } from './prestamo/prestamo.entity'; diff --git a/src/equipo/entity/equipo.entity.ts b/src/equipo/entity/equipo.entity.ts index 3beeea3..e94a0f2 100644 --- a/src/equipo/entity/equipo.entity.ts +++ b/src/equipo/entity/equipo.entity.ts @@ -8,7 +8,7 @@ import { } from 'typeorm'; import { Carrito } from '../../carrito/entity/carrito.entity'; import { EquipoTipoEntrada } from '../../equipo-tipo-entrada/entity/equipo-tipo-entrada.entity'; -import { Motivo } from '../../motivo/motivo.entity'; +import { Motivo } from '../../motivo/entity/motivo.entity'; import { Prestamo } from '../../prestamo/prestamo.entity'; import { Programa } from '../../programa/programa.entity'; import { Status } from '../../status/status.entity'; diff --git a/src/modulo/modulo.controller.ts b/src/modulo/modulo.controller.ts index f2e0227..fbba4a0 100644 --- a/src/modulo/modulo.controller.ts +++ b/src/modulo/modulo.controller.ts @@ -1,9 +1,9 @@ import { Body, Controller, Get, Post, Put, Query } from '@nestjs/common'; import { ModuloService } from './modulo.service'; -// import { Serealize } from '../interceptors/serialize.interceptor'; import { IdInstitucionDto } from '../dto/id-institucion.dto'; import { ModuloCrearDto } from './dto/modulo-crear.dto'; import { ModuloUpdateDto } from './dto/modulo-update.dto'; +// import { Serealize } from '../interceptors/serialize.interceptor'; @Controller('modulo') export class ModuloController { constructor(private moduloService: ModuloService) {} diff --git a/src/motivo/motivo.entity.ts b/src/motivo/entity/motivo.entity.ts similarity index 64% rename from src/motivo/motivo.entity.ts rename to src/motivo/entity/motivo.entity.ts index 1393dd1..511e756 100644 --- a/src/motivo/motivo.entity.ts +++ b/src/motivo/entity/motivo.entity.ts @@ -1,24 +1,24 @@ import { - Entity, Column, - PrimaryGeneratedColumn, - ManyToOne, + Entity, JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; -import { Equipo } from '../equipo/entity/equipo.entity'; -import { Operador } from '../operador/operador.entity'; -import { Status } from '../status/status.entity'; +import { Equipo } from '../../equipo/entity/equipo.entity'; +import { Operador } from '../../operador/operador.entity'; +import { Status } from '../../status/status.entity'; @Entity() export class Motivo { @PrimaryGeneratedColumn() id_motivo: number; - @Column() - motivo: string; + @Column({ type: Date, nullable: false }) + fecha_creacion: Date; - @Column() - created_at: Date; + @Column({ type: String, nullable: false, length: 250 }) + motivo: string; @ManyToOne(() => Equipo, (equipo) => equipo.motivos) @JoinColumn({ name: 'id_equipo' }) diff --git a/src/motivo/motivo.controller.ts b/src/motivo/motivo.controller.ts index 13e3198..47b7da7 100644 --- a/src/motivo/motivo.controller.ts +++ b/src/motivo/motivo.controller.ts @@ -1,7 +1,13 @@ -import { Controller } from '@nestjs/common'; +import { Controller, Get } from '@nestjs/common'; import { MotivoService } from './motivo.service'; @Controller('motivo') export class MotivoController { constructor(private motivoService: MotivoService) {} + + @Get() + get() {} + + @Get('reporte') + reporte() {} } diff --git a/src/motivo/motivo.module.ts b/src/motivo/motivo.module.ts index 4d212e8..534dceb 100644 --- a/src/motivo/motivo.module.ts +++ b/src/motivo/motivo.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { MotivoController } from './motivo.controller'; -import { Motivo } from './motivo.entity'; import { MotivoService } from './motivo.service'; +import { Motivo } from './entity/motivo.entity'; @Module({ imports: [TypeOrmModule.forFeature([Motivo])], diff --git a/src/motivo/motivo.service.ts b/src/motivo/motivo.service.ts index ca6e231..818e7f1 100644 --- a/src/motivo/motivo.service.ts +++ b/src/motivo/motivo.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; -import { Motivo } from './motivo.entity'; +import { Repository } from 'typeorm'; +import { Motivo } from './entity/motivo.entity'; @Injectable() export class MotivoService { diff --git a/src/operador/operador.entity.ts b/src/operador/operador.entity.ts index 205d64e..8320844 100644 --- a/src/operador/operador.entity.ts +++ b/src/operador/operador.entity.ts @@ -7,7 +7,7 @@ import { JoinColumn, } from 'typeorm'; import { Institucion } from '../institucion/entity/institucion.entity'; -import { Motivo } from '../motivo/motivo.entity'; +import { Motivo } from '../motivo/entity/motivo.entity'; import { Prestamo } from '../prestamo/prestamo.entity'; import { TipoUsuario } from '../tipo-usuario/tipo-usuario.entity'; diff --git a/src/status/status.entity.ts b/src/status/status.entity.ts index beb8d62..211a2d0 100644 --- a/src/status/status.entity.ts +++ b/src/status/status.entity.ts @@ -1,6 +1,6 @@ import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm'; import { Equipo } from '../equipo/entity/equipo.entity'; -import { Motivo } from '../motivo/motivo.entity'; +import { Motivo } from '../motivo/entity/motivo.entity'; @Entity() export class Status {