Skip to content

Commit

Permalink
Formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
probation-integration-bot[bot] authored Oct 16, 2024
1 parent bc9ae95 commit 50acf6c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ object LicenceConditionGenerator {
we can check this.
""".trimIndent()
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import uk.gov.justice.digital.hmpps.test.MockMvcExtensions.contentAsJson
import uk.gov.justice.digital.hmpps.test.MockMvcExtensions.withToken
import java.time.LocalDate


@AutoConfigureMockMvc
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class SentenceIntegrationTest {
Expand Down Expand Up @@ -132,7 +131,7 @@ class SentenceIntegrationTest {
""".trimIndent(),
false
),
),
LicenceConditionNote(
"Comment added by Joe Root on 23/04/2024 at 13:45",
"""
Expand All @@ -143,7 +142,7 @@ class SentenceIntegrationTest {
false
)
)
),
),
LicenceCondition(
"lic cond main",
imposedReleasedDate = LocalDate.now().minusDays(14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ class SentenceService(
.map { it.toRequirement() },
courtDocuments = documentRepository.getCourtDocuments(id, eventNumber).map { it.toCourtDocument() },
disposal?.id?.let { getUnpaidWorkTime(it) },
licenceConditions = disposal?.let { licenceConditionRepository.findAllByDisposalId(disposal.id).map {
it.toLicenceCondition()
} } ?: emptyList(),
licenceConditions = disposal?.let {
licenceConditionRepository.findAllByDisposalId(disposal.id).map {
it.toLicenceCondition()
}
} ?: emptyList(),
)

fun EntityLicenceCondition.toLicenceCondition() =
Expand All @@ -94,14 +96,14 @@ class SentenceService(
val note = noteSplitList.drop(1).joinToString(System.lineSeparator())

LicenceConditionNote(
noteSplitList.first(),
note.chunked(noteLength)[0],
note.let { n ->
when {
n.length > noteLength -> true
else -> false
}
noteSplitList.first(),
note.chunked(noteLength)[0],
note.let { n ->
when {
n.length > noteLength -> true
else -> false
}
}
)
}

Expand Down Expand Up @@ -200,5 +202,4 @@ class SentenceService(
}
return null
}

}

0 comments on commit 50acf6c

Please sign in to comment.