This commit is contained in:
@@ -18,6 +18,7 @@ import { AdminUpdateOrderItemDto } from '../dto/admin-update-order-item.dto';
|
||||
import { FoodOrderReportDto } from '../dto/food-order-report.dto';
|
||||
import { DailyOrderReportDto } from '../dto/daily-order-report.dto';
|
||||
import { AdminRefundOrderDto } from '../dto/admin-refund-order.dto';
|
||||
import { AdminAddPaymentDto } from '../dto/admin-add-payment.dto';
|
||||
|
||||
@ApiTags('orders')
|
||||
@ApiBearerAuth()
|
||||
@@ -155,6 +156,20 @@ export class OrdersController {
|
||||
return this.ordersService.removeOrderItem(orderId, restId, itemId);
|
||||
}
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@Permissions(Permission.MANAGE_ORDERS)
|
||||
@Post('admin/orders/:orderId/payments')
|
||||
@ApiOperation({ summary: 'Add a cash payment to an existing order' })
|
||||
@ApiParam({ name: 'orderId', description: 'Order ID' })
|
||||
@ApiBody({ type: AdminAddPaymentDto })
|
||||
addPayment(
|
||||
@Param('orderId') orderId: string,
|
||||
@Body() dto: AdminAddPaymentDto,
|
||||
@RestId() restId: string,
|
||||
) {
|
||||
return this.ordersService.addPayment(orderId, restId, dto);
|
||||
}
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@Permissions(Permission.MANAGE_ORDERS)
|
||||
@Post('admin/orders/:orderId/refund')
|
||||
|
||||
Reference in New Issue
Block a user