Skip to content

Commit

Permalink
PI-2692 Use CRN for notify reference + log id to Telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-bcl committed Dec 30, 2024
1 parent 22445a7 commit 292bb0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ internal class IntegrationTest {
"cd713c1b-1b27-45a0-b493-37a34666635a",
"07000000001",
mapOf("FirstName" to "Test", "NextWorkSession" to "01/01/2000"),
"A000001:01/01/2000:123, 456"
"A000001"
)
verify(telemetryService).trackEvent(
"UnpaidWorkAppointmentReminderSent",
mapOf("crn" to "A000001", "upwAppointmentIds" to "123, 456")
mapOf("crn" to "A000001", "upwAppointmentIds" to "123, 456", "notificationId" to "null")
)
verify(telemetryService).trackEvent(
"UnpaidWorkAppointmentReminderNotSent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ class UnpaidWorkAppointmentsService(
upwAppointmentRepository.getUnpaidWorkAppointments(LocalDate.now().plusDays(2), providerCode)
.forEach {
if (it.crn !in properties.excludedCrns) {
notificationClient.sendSms(
val response = notificationClient.sendSms(
templateId,
it.mobileNumber,
mapOf("FirstName" to it.firstName, "NextWorkSession" to it.appointmentDate),
"${it.crn}:${it.appointmentDate}:${it.upwAppointmentIds}"
it.crn
)
telemetryService.trackEvent(
"UnpaidWorkAppointmentReminderSent",
mapOf("crn" to it.crn, "upwAppointmentIds" to it.upwAppointmentIds)
mapOf(
"crn" to it.crn,
"upwAppointmentIds" to it.upwAppointmentIds,
"notificationId" to response?.notificationId.toString()
)
)
} else telemetryService.trackEvent(
"UnpaidWorkAppointmentReminderNotSent",
Expand Down

0 comments on commit 292bb0d

Please sign in to comment.