Skip to content

Commit

Permalink
Exception handling of the enrolment list API (#134)
Browse files Browse the repository at this point in the history
* Added two parameters in course enrolment email notification

* Added two parameters in course enrolment email notification

* Added two parameters in course enrolment email notification

* Added two parameters in course enrolment email notification

* Exception handling of the enrolment list API
  • Loading branch information
vikrantbipin authored Feb 13, 2024
1 parent 10db13d commit e695428
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,30 +447,31 @@ class CourseEnrolmentActor @Inject()(@Named("course-batch-notification-actor") c
}
val allEnrolledCourses = new java.util.ArrayList[java.util.Map[String, AnyRef]]
val version = request.getContext.get("version")
if(version.equals("v1")) {
if(CollectionUtils.isNotEmpty(courseIds)){
val enrolmentList: java.util.List[java.util.Map[String, AnyRef]] = addCourseDetails(activeEnrolments, courseIds, request, false)
if ("v2".equals(version)) {
val enrolmentList: java.util.List[java.util.Map[String, AnyRef]] = addCourseDetails_v2(activeEnrolments)
if (enrolmentList != null) {
allEnrolledCourses.addAll(enrolmentList)
}
}
if(CollectionUtils.isNotEmpty(secureCourseIds)){
val secureCourseEnrolmentList: java.util.List[java.util.Map[String, AnyRef]] = addCourseDetails(activeEnrolments, secureCourseIds, request, true)
if (secureCourseEnrolmentList != null) {
allEnrolledCourses.addAll(secureCourseEnrolmentList)
}
}
}
else {
val enrolmentList: java.util.List[java.util.Map[String, AnyRef]] = addCourseDetails_v2(activeEnrolments)
if (enrolmentList != null) {
allEnrolledCourses.addAll(enrolmentList)
if (CollectionUtils.isNotEmpty(courseIds)) {
val enrolmentList: java.util.List[java.util.Map[String, AnyRef]] = addCourseDetails(activeEnrolments, courseIds, request, false)
if (enrolmentList != null) {
allEnrolledCourses.addAll(enrolmentList)
}
}
if (CollectionUtils.isNotEmpty(secureCourseIds)) {
val secureCourseEnrolmentList: java.util.List[java.util.Map[String, AnyRef]] = addCourseDetails(activeEnrolments, secureCourseIds, request, true)
if (secureCourseEnrolmentList != null) {
allEnrolledCourses.addAll(secureCourseEnrolmentList)
}
}
}
val updatedEnrolmentList = updateProgressData(allEnrolledCourses, userId, allCourseIds, request.getRequestContext)
if(version.equals("v1"))
addBatchDetails(updatedEnrolmentList, request)
else addBatchDetails_v2(updatedEnrolmentList, request)
if ("v2".equals(version))
addBatchDetails_v2(updatedEnrolmentList, request)
else
addBatchDetails(updatedEnrolmentList, request)

} else new java.util.ArrayList[java.util.Map[String, AnyRef]]()
}
Expand Down

0 comments on commit e695428

Please sign in to comment.