feat(SPG-719) Season Period - API Index - tambahkan filter berdasarkan season type
parent
0ac5754170
commit
d7c4b27749
|
@ -4,6 +4,8 @@ import { EnumDays } from '../../constants';
|
|||
export interface FilterSeasonPeriodEntity extends BaseFilterEntity {
|
||||
start_date: Date;
|
||||
end_date: Date;
|
||||
season_type_ids: string[];
|
||||
|
||||
holiday_names: string[];
|
||||
days: EnumDays[];
|
||||
}
|
||||
|
|
|
@ -74,6 +74,12 @@ export class IndexSeasonPeriodManager extends BaseIndexManager<SeasonPeriodEntit
|
|||
);
|
||||
}
|
||||
|
||||
if (this.filterParam.season_type_ids) {
|
||||
queryBuilder.andWhere(`user_privilege_id In (:...seasonIds)`, {
|
||||
seasonIds: this.filterParam.season_type_ids,
|
||||
});
|
||||
}
|
||||
|
||||
return queryBuilder;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,4 +25,10 @@ export class FilterSeasonPeriodDto
|
|||
return Array.isArray(body.value) ? body.value : [body.value];
|
||||
})
|
||||
days: EnumDays[];
|
||||
|
||||
@ApiProperty({ type: ['string'], required: false })
|
||||
@Transform((body) => {
|
||||
return Array.isArray(body.value) ? body.value : [body.value];
|
||||
})
|
||||
season_type_ids: string[];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue