correcciones
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
import { Expose, Type } from 'class-transformer';
|
||||
import { EquipoMinOutputDto } from '../../../equipo/dto/output/equipo-min.dto';
|
||||
|
||||
export class EntregaOutputDto {
|
||||
@Expose()
|
||||
message;
|
||||
|
||||
@Expose()
|
||||
@Type(() => EquipoMinOutputDto)
|
||||
equipo;
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import { Usuario } from '../../../usuario/entity/usuario.entity';
|
||||
.addSelect('p.id_operador_regreso', 'id_operador_regreso')
|
||||
.addSelect('e.equipo', 'equipo')
|
||||
.addSelect('e.id_carrito', 'id_carrito')
|
||||
.addSelect('e.id_status', 'id_status')
|
||||
.addSelect('e.numero_inventario', 'numero_inventario')
|
||||
.addSelect('oe.operador', 'operador_entrega')
|
||||
.addSelect('or.operador', 'operador_regreso')
|
||||
@@ -112,6 +113,9 @@ export class FullInformacionPrestamoView {
|
||||
@ViewColumn()
|
||||
id_operador_regreso: number;
|
||||
|
||||
@ViewColumn()
|
||||
id_status: number;
|
||||
|
||||
@ViewColumn()
|
||||
id_tipo_carrito: number;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import { EntregarDto } from './dto/input/entregar.dto';
|
||||
import { RegresarIdPrestamoDto } from './dto/input/regresar-id-prestamo.dto';
|
||||
import { RegresarNumeroInventarioDto } from './dto/input/regresar-numero-inventario.dto';
|
||||
import { ActivosOutputDto } from './dto/output/activos.dto';
|
||||
import { EntregaOutputDto } from './dto/output/entrega.dto';
|
||||
import { EquipoMinOutputDto } from '../equipo/dto/output/equipo-min.dto';
|
||||
import { PrestamoOutputDto } from './dto/output/prestamo.dto';
|
||||
import { PrestamoEquipoOutputDto } from './dto/output/prestamo-equipo.dto';
|
||||
import { PrestamosOutputDto } from './dto/output/prestamos.dto';
|
||||
@@ -158,7 +158,7 @@ export class PrestamoController {
|
||||
return this.prestamoService.cancelarUsuario(body.id_prestamo);
|
||||
}
|
||||
|
||||
@Serealize(EntregaOutputDto)
|
||||
@Serealize(EquipoMinOutputDto)
|
||||
@Put('entregar')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiOperation({
|
||||
|
||||
@@ -120,7 +120,7 @@ export class PrestamoService {
|
||||
id_programa?: number,
|
||||
id_tipo_entrada?: number,
|
||||
) {
|
||||
const ahora = moment();
|
||||
const ahora = moment().add(12, 'hour');
|
||||
const ahoraStr = ahora.format('YYYY-MM-DD');
|
||||
const sistema = { id_operador: 1 };
|
||||
const modulo = await this.moduloService.findById(id_modulo);
|
||||
@@ -273,7 +273,7 @@ export class PrestamoService {
|
||||
}
|
||||
|
||||
async entregar(operadorEntrega: Operador, id_prestamo: number) {
|
||||
const ahora = moment();
|
||||
const ahora = moment().add(12, 'hour');
|
||||
const ahoraStr = ahora.format('YYYY-MM-DD');
|
||||
const prestamo = await this.findInfoPrestamoById(id_prestamo);
|
||||
const institucionDia =
|
||||
@@ -562,6 +562,7 @@ export class PrestamoService {
|
||||
tipo_carrito: infoPrestamos[0][i].tipo_carrito,
|
||||
},
|
||||
},
|
||||
status: { id_status: infoPrestamos[0][i].id_status },
|
||||
},
|
||||
usuario: {
|
||||
id_usuario: infoPrestamos[0][i].id_usuario,
|
||||
@@ -775,7 +776,7 @@ export class PrestamoService {
|
||||
descripcion?: string,
|
||||
id_institucion_infraccion?: number,
|
||||
) {
|
||||
const ahora = moment();
|
||||
const ahora = moment().add(12, 'hour');
|
||||
const tardanza = Math.trunc(ahora.diff(moment(prestamo.hora_fin)) / 60000);
|
||||
const semanasCastigo = Math.trunc(
|
||||
tardanza / operadorRegreso.institucion.tiempo_entrega,
|
||||
|
||||
Reference in New Issue
Block a user