Skip to content

Commit

Permalink
MAN-28 - add id to LicenceCondition data class
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj committed Oct 17, 2024
1 parent ad2edf2 commit c2f31fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ 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.CourtReportGenerator.COURT_DOCUMENT
import uk.gov.justice.digital.hmpps.data.generator.CourtReportGenerator.EVENT_DOCUMENT
import uk.gov.justice.digital.hmpps.data.generator.LicenceConditionGenerator.LC_WITHOUT_NOTES
import uk.gov.justice.digital.hmpps.data.generator.LicenceConditionGenerator.LC_WITH_NOTES
import uk.gov.justice.digital.hmpps.data.generator.LicenceConditionGenerator.LC_WITH_NOTES_WITHOUT_ADDED_BY
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator
import uk.gov.justice.digital.hmpps.data.generator.personalDetails.PersonDetailsGenerator
import uk.gov.justice.digital.hmpps.service.toSummary
Expand Down Expand Up @@ -120,6 +123,7 @@ class SentenceIntegrationTest {
"3 minutes completed (of 12 hours)",
listOf(
LicenceCondition(
LC_WITH_NOTES.id,
LIC_COND_MAIN_CAT.description,
LIC_COND_SUB_CAT.description,
LocalDate.now().minusDays(7),
Expand Down Expand Up @@ -148,10 +152,12 @@ class SentenceIntegrationTest {
)
),
LicenceCondition(
LC_WITHOUT_NOTES.id,
LIC_COND_MAIN_CAT.description,
imposedReleasedDate = LocalDate.now().minusDays(14),
),
LicenceCondition(
LC_WITH_NOTES_WITHOUT_ADDED_BY.id,
LIC_COND_MAIN_CAT.description,
LIC_COND_SUB_CAT.description,
LocalDate.now().minusDays(7),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package uk.gov.justice.digital.hmpps.api.model.sentence
import java.time.LocalDate

data class LicenceCondition(
val id: Long,
val mainDescription: String,
val subTypeDescription: String? = null,
val imposedReleasedDate: LocalDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class SentenceService(

fun EntityLicenceCondition.toLicenceCondition() =
LicenceCondition(
id,
mainCategory.description,
subCategory?.description,
imposedReleasedDate,
Expand Down

0 comments on commit c2f31fc

Please sign in to comment.