Skip to content

Commit

Permalink
[SELC-5853] Adding send user notification from onboarding for prod-fd…
Browse files Browse the repository at this point in the history
…* products (#568)
  • Loading branch information
andrea-putzu authored Oct 24, 2024
1 parent d93f242 commit 90c29f3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ private void prepareAndSendNotification(ExecutionContext context, Product produc
}

private void prepareAndSendUserNotification(ExecutionContext context, Product product, NotificationConfig.Consumer consumer, NotificationsResources notificationsResources, String notificationEventTraceId) {
/*NotificationUserBuilder notificationUserBuilder = notificationUserBuilderFactory.create(consumer);
if (notificationUserBuilder.shouldSendUserNotification(notificationsResources.getOnboarding(), notificationsResources.getInstitution())) {
NotificationUserBuilder notificationUserBuilder = notificationUserBuilderFactory.create(consumer);
if (notificationUserBuilder != null && notificationUserBuilder.shouldSendUserNotification(notificationsResources.getOnboarding(), notificationsResources.getInstitution())) {
context.getLogger().info(() -> String.format("[APZ] prepareAndSendUserNotification %s [%s]", notificationsResources.getInstitution().getDescription(), consumer.topic()));

notificationsResources.getOnboarding().getUsers().forEach(onboardingUser -> {
Expand All @@ -151,7 +151,7 @@ private void prepareAndSendUserNotification(ExecutionContext context, Product pr

} else {
context.getLogger().info(() -> String.format("It was not necessary to send a notification on the topic %s because the onboarding with ID %s did not pass filter verification", notificationsResources.getOnboarding().getId(), consumer.topic()));
}*/
}
}

public static NotificationUserToSend getNotificationUserToSend(NotificationsResources notificationsResources,
Expand Down Expand Up @@ -185,7 +185,7 @@ private void sendNotification(ExecutionContext context, String topic, Notificati
telemetryClient.trackEvent(EVENT_ONBOARDING_FN_NAME, notificationEventMap(notificationToSend, topic, notificationEventTraceId), Map.of(EVENT_ONBOARDING_INSTTITUTION_FN_SUCCESS, 1D));
}

/*private void sendUserNotification(ExecutionContext context, String topic, NotificationUserToSend notificationUserToSend, String notificationEventTraceId) {
private void sendUserNotification(ExecutionContext context, String topic, NotificationUserToSend notificationUserToSend, String notificationEventTraceId) {
String message = null;
try {
message = mapper.writeValueAsString(notificationUserToSend);
Expand All @@ -198,7 +198,7 @@ private void sendNotification(ExecutionContext context, String topic, Notificati

eventHubRestClient.sendMessage(topic, message);
telemetryClient.trackEvent(EVENT_ONBOARDING_FN_NAME, notificationUserEventMap(notificationUserToSend, topic, notificationEventTraceId), Map.of(EVENT_ONBOARDING_INSTTITUTION_FN_SUCCESS, 1D));
}*/
}

private void sendTestEnvProductsNotification(ExecutionContext context, Product product, String topic, NotificationToSend notificationToSend, String notificationEventTraceId) {
context.getLogger().info(() -> String.format("Starting sendTestEnvProductsNotification with testEnv %s", product.getTestEnvProductIds()));
Expand Down

0 comments on commit 90c29f3

Please sign in to comment.