return new JsonResponse($this->codeService->
generateIndividualCodes($codePattern,
$amount));
} #[Route(path: '/api/_action/promotion/codes/replace-individual', name: 'api.action.promotion.codes.replace-individual', methods: ['PATCH'], defaults: ['_acl' => ['promotion.editor']])]
public function replaceIndividualCodes(Request
$request, Context
$context): Response
{ $promotionId =
(string) $request->request->
get('promotionId'
);
$codePattern =
(string) $request->request->
get('codePattern'
);
$amount =
$request->request->
getInt('amount'
);
$this->codeService->
replaceIndividualCodes($promotionId,
$codePattern,
$amount,
$context);
return new JsonResponse(null, Response::HTTP_NO_CONTENT
);
} #[Route(path: '/api/_action/promotion/codes/add-individual', name: 'api.action.promotion.codes.add-individual', methods: ['POST'], defaults: ['_acl' => ['promotion.editor']])]
public function addIndividualCodes(Request
$request, Context
$context): Response
{ $promotionId =
(string) $request->request->
get('promotionId'
);
$amount =
$request->request->
getInt('amount'
);
$this->codeService->
addIndividualCodes($promotionId,
$amount,
$context);