order report by food

This commit is contained in:
2026-06-18 21:52:16 +03:30
parent f96b9ca017
commit f62f7cd2a7
3 changed files with 96 additions and 0 deletions
@@ -12,6 +12,7 @@ import { UpdateOrderStatusDto } from '../dto/update-order-status.dto';
import { Permissions } from 'src/common/decorators/permissions.decorator';
import { Permission } from 'src/common/enums/permission.enum';
import { AdminCreateOrderDto } from '../dto/admin-create-order.dto';
import { FoodOrderReportDto } from '../dto/food-order-report.dto';
@ApiTags('orders')
@ApiBearerAuth()
@@ -127,4 +128,12 @@ export class OrdersController {
getFoodSalesPieChart(@RestId() restId: string) {
return this.ordersService.getFoodSalesPieChart(restId);
}
@UseGuards(AdminAuthGuard)
@Permissions(Permission.VIEW_REPORTS)
@ApiOperation({ summary: 'Get order report grouped by food' })
@Get('admin/orders/report/by-food')
getFoodOrderReport(@RestId() restId: string, @Query() dto: FoodOrderReportDto) {
return this.ordersService.getFoodOrderReport(restId, dto);
}
}