Skip to content

Commit

Permalink
PI-1630 listen for event type for inner message (#2547)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj authored Nov 8, 2023
1 parent 1b7afda commit 63f5cce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"MessageAttributes": {
"eventType": {
"Type": "String",
"Value": "opd.produced"
"Value": "risk-assessment.scores.determined"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"MessageAttributes": {
"eventType": {
"Type": "String",
"Value": "opd.produced"
"Value": "risk-assessment.scores.determined"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import uk.gov.justice.digital.hmpps.telemetry.TelemetryService
import java.time.ZonedDateTime

const val FeatureFlag = "opd-assessment-processing"
const val OpdProduced = "opd.produced"

@Component
class Handler(
Expand All @@ -21,6 +22,7 @@ class Handler(
private val featureFlags: FeatureFlags
) : NotificationHandler<HmppsDomainEvent> {
override fun handle(notification: Notification<HmppsDomainEvent>) {
if (notification.message.eventType != OpdProduced) return
val opdAssessment = notification.message.opdAssessment()
if (!featureFlags.enabled(FeatureFlag)) {
telemetryService.trackEvent("OpdAssessmentIgnored", opdAssessment.telemetryProperties())
Expand Down

0 comments on commit 63f5cce

Please sign in to comment.