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); $remaining = $limit - $used - $pending; return new JsonResponse([ "limit" => $limit, "remaining" => $remaining, "used" => $used, "pending" => $pending, "other" => $other, ]); } }