Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combing thru open api #441

Merged
merged 13 commits into from
Jun 12, 2024
531 changes: 458 additions & 73 deletions openapi.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ class AdjudicationsGateway(

return when (result) {
is WebClientWrapper.WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toAdjudication() })
Response(
data =
result.data
.map { it.toAdjudication() }
.sortedBy { it.incidentDetails?.dateTimeOfIncident },
)
}

is WebClientWrapper.WebClientWrapperResponse.Error -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AssessRisksAndNeedsGateway(

return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toRiskPredictorScore() })
Response(data = result.data.map { it.toRiskPredictorScore() }.sortedBy { it.completedDate })
}

is WebClientWrapperResponse.Error -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class CreateAndVaryLicenceGateway(

return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toLicence() })
val sortedLicences = result.data.sortedBy { it.createdDateTime }
Response(data = sortedLicences.map { it.toLicence() })
}

is WebClientWrapperResponse.Error -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class NomisGateway(

return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toAddress() })
Response(data = result.data.map { it.toAddress() }.sortedBy { it.startDate })
}

is WebClientWrapperResponse.Error -> {
Expand All @@ -111,7 +111,7 @@ class NomisGateway(
)
return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toOffence() })
Response(data = result.data.map { it.toOffence() }.sortedBy { it.startDate })
}

is WebClientWrapperResponse.Error -> {
Expand All @@ -133,7 +133,7 @@ class NomisGateway(
)
return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toAlert() })
Response(data = result.data.map { it.toAlert() }.sortedBy { it.dateCreated })
}

is WebClientWrapperResponse.Error -> {
Expand All @@ -155,7 +155,7 @@ class NomisGateway(
)
return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.map { it.toSentence() })
Response(data = result.data.map { it.toSentence() }.sortedBy { it.dateOfSentencing })
}

is WebClientWrapperResponse.Error -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PrisonerOffenderSearchGateway(

return when (result) {
is WebClientWrapperResponse.Success -> {
Response(data = result.data.content.map { it.toPerson() })
Response(data = result.data.content.map { it.toPerson() }.sortedBy { it.dateOfBirth })
}

is WebClientWrapperResponse.Error -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class ProbationOffenderSearchGateway(
return when (result) {
is WebClientWrapperResponse.Success -> {
Response(
data = result.data.map { it.toPerson() },
result.data.map { it.toPerson() }.sortedBy { it.dateOfBirth },
)
}
is WebClientWrapperResponse.Error -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.time.LocalDateTime
)
class CaseNotesGatewayTest(
@MockBean val hmppsAuthGateway: HmppsAuthGateway,
val caseNotesGateway: CaseNotesGateway,
private val caseNotesGateway: CaseNotesGateway,
) : DescribeSpec(
{

Expand Down
Loading