add payment
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-19 10:18:33 +03:30
parent 17223ced06
commit d1f85d78f4
4 changed files with 80 additions and 0 deletions
@@ -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')