Skip to content

Commit

Permalink
Added more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Edwards-cgi committed Feb 11, 2025
1 parent 2295df3 commit e02c420
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import jakarta.persistence.Transient;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import uk.gov.hmcts.darts.audio.entity.MediaRequestEntity;
import uk.gov.hmcts.darts.audio.entity.MediaRequestEntity_;
Expand All @@ -32,6 +33,7 @@
@Table(name = "hearing")
@Getter
@Setter
@Slf4j
public class HearingEntity extends CreatedModifiedBaseEntity
implements HasIntegerId {

Expand Down Expand Up @@ -100,8 +102,10 @@ public class HearingEntity extends CreatedModifiedBaseEntity
*/
public boolean addMedia(MediaEntity mediaEntity) {
if (containsMedia(mediaEntity)) {
log.info("Media {} already exists in hearing {}", mediaEntity.getId(), id);
return false;
}
log.info("Added media {} to hearing {}", mediaEntity.getId(), id);
mediaList.add(mediaEntity);
return true;
}
Expand Down

0 comments on commit e02c420

Please sign in to comment.