Skip to content

Commit

Permalink
PI-2521: No grade for prison manager and null for no teams (#4229)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcphee77 authored Sep 13, 2024
1 parent d56f86b commit f638c17
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ internal class NsisByCrnAndConvictionIdIntegrationTest {
code,
id,
Human(getForenames(), surname),
teams.map { it.toTeam() },
teams.map { it.toTeam() }.takeIf { it.isNotEmpty() },
probationArea.toProbationArea(false),
grade?.keyValueOf()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ data class StaffDetails(
@Schema(description = "staff name details")
val staff: Human,
@Schema(description = "all teams related to this staff member")
val teams: List<Team>,
val teams: List<Team>? = null,
@Schema(description = "provider this staff member is associated with")
val probationArea: ProbationArea,
@Schema(description = "Staff Grade", example = "PO,CRC - PO")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fun Staff.toStaffDetails(): StaffDetails = StaffDetails(
code,
id,
Human(getForenames(), surname),
teams.map { it.toTeam() },
teams.map { it.toTeam() }.takeIf { it.isNotEmpty() },
probationArea.toProbationArea(false),
grade?.keyValueOf()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ fun PrisonManager.toOffenderManager(includeProbationAreaTeams: Boolean) = Commun
isPrisonOffenderManager = true,
probationArea = probationArea.toProbationArea(includeProbationAreaTeams),
isResponsibleOfficer = responsibleOfficer() != null,
fromDate = date.toLocalDate(),
grade = staff.grade?.keyValueOf()
fromDate = date.toLocalDate()
)

fun uk.gov.justice.digital.hmpps.integrations.delius.provider.entity.Team.toTeam() = Team(
Expand Down

0 comments on commit f638c17

Please sign in to comment.