Skip to content

Commit

Permalink
SDIT-1859 Resynchronising alerts on receive to old bookings (#673)
Browse files Browse the repository at this point in the history
* Narrow down scenario for old bookings
  • Loading branch information
andymarke committed Jun 24, 2024
1 parent f609ece commit 317e9fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,15 @@ class AlertsSynchronisationService(
}
suspend fun resynchronisePrisonerAlerts(offenderNo: String) = resynchronisePrisonerAlertsForAdmission(
PrisonerReceiveDomainEvent(
ReceivePrisonerAdditionalInformationEvent(nomsNumber = offenderNo, reason = "READMISSION"),
ReceivePrisonerAdditionalInformationEvent(nomsNumber = offenderNo, reason = "READMISSION_SWITCH_BOOKING"),
),
)

suspend fun resynchronisePrisonerAlertsForAdmission(prisonerReceiveEvent: PrisonerReceiveDomainEvent) {
val receiveReason = prisonerReceiveEvent.additionalInformation.reason
val offenderNo = prisonerReceiveEvent.additionalInformation.nomsNumber

// TODO - narrow this down to just receiving on old books - requires search change
if (receiveReason !in setOf("READMISSION", "NEW_ADMISSION")) {
if (receiveReason != "READMISSION_SWITCH_BOOKING") {
telemetryClient.trackEvent(
"from-nomis-synch-alerts-resynchronise-ignored",
mapOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun mergeDomainEvent(
fun prisonerReceivedDomainEvent(
eventType: String = "prisoner-offender-search.prisoner.received",
offenderNo: String = "A1234KT",
reason: String = "READMISSION",
reason: String = "READMISSION_SWITCH_BOOKING",
) =
//language=JSON
"""{
Expand Down

0 comments on commit 317e9fd

Please sign in to comment.