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.
* PI-1441 WIP * PI-1441 WIP * PI-1441 add contact when adding licence conditions * PI-1441 * PI-1441 - add feature flag check * deactivate handler until ready for use * update court case to stabilize tests
- Loading branch information
1 parent
76cd18b
commit 13f15c0
Showing
37 changed files
with
1,445 additions
and
16 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
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
3 changes: 1 addition & 2 deletions
3
projects/create-and-vary-a-licence-and-delius/deploy/values-prod.yml
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
enabled: false # TODO set this to true when you're ready to deploy your service | ||
|
||
generic-service: | ||
ingress: | ||
host: create-and-vary-a-licence-and-delius.hmpps.service.justice.gov.uk | ||
|
||
env: | ||
SENTRY_ENVIRONMENT: prod | ||
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_HMPPS-AUTH_TOKEN-URI: https://sign-in.hmpps.service.justice.gov.uk/auth/oauth/token | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI: https://sign-in.hmpps.service.justice.gov.uk/auth/.well-known/jwks.json | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI: https://sign-in.hmpps.service.justice.gov.uk/auth/issuer |
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
51 changes: 51 additions & 0 deletions
51
...lius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ReferenceDataGenerator.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,51 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.integrations.delius.contact.entity.ContactType | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.CvlMapping | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.Dataset | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.LicenceConditionCategory | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.ReferenceData | ||
|
||
object ReferenceDataGenerator { | ||
val DATASET_LC_SUB_CAT = generateDataset("LICENCE CONDITION SUB CATEGORY") | ||
val LC_STANDARD_CATEGORY = generateLcCategory(CvlMapping.STANDARD_CATEGORY_CODE) | ||
val LC_STANDARD_SUB_CATEGORY = | ||
generateReferenceData(CvlMapping.STANDARD_SUB_CATEGORY_CODE, dataset = DATASET_LC_SUB_CAT) | ||
val LC_BESPOKE_CATEGORY = generateLcCategory(CvlMapping.BESPOKE_CATEGORY_CODE) | ||
val LC_BESPOKE_SUB_CATEGORY = | ||
generateReferenceData(CvlMapping.BESPOKE_SUB_CATEGORY_CODE, dataset = DATASET_LC_SUB_CAT) | ||
val CVL_MAPPINGS = listOf( | ||
generateCvlMapping( | ||
"AdditionalLcOne", | ||
generateLcCategory("ADD1"), | ||
generateLcSubCategory("ADD1S") | ||
), | ||
generateCvlMapping( | ||
"AdditionalLcTwo", | ||
generateLcCategory("ADD2"), | ||
generateLcSubCategory("ADD2S") | ||
) | ||
) | ||
val CONTACT_TYPE_LPOP = generateContactType(ContactType.LPOP) | ||
|
||
fun generateLcCategory(code: String, id: Long = IdGenerator.getAndIncrement()) = LicenceConditionCategory(code, id) | ||
fun generateDataset(code: String, id: Long = IdGenerator.getAndIncrement()) = Dataset(code, id) | ||
fun generateReferenceData( | ||
code: String, | ||
description: String = "Description of $code", | ||
dataset: Dataset, | ||
id: Long = IdGenerator.getAndIncrement() | ||
) = ReferenceData(code, description, dataset.id, id) | ||
|
||
fun generateLcSubCategory(code: String, description: String = "LC SubCategory $code") = | ||
generateReferenceData(code, description, DATASET_LC_SUB_CAT) | ||
|
||
fun generateCvlMapping( | ||
cvlCode: String, | ||
mainCategory: LicenceConditionCategory, | ||
subCategory: ReferenceData, | ||
id: Long = IdGenerator.getAndIncrement() | ||
) = CvlMapping(cvlCode, mainCategory, subCategory, id) | ||
|
||
fun generateContactType(code: String, id: Long = IdGenerator.getAndIncrement()) = ContactType(code, id) | ||
} |
32 changes: 32 additions & 0 deletions
32
...nd-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.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,32 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.integrations.delius.person.entity.Person | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.Disposal | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.DisposalType | ||
import uk.gov.justice.digital.hmpps.integrations.delius.sentence.entity.Event | ||
|
||
object SentenceGenerator { | ||
val SENTENCE_TYPE_SC = generateSentenceType("SC") | ||
val EVENT_CREATE_LC = generateEvent("1", PersonGenerator.PERSON_CREATE_LC) | ||
val SENTENCE_CREATE_LC = generate(EVENT_CREATE_LC) | ||
|
||
fun generateSentenceType(sentenceType: String, id: Long = IdGenerator.getAndIncrement()) = | ||
DisposalType(sentenceType, id) | ||
|
||
fun generateEvent( | ||
number: String, | ||
person: Person, | ||
disposal: Disposal? = null, | ||
active: Boolean = true, | ||
softDeleted: Boolean = false, | ||
id: Long = IdGenerator.getAndIncrement() | ||
) = Event(number, person, disposal, active, softDeleted, id) | ||
|
||
fun generate( | ||
event: Event, | ||
type: DisposalType = SENTENCE_TYPE_SC, | ||
active: Boolean = true, | ||
softDeleted: Boolean = false, | ||
id: Long = IdGenerator.getAndIncrement() | ||
) = Disposal(event, type, active, softDeleted, id) | ||
} |
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
15 changes: 15 additions & 0 deletions
15
...e-and-vary-a-licence-and-delius/src/dev/resources/messages/licence-activated-L453621.json
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,15 @@ | ||
{ | ||
"eventType": "create-and-vary-a-licence.licence.activated", | ||
"version": 1, | ||
"description": "A licence has been activated", | ||
"detailUrl": "http://localhost:{wiremock.port}/cvl/events/licence-condition-applied/df2d3748-2619-4e27-b864-946e125ffb3e", | ||
"occurredAt": "2022-12-04T10:42:43+00:00", | ||
"personReference": { | ||
"identifiers": [ | ||
{ | ||
"type": "CRN", | ||
"value": "L453621" | ||
} | ||
] | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...a-licence-and-delius/src/dev/resources/simulations/__files/licence-activated-L453621.json
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,39 @@ | ||
{ | ||
"crn": "L453621", | ||
"releaseDate": "2023-10-13", | ||
"startDate": "2023-10-14", | ||
"expiryDate": "2023-12-14", | ||
"standardLicenceConditions": [ | ||
{ | ||
"code": "2891a984-b8a3-4584-8ae0-a1d327226a5f", | ||
"description": "A Standard Condition", | ||
"pssCondition": false | ||
}, | ||
{ | ||
"code": "18a098f3-a4d5-4490-b623-287bab511542f", | ||
"description": "Another Standard Condition", | ||
"pssCondition": false | ||
} | ||
], | ||
"additionalLicenceConditions": [ | ||
{ | ||
"code": "AdditionalLcOne", | ||
"description": "Additional Licence Condition One", | ||
"pssCondition": false | ||
}, | ||
{ | ||
"code": "AdditionalLcTwo", | ||
"description": "Additional Licence Condition Two", | ||
"pssCondition": true | ||
} | ||
], | ||
"bespokeLicenceConditions": [ | ||
{ | ||
"description": "First Bespoke Condition" | ||
}, | ||
{ | ||
"description": "Second Bespoke Condition" | ||
} | ||
], | ||
"prisonCode": "SWI" | ||
} |
13 changes: 13 additions & 0 deletions
13
...ects/create-and-vary-a-licence-and-delius/src/dev/resources/simulations/mappings/cvl.json
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,13 @@ | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"urlPath": "/cvl/events/licence-condition-applied/df2d3748-2619-4e27-b864-946e125ffb3e" | ||
}, | ||
"response": { | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"status": 200, | ||
"bodyFileName": "licence-activated-L453621.json" | ||
} | ||
} |
Oops, something went wrong.