Skip to content

Commit

Permalink
Merge pull request #154 from tarentomaheshvakkund/4.816-batchScheduling
Browse files Browse the repository at this point in the history
 KB-5718 | DEV|Assessment |BE| Capturing the starttime and endtime of the Batches while creating the batch for Assessment
  • Loading branch information
SaipradeepR authored Jul 8, 2024
2 parents dc01c16 + 850837a commit a83f727
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ private static void processStartEndDate(Map<String, Object> map, String timeType
calendar.set(Calendar.HOUR_OF_DAY, timeCalendar.get(Calendar.HOUR_OF_DAY));
calendar.set(Calendar.MINUTE, timeCalendar.get(Calendar.MINUTE));
calendar.set(Calendar.SECOND, timeCalendar.get(Calendar.SECOND));
if(ProjectUtil.getConfigValue(JsonKey.ADD_EXTRA_HOURS_MINS).equalsIgnoreCase("true")){
calendar.add(Calendar.HOUR_OF_DAY, 5);
calendar.add(Calendar.MINUTE, 30);
log.info("Added 5hours 30mins to the start_date and end_date");
}
map.put(dateType, calendar.getTime());
log.info("Updated date in map with key {}: {}", dateType, calendar.getTime());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ public static Map<String, Object> esCourseMapping(CourseBatch courseBatch, Strin
dateTimeFormat.setTimeZone(TimeZone.getTimeZone(ProjectUtil.getConfigValue(JsonKey.SUNBIRD_TIMEZONE)));
Map<String, Object> esCourseMap = mapper.convertValue(courseBatch, Map.class);
if (courseBatch.getStartTime() != null && courseBatch.getEndTime() != null) {
esCourseMap.put("startTime", courseBatch.getStartDate());
esCourseMap.put("endTime", courseBatch.getEndDate());
esCourseMap.put(JsonKey.START_TIME, courseBatch.getStartDate());
esCourseMap.put(JsonKey.END_TIME, courseBatch.getEndDate());
}
changeInDateFormat.forEach(key -> {
if (null != esCourseMap.get(key))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ private void updateCollection(RequestContext requestContext, Map<String, Object>
data.put("createdFor", courseBatch.getOrDefault(JsonKey.COURSE_CREATED_FOR, new ArrayList<>()));
data.put("startDate", courseBatch.getOrDefault(JsonKey.START_DATE, ""));
data.put("endDate", courseBatch.getOrDefault(JsonKey.END_DATE, null));
data.put("startTime", courseBatch.getOrDefault("startTime", null));
data.put("endTime", courseBatch.getOrDefault("endTime", null));
data.put("startTime", courseBatch.getOrDefault(JsonKey.START_TIME, null));
data.put("endTime", courseBatch.getOrDefault(JsonKey.END_TIME, null));
data.put("enrollmentType", courseBatch.getOrDefault(JsonKey.ENROLLMENT_TYPE, ""));
data.put("status", courseBatch.getOrDefault(JsonKey.STATUS, ""));
data.put("batchAttributes", courseBatch.getOrDefault(CourseJsonKey.BATCH_ATTRIBUTES, new HashMap<String, Object>()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ public final class JsonKey {
public static final String COURSE_ENROLL_ALLOWED_PRIMARY_CATEGORY = "course_enroll_allowed_primary_category";
public static final String START_DATE_BATCH = "start_date";
public static final String END_DATE_BATCH = "end_date";
public static final String ADD_EXTRA_HOURS_MINS = "addExtraHrsAndMins.start_date_end_date";

private JsonKey() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,4 @@ content_bucket=/content-store/content
static_host_url=https://static.karmayogiprod.nic.in
profile_update_url=/app/user-profile/details
course_enroll_allowed_primary_category=Course,Blended Program,Standalone Assessment
addExtraHrsAndMins.start_date_end_date=true

0 comments on commit a83f727

Please sign in to comment.