Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/MAN-28-sentence-license-conditio…
Browse files Browse the repository at this point in the history
…n-notes' into MAN-28-sentence-license-condition-notes
  • Loading branch information
achimber-moj committed Oct 16, 2024
2 parents 8ef3d6c + 81c2bb6 commit b1106e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ class SentenceIntegrationTest {
LocalDate.now(),
listOf(
LicenceConditionNote(
note = "He shall not contact or associate with Peter Jones without the prior approval of the supervising officer;",
hasNotesBeenTruncated = false)
note = "He shall not contact or associate with Peter Jones without the prior approval of the supervising officer;",
hasNotesBeenTruncated = false
)
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ class SentenceService(

notes?.let {
val splitParam = "---------------------------------------------------------" + System.lineSeparator()
return notes.split(splitParam).map {
note ->
val addedBy = Regex("^Comment added by .+? on \\d{2}\\/\\d{2}\\/\\d{4} at \\d{2}:\\d{2}"
+ System.lineSeparator()).find(note)?.value
return notes.split(splitParam).map { note ->
val addedBy = Regex(
"^Comment added by .+? on \\d{2}\\/\\d{2}\\/\\d{4} at \\d{2}:\\d{2}"
+ System.lineSeparator()
).find(note)?.value
val noteText = addedBy?.let { note.removePrefix(addedBy) } ?: note


Expand Down

0 comments on commit b1106e9

Please sign in to comment.