Skip to content

Commit d6ae263

Browse files
author
popey2700
committed
Updated sentence for EPF
1 parent f9eb048 commit d6ae263

File tree

4 files changed

+5
-40
lines changed

4 files changed

+5
-40
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/CaseDetail.kt

+1-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ data class Name(
1919
)
2020

2121
data class CaseSentence(
22-
val date: String? = null,
23-
val sentencingCourt: SentencingCourt? = null,
24-
val releaseDate: String? = null,
25-
)
26-
27-
data class SentencingCourt(
28-
val name: String? = null,
22+
val expectedReleaseDate: String? = null,
2923
)
3024

3125
data class ResponsibleProvider(

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/probationintegrationepf/EPFCaseDetail.kt

+1-25
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.CaseDetail
44
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.CaseSentence
55
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Name
66
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ResponsibleProvider
7-
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.SentencingCourt
87

98
data class EPFCaseDetail(
109
val nomsId: String? = null,
@@ -25,34 +24,11 @@ data class EPFCaseDetail(
2524
gender = this.gender,
2625
sentence =
2726
CaseSentence(
28-
date = this.sentence?.date,
29-
sentencingCourt = SentencingCourt(this.sentence?.sentencingCourt?.name),
30-
releaseDate = this.sentence?.releaseDate,
27+
expectedReleaseDate = sentence?.expectedReleaseDate,
3128
),
3229
responsibleProvider = ResponsibleProvider(code = this.responsibleProvider?.code, name = this.responsibleProvider?.name),
3330
ogrsScore = this.ogrsScore,
3431
age = this.age,
3532
ageAtRelease = this.ageAtRelease,
3633
)
3734
}
38-
39-
data class Name(
40-
val forename: String? = null,
41-
val middleName: String? = null,
42-
val surname: String? = null,
43-
)
44-
45-
data class CaseSentence(
46-
val date: String? = null,
47-
val sentencingCourt: SentencingCourt? = null,
48-
val releaseDate: String? = null,
49-
)
50-
51-
data class SentencingCourt(
52-
val name: String? = null,
53-
)
54-
55-
data class ResponsibleProvider(
56-
val code: String? = null,
57-
val name: String? = null,
58-
)

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/gateways/probationintegrationEPF/fixtures/GetEPFPersonDetailsResponse.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
"dateOfBirth":"2000-03-01",
99
"gender": null,
1010
"sentence": {
11-
"date": "2021-03-03",
12-
"sentencingCourt": {
13-
"name": "Fakecourt"
14-
},
15-
"releaseDate": "2021-10-10"
11+
"expectedReleaseDate": "2021-10-10"
1612
},
1713
"responsibleProvider": {
1814
"code": "999000ABC",
@@ -21,4 +17,4 @@
2117
"ogrsScore": 123,
2218
"age": 23,
2319
"ageAtRelease": 24
24-
}
20+
}

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/helpers/CaseDetailsHelper.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.CaseDetail
44
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.CaseSentence
55
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Name
66
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ResponsibleProvider
7-
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.SentencingCourt
87

98
fun generateCaseDetail(): CaseDetail {
109
return CaseDetail(
@@ -17,7 +16,7 @@ fun generateCaseDetail(): CaseDetail {
1716
),
1817
dateOfBirth = "2000-03-01",
1918
gender = null,
20-
sentence = CaseSentence(date = "2021-03-03", sentencingCourt = SentencingCourt("Fakecourt"), releaseDate = "2021-10-10"),
19+
sentence = CaseSentence(expectedReleaseDate = "2021-10-10"),
2120
responsibleProvider =
2221
ResponsibleProvider(
2322
code = "999000ABC",

0 commit comments

Comments
 (0)