Skip to content

Commit

Permalink
Merge pull request #49 from hmcts/HMIS-1203-remove-session-duration
Browse files Browse the repository at this point in the history
HMIS-1203 Remove sessionDuration
  • Loading branch information
joshblackmoor authored May 23, 2023
2 parents efeff71 + d92f327 commit 82fb738
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public class Session {
private List<Judge> johs = new ArrayList<>();
private Location room;

/**
* If Session in CLP table is AM, duration will be 180, otherwise 120.
*/
private Integer sessionDuration;

/**
* ID from the CLP table.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public Session formatRequestJson(String clpId) {
Optional<CourtListingProfile> courtListingProfile = courtListingProfileRepository.findById(clpId);
if (courtListingProfile.isPresent()) {
session.setRoom(formatLocation(courtListingProfile.get(), true));
session.setSessionDuration(calculateSessionDuration(courtListingProfile.get()));
session.setSessionReference(courtListingProfile.get().getId());
session.setSessionStart(calculateSessionStartTime(courtListingProfile.get()));
session.setVenue(formatLocation(courtListingProfile.get(), false));
Expand All @@ -112,14 +111,6 @@ private Location formatLocation(CourtListingProfile courtListingProfile, boolean
return new Location(courtListingProfile.getLocationId(), LocationType.COURT.label);
}

private Integer calculateSessionDuration(CourtListingProfile courtListingProfile) {
if ("AM".equals(courtListingProfile.getSession())) {
return 180;
}

return 120;
}

private String calculateSessionStartTime(CourtListingProfile courtListingProfile) {
if ("AM".equals(courtListingProfile.getSession())) {
return courtListingProfile.getSessionDate().toString() + "T10:00:00Z";
Expand Down

0 comments on commit 82fb738

Please sign in to comment.