scheduale

This commit is contained in:
2025-12-08 15:42:40 +03:30
parent 6bda9bb31f
commit 2525b5b11a
2 changed files with 18 additions and 4 deletions
@@ -65,6 +65,20 @@ export class ScheduleService {
return this.scheduleRepository.findOne(where);
}
async findScheduleBySlug(slug: string): Promise<Schedule[]> {
const restaurant = await this.em.findOne(Restaurant, { slug });
if (!restaurant) {
throw new NotFoundException(RestMessage.NOT_FOUND);
}
const where: FilterQuery<Schedule> = {
restId: restaurant.id.toString(),
isActive: true,
};
return this.scheduleRepository.find(where);
}
async findOne(id: string, restId: string): Promise<Schedule> {
const schedule = await this.scheduleRepository.findOne({ id, restId });
if (!schedule) {