Skip to content

Commit

Permalink
MAN-28 - add id attribute to lc note
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj committed Oct 17, 2024
1 parent 35dce3c commit f8f24a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class SentenceIntegrationTest {
LocalDate.now(),
listOf(
LicenceConditionNote(
0,
"CVL Service",
LocalDate.of(2024, 4, 22),
"""
Expand All @@ -134,6 +135,7 @@ class SentenceIntegrationTest {
true
),
LicenceConditionNote(
1,
"Joe Root",
LocalDate.of(2024, 4, 23),
"""
Expand All @@ -156,6 +158,7 @@ class SentenceIntegrationTest {
LocalDate.now(),
listOf(
LicenceConditionNote(
0,
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 @@ -11,6 +11,7 @@ data class LicenceCondition(
)

data class LicenceConditionNote(
val id: Int,
val createdBy: String? = null,
val createdByDate: LocalDate? = null,
val note: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class SentenceService(

notes?.let {
val splitParam = "---------------------------------------------------------" + System.lineSeparator()
return notes.split(splitParam).map { note ->
return notes.split(splitParam).mapIndexed { index, note ->
val matchResult = Regex(
"^Comment added by (.+?) on (\\d{2}/\\d{2}/\\d{4}) at \\d{2}:\\d{2}"
+ System.lineSeparator()
Expand All @@ -106,6 +106,7 @@ class SentenceService(


LicenceConditionNote(
index,
userCreatedBy,
dateCreatedBy,
commentText.removeSuffix(System.lineSeparator()).chunked(1500)[0],
Expand Down

0 comments on commit f8f24a9

Please sign in to comment.