Merge pull request 'feat: add filter data scheduling date' (#178) from fix/log-scheduling into development
Reviewed-on: #178pull/142/head 1.7.2-alpha.5
commit
b57f0052bd
|
@ -74,10 +74,25 @@ export class IndexDataSchedulingLogManager extends BaseIndexManager<DataScheduli
|
||||||
|
|
||||||
if (this.filterParam.schedule_date_to) {
|
if (this.filterParam.schedule_date_to) {
|
||||||
const dateTo = this.filterParam.schedule_date_to;
|
const dateTo = this.filterParam.schedule_date_to;
|
||||||
queryBuilder.andWhere('schedule_date_from <= :dateTo', {
|
queryBuilder.andWhere('schedule_date_to <= :dateTo', {
|
||||||
dateTo: dateTo,
|
dateTo: dateTo,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.filterParam.log_created_from) {
|
||||||
|
const dateFrom = this.filterParam.log_created_from;
|
||||||
|
queryBuilder.andWhere('log_created_from >= :dateFrom', {
|
||||||
|
dateFrom: dateFrom,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.filterParam.log_created_to) {
|
||||||
|
const dateTo = this.filterParam.log_created_to;
|
||||||
|
queryBuilder.andWhere('log_created_to <= :dateTo', {
|
||||||
|
dateTo: dateTo,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return queryBuilder;
|
return queryBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ export class IndexDataSchedulingManager extends BaseIndexManager<DataSchedulingE
|
||||||
|
|
||||||
if (this.filterParam.schedule_date_to) {
|
if (this.filterParam.schedule_date_to) {
|
||||||
const dateTo = this.filterParam.schedule_date_to;
|
const dateTo = this.filterParam.schedule_date_to;
|
||||||
queryBuilder.andWhere('schedule_date_from <= :dateTo', {
|
queryBuilder.andWhere('schedule_date_to <= :dateTo', {
|
||||||
dateTo: dateTo,
|
dateTo: dateTo,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
import { Controller, Get, Param, Query } from '@nestjs/common';
|
import { Controller, Get, Param, Query } from '@nestjs/common';
|
||||||
import { FilterDataSchedulingDto } from './dto/filter-data-scheduling.dto';
|
import {
|
||||||
|
FilterDataSchedulingDto,
|
||||||
|
FilterDataSchedulingLogDto,
|
||||||
|
} from './dto/filter-data-scheduling.dto';
|
||||||
import { Pagination } from 'src/core/response';
|
import { Pagination } from 'src/core/response';
|
||||||
import { PaginationResponse } from 'src/core/response/domain/ok-response.interface';
|
import { PaginationResponse } from 'src/core/response/domain/ok-response.interface';
|
||||||
import {
|
import {
|
||||||
|
@ -43,7 +46,7 @@ export class DataSchedulingLogReadController {
|
||||||
@Pagination()
|
@Pagination()
|
||||||
@ExcludePrivilege()
|
@ExcludePrivilege()
|
||||||
async index(
|
async index(
|
||||||
@Query() params: FilterDataSchedulingDto,
|
@Query() params: FilterDataSchedulingLogDto,
|
||||||
): Promise<PaginationResponse<DataSchedulingLogEntity>> {
|
): Promise<PaginationResponse<DataSchedulingLogEntity>> {
|
||||||
return await this.orchestrator.indexLog(params);
|
return await this.orchestrator.indexLog(params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,27 @@ export class FilterDataSchedulingDto
|
||||||
schedule_date_to: Date;
|
schedule_date_to: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class FilterDataSchedulingLogDto
|
||||||
|
extends BaseFilterDto
|
||||||
|
implements FilterDataSchedulingEntity
|
||||||
|
{
|
||||||
|
@ApiProperty({ type: 'string', required: false })
|
||||||
|
@ValidateIf((body) => body.schedule_date_from)
|
||||||
|
schedule_date_from: Date;
|
||||||
|
|
||||||
|
@ApiProperty({ type: 'string', required: false })
|
||||||
|
@ValidateIf((body) => body.schedule_date_to)
|
||||||
|
schedule_date_to: Date;
|
||||||
|
|
||||||
|
@ApiProperty({ type: Number, required: false })
|
||||||
|
@ValidateIf((body) => body.log_created_from)
|
||||||
|
log_created_from: number;
|
||||||
|
|
||||||
|
@ApiProperty({ type: Number, required: false })
|
||||||
|
@ValidateIf((body) => body.log_created_to)
|
||||||
|
log_created_to: number;
|
||||||
|
}
|
||||||
|
|
||||||
export class FilterActiveDataSchedulingDto {
|
export class FilterActiveDataSchedulingDto {
|
||||||
// @ApiProperty({ type: 'string', required: true })
|
// @ApiProperty({ type: 'string', required: true })
|
||||||
// @ValidateIf((body) => body.schedule_date_from)
|
// @ValidateIf((body) => body.schedule_date_from)
|
||||||
|
|
Loading…
Reference in New Issue