/**
* @internal
*/
public function __construct(protected RecalculationService
$recalculationService) { } #[Route(path: '/api/_action/order/{orderId}/recalculate', name: 'api.action.order.recalculate', methods: ['POST'])]
public function recalculateOrder(string
$orderId, Context
$context): Response
{ $this->recalculationService->
recalculateOrder($orderId,
$context);
return new Response(null, Response::HTTP_NO_CONTENT
);
} #[Route(path: '/api/_action/order/{orderId}/product/{productId}', name: 'api.action.order.add-product', methods: ['POST'])]
public function addProductToOrder(string
$orderId, string
$productId, Request
$request, Context
$context): Response
{ $quantity =
$request->request->
getInt('quantity', 1
);
$this->recalculationService->
addProductToOrder($orderId,
$productId,
$quantity,
$context);
return new Response(null, Response::HTTP_NO_CONTENT
);
}