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
);
} #[Route(path: '/api/_action/order/{orderId}/creditItem', name: 'api.action.order.add-credit-item', methods: ['POST'])]
public function addCreditItemToOrder(string
$orderId, Request
$request, Context
$context): Response
{ $identifier =
(string) $request->request->
get('identifier'
);
$type = LineItem::CREDIT_LINE_ITEM_TYPE;
$quantity =
$request->request->
getInt('quantity', 1
);