diff --git a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto index c9b9ac3e..721a2807 100644 --- a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto +++ b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto @@ -21,6 +21,8 @@ message NotificationRuleMutableData { NotificationIntegrationTarget integration_target = 7; bool disabled = 8; + + bool is_deleted = 9; // Soft delete flag } message NotificationIntegrationTarget { diff --git a/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java b/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java index ff55d6c3..4ae5d13b 100644 --- a/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java +++ b/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java @@ -108,6 +108,9 @@ public void getAllNotificationRules( .addAllNotificationRules( notificationRuleStore.getAllObjects(requestContext, request.getFilter()).stream() .map(ConfigObject::getData) + .filter( + notificationRule -> + !notificationRule.getNotificationRuleMutableData().getIsDeleted()) .collect(Collectors.toUnmodifiableList())) .build()); responseObserver.onCompleted(); @@ -145,6 +148,7 @@ public void getNotificationRule( NotificationRule notificationRule = notificationRuleStore .getData(requestContext, request.getNotificationRuleId()) + .filter(rule -> !rule.getNotificationRuleMutableData().getIsDeleted()) .orElseThrow(Status.NOT_FOUND::asRuntimeException); responseObserver.onNext( GetNotificationRuleResponse.newBuilder().setNotificationRule(notificationRule).build());