find($request->get("user")); $yearPeriod = $yearPeriodRetriever->selected(); $limit = $vacationStatsRetriever->getVacationDaysLimit($user, $yearPeriod); $used = $vacationStatsRetriever->getUsedVacationDays($user, $yearPeriod); $pending = $vacationStatsRetriever->getPendingVacationDays($user, $yearPeriod); $other = $vacationStatsRetriever->getOtherApprovedVacationDays($user, $yearPeriod); return new JsonResponse([ "limit" => $limit, "remaining" => $limit - $used - $pending, "used" => $used, "pending" => $pending, "other" => $other, ]); } }