public IActionResult PromoteStudents(PromotionRequest request) { if (!_dbService.CheckIfEnrollmentExists(request.Studies, request.Semester)) { return(NotFound("Enrollment not found.")); } try { return(Ok(_dbService.PromoteStudents(request.Studies, request.Semester))); } catch (DbServiceException e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.ToString())); } }