clientKeyProvider->fromRequest($request); $snapshot = $this->snapshotService->buildSnapshot($limit, $clientKey); return new JsonResponse($snapshot); } #[Route(path: '', name: 'api_signals_store', methods: ['POST'])] public function store(Request $request, #[MapRequestPayload] SignalPayload $payload): JsonResponse { $clientKey = $this->clientKeyProvider->fromRequest($request); $signal = $this->submissionService->submit($clientKey, $payload); $signalLocation = $signal->getSignalLocation(); $userLocation = $signal->getUserLocation(); return new JsonResponse([ 'status' => 'stored', 'clientKey' => $clientKey, 'point' => [ 'id' => $signal->getId(), 'signalLocation' => [ 'lat' => $signalLocation->getLat(), 'lng' => $signalLocation->getLng(), ], 'userLocation' => [ 'lat' => $userLocation->getLat(), 'lng' => $userLocation->getLng(), ], 'createdAt' => $signal->getCreatedAt()->format(DATE_ATOM), 'userKey' => $signal->getUserKey(), ], ], Response::HTTP_CREATED); } }