Skip to content

Commit

Permalink
PI-1939 - refactor requirement section
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj committed Mar 27, 2024
1 parent 6e5ac0f commit 8783a45
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class SentenceIntegrationTest {
LocalDate.now(),
listOf(AdditionalSentence(3, null, null, "Disqualified from Driving"))
),
Order("Default Sentence Type", 12, null, LocalDate.now().minusDays(14))
Order("Default Sentence Type", 12, null, LocalDate.now().minusDays(14)),
listOf()
),
Sentence(
OffenceDetails(
Expand All @@ -73,7 +74,9 @@ class SentenceIntegrationTest {
"overview",
emptyList()
),
Conviction(null, null, null, listOf())
Conviction(null, null, null, listOf()),
null,
listOf()
)
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package uk.gov.justice.digital.hmpps.api.model.sentence

data class Requirement(
val description: String,
val length: Long,
val progress: Long,
val notes: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ data class Sentence(
val offenceDetails: OffenceDetails,
val conviction: Conviction? = null,
val order: Order? = null,
val rar: Rar? = null
val requirements: List<Requirement>
)
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class SentenceService(
convictionDate = convictionDate,
additionalSentences.map { it.toAdditionalSentence() }
),
order = disposal?.toOrder()
order = disposal?.toOrder(),
listOf()
)

fun ExtraSentence.toAdditionalSentence(): AdditionalSentence =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.mockito.junit.jupiter.MockitoExtension
import org.mockito.kotlin.*
import uk.gov.justice.digital.hmpps.api.model.Name
import uk.gov.justice.digital.hmpps.api.model.overview.Order
import uk.gov.justice.digital.hmpps.api.model.overview.Rar
import uk.gov.justice.digital.hmpps.api.model.sentence.*
import uk.gov.justice.digital.hmpps.data.generator.AdditionalSentenceGenerator
import uk.gov.justice.digital.hmpps.data.generator.CourtAppearanceGenerator
Expand Down Expand Up @@ -130,7 +131,8 @@ class SentenceServiceTest {
AdditionalSentence(null, 500, "fine notes", "Fine")
)
),
Order("Default Sentence Type", 12, null, LocalDate.now().minusDays(14))
Order("Default Sentence Type", 12, null, LocalDate.now().minusDays(14)),
listOf()
)
)
)
Expand Down

0 comments on commit 8783a45

Please sign in to comment.