Skip to content

Commit f77d25c

Browse files
authored
Merge pull request #725 from hmcts/defect/pdda-595
PDDA-595 Correcting time status check for new case status events
2 parents 1084b65 + 14f5daf commit f77d25c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main/java/uk/gov/hmcts/pdda/crlivestatus/CrLiveStatusHelper.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,10 @@ public boolean updatePublicDisplayStatus(CourtLogViewValue courtLogViewValue) {
142142
XhbCrLiveDisplayDao displayDao = xhbCrLiveDisplayDao.get();
143143
LOG.debug("XhbCrLiveDisplayDao found with ID: {}", displayDao.getCrLiveDisplayId());
144144

145-
LocalDate timeStatusSetDate = displayDao.getTimeStatusSet().toLocalDate();
146-
LocalDate today = LocalDate.now();
147-
148-
boolean isTimeNotAfter = !displayDao.getTimeStatusSet().isAfter(entryDateTime);
149-
boolean isTimeFromToday = timeStatusSetDate.isEqual(today);
150-
if (isTimeNotAfter && isTimeFromToday) {
145+
boolean isEventTimeAfterLastUpdate = entryDateTime.isAfter(displayDao.getTimeStatusSet());
146+
boolean isEventTimeFromToday = entryDateTime.toLocalDate().isEqual(LocalDate.now());
147+
148+
if (isEventTimeAfterLastUpdate && isEventTimeFromToday) {
151149
LOG.debug("CRLive - Updating existing XhbCrLiveDisplayDao with ID: {}",
152150
displayDao.getCrLiveDisplayId());
153151
displayDao.setTimeStatusSet(entryDateTime);

0 commit comments

Comments
 (0)