Skip to content

Commit

Permalink
Task/JM-8188 Pre-mod userids preventing access to digital response re…
Browse files Browse the repository at this point in the history
…cords (#769)

* task/JM-8188 Unable to view migrated digital responses

* fixed checkStyle issue
  • Loading branch information
akikrahman1 authored Sep 19, 2024
1 parent 329a1d8 commit 9f48f8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import uk.gov.hmcts.juror.api.moj.controller.response.jurorresponse.IJurorResponse;
import uk.gov.hmcts.juror.api.moj.domain.ModJurorDetail;
import uk.gov.hmcts.juror.api.moj.domain.User;
Expand All @@ -25,6 +26,7 @@
* @see uk.gov.hmcts.juror.api.bureau.domain.BureauJurorDetail
*/
@Data
@Slf4j
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "All Details available on a juror in the system ")
Expand Down Expand Up @@ -423,8 +425,15 @@ public BureauJurorDetailDto(final ModJurorDetail jurorDetails) {
this.excusalReason = jurorDetails.getExcusalReason();
this.useJurorEmailDetails = jurorDetails.getUseJurorEmailDetails();
this.useJurorPhoneDetails = jurorDetails.getUseJurorPhoneDetails();
this.assignedStaffMember = jurorDetails.getAssignedStaffMember() != null
? new StaffDto(jurorDetails.getAssignedStaffMember()) : null;
try {
this.assignedStaffMember = jurorDetails.getAssignedStaffMember() != null
? new StaffDto(jurorDetails.getAssignedStaffMember())
: null;
} catch (Exception e) {
log.error("Error setting assigned staff member for response for juror {}",
jurorDetails.getJurorNumber() + " -- " + e.getMessage());
}

this.staffAssignmentDate = jurorDetails.getStaffAssignmentDate();
this.assignmentAllowed = jurorDetails.getAssignmentAllowed();
this.phoneLogs = jurorDetails.getContactLogs().stream().map(ContactLogDto::new).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ private JurorPaperResponseDetailDto copyPaperResponseRecordIntoDto(PaperResponse

if (jurorPaperResponse.getStaff() != null) {
// set the assignee if there is one
jurorPaperResponseDetailDto.setAssignedStaffMember(new UserDetailsDto(jurorPaperResponse.getStaff()));
try {
jurorPaperResponseDetailDto.setAssignedStaffMember(new UserDetailsDto(jurorPaperResponse.getStaff()));
} catch (Exception e) {
log.error("Error setting assigned staff member for response for juror {}",
jurorPaperResponse.getJurorNumber() + " -- " + e.getMessage());
}

}

// set the contact log
Expand Down

0 comments on commit 9f48f8d

Please sign in to comment.