listo
This commit is contained in:
parent
a4d80e3c31
commit
0960a4c37a
@ -6,7 +6,13 @@ import {
|
|||||||
Injectable,
|
Injectable,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
import { FindManyOptions, FindOptionsWhere, Repository } from 'typeorm';
|
import {
|
||||||
|
Between,
|
||||||
|
FindManyOptions,
|
||||||
|
FindOptionsWhere,
|
||||||
|
MoreThanOrEqual,
|
||||||
|
Repository,
|
||||||
|
} from 'typeorm';
|
||||||
import { Carrito } from '../carrito/entity/carrito.entity';
|
import { Carrito } from '../carrito/entity/carrito.entity';
|
||||||
import { CarritoMotivo } from './entity/carrito-motivo.entity';
|
import { CarritoMotivo } from './entity/carrito-motivo.entity';
|
||||||
import { Operador } from '../operador/entity/operador.entity';
|
import { Operador } from '../operador/entity/operador.entity';
|
||||||
@ -79,6 +85,8 @@ export class CarritoMotivoService {
|
|||||||
admin: Operador,
|
admin: Operador,
|
||||||
filtros: {
|
filtros: {
|
||||||
carrito?: string;
|
carrito?: string;
|
||||||
|
fechaFin?: string;
|
||||||
|
fechaInicio?: string;
|
||||||
id_institucion?: string;
|
id_institucion?: string;
|
||||||
id_marca?: string;
|
id_marca?: string;
|
||||||
id_modelo?: string;
|
id_modelo?: string;
|
||||||
@ -109,6 +117,17 @@ export class CarritoMotivoService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (filtros.carrito) busquedaCarrito.carrito = filtros.carrito;
|
if (filtros.carrito) busquedaCarrito.carrito = filtros.carrito;
|
||||||
|
if (filtros.fechaInicio) {
|
||||||
|
if (filtros.fechaFin)
|
||||||
|
busqueda.fecha_creacion = Between(
|
||||||
|
new Date(`${filtros.fechaInicio} 00:00`),
|
||||||
|
new Date(`${filtros.fechaFin} 23:59`),
|
||||||
|
);
|
||||||
|
else
|
||||||
|
busqueda.fecha_creacion = MoreThanOrEqual(
|
||||||
|
new Date(`${filtros.fechaInicio} 00:00`),
|
||||||
|
);
|
||||||
|
}
|
||||||
if (admin.institucion)
|
if (admin.institucion)
|
||||||
busquedaCarrito.modulo = { institucion: admin.institucion };
|
busquedaCarrito.modulo = { institucion: admin.institucion };
|
||||||
else if (institucion) busquedaCarrito.modulo = { institucion };
|
else if (institucion) busquedaCarrito.modulo = { institucion };
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
IsDateString,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsNumberString,
|
IsNumberString,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
@ -11,6 +12,14 @@ export class LaboratorioMovilDto {
|
|||||||
@IsOptional()
|
@IsOptional()
|
||||||
carrito?: string;
|
carrito?: string;
|
||||||
|
|
||||||
|
@IsDateString()
|
||||||
|
@IsOptional()
|
||||||
|
fechaFin?: string;
|
||||||
|
|
||||||
|
@IsDateString()
|
||||||
|
@IsOptional()
|
||||||
|
fechaInicio?: string;
|
||||||
|
|
||||||
@IsNumberString()
|
@IsNumberString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
id_institucion?: string;
|
id_institucion?: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user