generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/gradle/com.google.cloud.tools.jib…
…-3.4.3
- Loading branch information
Showing
40 changed files
with
1,821 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/AdditionalSentenceGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.data.generator.ReferenceDataGenerator.REF_DISQ | ||
import uk.gov.justice.digital.hmpps.data.generator.SentenceGenerator.CURRENTLY_MANAGED | ||
import uk.gov.justice.digital.hmpps.integrations.delius.entity.ReferenceData | ||
import uk.gov.justice.digital.hmpps.integrations.delius.event.entity.Event | ||
import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.AdditionalSentence | ||
import java.math.BigDecimal | ||
|
||
object AdditionalSentenceGenerator { | ||
|
||
val SENTENCE_DISQ = | ||
generateSentence(amount = BigDecimal(7), length = 3, referenceData = REF_DISQ, event = CURRENTLY_MANAGED) | ||
|
||
fun generateSentence( | ||
length: Long? = null, | ||
amount: BigDecimal? = null, | ||
notes: String? = null, | ||
event: Event, | ||
referenceData: ReferenceData | ||
) = AdditionalSentence( | ||
IdGenerator.getAndIncrement(), | ||
event, | ||
referenceData, | ||
amount, | ||
length, | ||
notes, | ||
false, | ||
) | ||
} |
43 changes: 43 additions & 0 deletions
43
...e-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/CourtGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.Court | ||
import uk.gov.justice.digital.hmpps.integrations.delius.provider.entity.ProbationAreaEntity | ||
import java.time.LocalDate | ||
import java.time.LocalTime | ||
import java.time.ZoneId | ||
import java.time.ZonedDateTime | ||
|
||
object CourtGenerator { | ||
|
||
val PROBATIONARE_AREA = ProbationAreaEntity( | ||
true, | ||
"West Midlands Region", | ||
"N52", | ||
null, | ||
false, | ||
IdGenerator.getAndIncrement(), | ||
) | ||
|
||
val BHAM = Court( | ||
IdGenerator.getAndIncrement(), | ||
"BRMNCC", | ||
true, | ||
"Birmingham Crown Court", | ||
"0121 111 2222", | ||
"0121 333 4444", | ||
"Queen Elizabeth II Law Courts", | ||
"1 Newton Street", | ||
null, | ||
"Birmingham", | ||
"West Midlands", | ||
"B4 7NA", | ||
"England", | ||
ReferenceDataGenerator.CRN.id, | ||
ZonedDateTime.of(LocalDate.now().minusDays(7), LocalTime.NOON, ZoneId.of("Europe/London")), | ||
ZonedDateTime.of(LocalDate.now(), LocalTime.NOON, ZoneId.of("Europe/London")), | ||
PROBATIONARE_AREA.id, | ||
null, | ||
PROBATIONARE_AREA, | ||
ReferenceDataGenerator.CRN | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
...elius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/DisposalTypeGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.DisposalType | ||
|
||
object DisposalTypeGenerator { | ||
|
||
val CURFEW_ORDER = | ||
DisposalType(IdGenerator.getAndIncrement(), "Curfew Order", "SP", cja2003Order = false, legacyOrder = true, 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/InstitutionGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.Institution | ||
import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.InstitutionId | ||
|
||
object InstitutionGenerator { | ||
|
||
val WSIHMP = generate("WSIHMP", "WSI") | ||
|
||
fun generate(code: String, prisonId: String): Institution { | ||
return Institution( | ||
id = InstitutionId(IdGenerator.getAndIncrement(), true), | ||
code = code, | ||
description = "Test institution ($code)", | ||
institutionName = "Test institution $code", | ||
establishmentType = ReferenceDataGenerator.PRISON, | ||
nomisCdeCode = prisonId | ||
) | ||
} | ||
} |
Oops, something went wrong.