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.
Feature/pi 2097 crn convictions conviction (#3868)
* PI-2097 first commit Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model object Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 add test and hook up controller with service Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update integration test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 add extension function and update service Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update return model and test. also, temporary use localdate, instead of localdatetime to check if ci build works. Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 use localdatetime for one attribute. Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update test to see why ci fails Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update test to see why ci fails Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update test to see why ci fails Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update test to see why ci fails, and small refactor Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update test to see why ci fails Signed-off-by: Amardeep Chimber <[email protected]> * PI-2097 update model and test Signed-off-by: Amardeep Chimber <[email protected]> * Formatting changes * Empty-Commit --------- Signed-off-by: Amardeep Chimber <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0e07163
commit 0f923ee
Showing
24 changed files
with
1,661 additions
and
135 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
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.