feat: add time_group_ids filter to item management and DTO

pull/147/head
shancheas 2025-06-09 10:11:16 +07:00
parent 36b6ee733f
commit d95f8fd6e5
2 changed files with 15 additions and 0 deletions

View File

@ -106,6 +106,15 @@ export class IndexItemManager extends BaseIndexManager<ItemEntity> {
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) {
queryBuilder.andWhere(`${this.tableName}.show_to_booking = true`);
}

View File

@ -16,6 +16,12 @@ export class FilterItemDto extends BaseFilterDto implements FilterItemEntity {
})
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 })
@Transform((body) => {
return Array.isArray(body.value) ? body.value : [body.value];