Skip to content

Commit

Permalink
PI-1917 handle incorrect date format (#3252)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj authored Feb 16, 2024
1 parent 49b59ed commit 28333ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"currentConcernsHostel": null,
"reviewNum": null,
"currentConcernsEscape": null,
"initialSpDate": null,
"initialSpDate": "12/02/2024",
"currentConcernsVulnerablity": null,
"currentConcernsBreachOfTrust": null,
"currentConcernsRiskOfSelfHarm": null,
"currentConcernsRiskOfSuicide": null,
"reviewSpDate": null,
"reviewSpDate": "2024-08-12",
"riskPrisonersCustody": null,
"riskStaffCustody": null,
"riskStaffCommunity": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ internal class IntegrationTest {
assertThat(assessment?.assessedBy, equalTo("John Smith"))
assertThat(assessment?.date, equalTo(LocalDate.parse("2023-12-07")))
assertThat(assessment?.totalScore, equalTo(76))
assertThat(assessment?.initialSentencePlanDate, equalTo(LocalDate.of(2024, 2, 12)))
assertThat(assessment?.sentencePlanReviewDate, equalTo(LocalDate.of(2024, 8, 12)))
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package uk.gov.justice.digital.hmpps.integrations.oasys

import com.fasterxml.jackson.annotation.JsonAlias
import com.fasterxml.jackson.annotation.JsonFormat
import org.springframework.web.service.annotation.GetExchange
import java.net.URI
import java.time.LocalDate
Expand All @@ -16,7 +17,9 @@ data class AssessmentSummary(
val dateCompleted: LocalDate,
val initiationDate: LocalDate,
val assessmentStatus: String,
@JsonFormat(pattern = "[yyyy-MM-dd][dd/MM/yyyy]") // temporary until oasys bug fixed, should not be used for responses
val initialSpDate: LocalDate? = null,
@JsonFormat(pattern = "[yyyy-MM-dd][dd/MM/yyyy]") // temporary until oasys bug fixed, should not be used for responses
val reviewSpDate: LocalDate? = null,
val reviewNum: String? = null,
val currentConcernsBreachOfTrust: String? = null,
Expand Down

0 comments on commit 28333ec

Please sign in to comment.