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.
Browse files
Browse the repository at this point in the history
* PI-2729 add subtype filtering in code --------- Co-authored-by: probation-integration-bot[bot] <177347787+probation-integration-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
159700f
commit f138a2e
Showing
12 changed files
with
107 additions
and
53 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
15 changes: 10 additions & 5 deletions
15
...on/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/CaseNoteMessageGenerator.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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package uk.gov.justice.digital.hmpps.data.generator | ||
|
||
import uk.gov.justice.digital.hmpps.message.HmppsDomainEvent | ||
import uk.gov.justice.digital.hmpps.message.Notification | ||
import uk.gov.justice.digital.hmpps.resourceloader.ResourceLoader | ||
|
||
object CaseNoteMessageGenerator { | ||
val EXISTS_IN_DELIUS: HmppsDomainEvent = ResourceLoader.message("case-note-exists-in-delius") | ||
val NEW_TO_DELIUS: HmppsDomainEvent = ResourceLoader.message("case-note-new-to-delius") | ||
val NOT_FOUND: HmppsDomainEvent = ResourceLoader.message("case-note-not-found") | ||
val RESETTLEMENT_PASSPORT: HmppsDomainEvent = ResourceLoader.message("resettlement-passport-casenote") | ||
val NOMS_NUMBER_ADDED: HmppsDomainEvent = ResourceLoader.message("noms-number-added") | ||
val EXISTS_IN_DELIUS: Notification<HmppsDomainEvent> = | ||
ResourceLoader.notification<HmppsDomainEvent>("case-note-exists-in-delius") | ||
val NEW_TO_DELIUS: Notification<HmppsDomainEvent> = | ||
ResourceLoader.notification<HmppsDomainEvent>("case-note-new-to-delius") | ||
val NOT_FOUND: Notification<HmppsDomainEvent> = ResourceLoader.notification<HmppsDomainEvent>("case-note-not-found") | ||
val RESETTLEMENT_PASSPORT: Notification<HmppsDomainEvent> = | ||
ResourceLoader.notification<HmppsDomainEvent>("resettlement-passport-casenote") | ||
val NOMS_NUMBER_ADDED: Notification<HmppsDomainEvent> = | ||
ResourceLoader.notification<HmppsDomainEvent>("noms-number-added") | ||
} |
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
22 changes: 22 additions & 0 deletions
22
...c/main/kotlin/uk/gov/justice/digital/hmpps/integrations/prison/CaseNoteTypesOfInterest.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,22 @@ | ||
package uk.gov.justice.digital.hmpps.integrations.prison | ||
|
||
object CaseNoteTypesOfInterest { | ||
private val typeSubTypeMap = mapOf( | ||
"PRISON" to setOf("RELEASE"), | ||
"TRANSFER" to setOf("FROMTOL"), | ||
"GEN" to setOf("OSE"), | ||
"RESET" to setOf("BCST"), | ||
"ALERT" to setOf(), | ||
"OMIC" to setOf(), | ||
"OMIC_OPD" to setOf(), | ||
"KA" to setOf() | ||
) | ||
|
||
fun forSearchRequest(): Set<TypeSubTypeRequest> = | ||
typeSubTypeMap.map { TypeSubTypeRequest(it.key, it.value) }.toSet() | ||
|
||
fun verifyOfInterest(type: String, subType: String): Boolean { | ||
val subTypes = typeSubTypeMap[type] ?: return false | ||
return subTypes.isEmpty() || subTypes.contains(subType) | ||
} | ||
} |
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
Oops, something went wrong.