order report by food
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user