feat: add time_group_ids filter to item management and DTO
parent
36b6ee733f
commit
d95f8fd6e5
|
@ -106,6 +106,15 @@ export class IndexItemManager extends BaseIndexManager<ItemEntity> {
|
||||||
queryBuilder.andWhere(`${this.tableName}.tenant_id Is Null`);
|
queryBuilder.andWhere(`${this.tableName}.tenant_id Is Null`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.filterParam.time_group_ids?.length) {
|
||||||
|
queryBuilder.andWhere(
|
||||||
|
`${this.tableName}.time_group_id In (:...timeGroupIds)`,
|
||||||
|
{
|
||||||
|
timeGroupIds: this.filterParam.time_group_ids,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.filterParam.show_to_booking) {
|
if (this.filterParam.show_to_booking) {
|
||||||
queryBuilder.andWhere(`${this.tableName}.show_to_booking = true`);
|
queryBuilder.andWhere(`${this.tableName}.show_to_booking = true`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,12 @@ export class FilterItemDto extends BaseFilterDto implements FilterItemEntity {
|
||||||
})
|
})
|
||||||
season_period_ids: string[];
|
season_period_ids: string[];
|
||||||
|
|
||||||
|
@ApiProperty({ type: ['string'], required: false })
|
||||||
|
@Transform((body) => {
|
||||||
|
return Array.isArray(body.value) ? body.value : [body.value];
|
||||||
|
})
|
||||||
|
time_group_ids: string[];
|
||||||
|
|
||||||
@ApiProperty({ type: ['string'], required: false })
|
@ApiProperty({ type: ['string'], required: false })
|
||||||
@Transform((body) => {
|
@Transform((body) => {
|
||||||
return Array.isArray(body.value) ? body.value : [body.value];
|
return Array.isArray(body.value) ? body.value : [body.value];
|
||||||
|
|
Loading…
Reference in New Issue