Skip to content

Commit 4c5657b

Browse files
authored
Proto changes for notification rule delete
1 parent 880cd54 commit 4c5657b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ message NotificationRuleMutableData {
2121

2222
NotificationIntegrationTarget integration_target = 7;
2323
bool disabled = 8;
24+
25+
bool is_deleted = 9; // Soft delete flag
2426
}
2527

2628
message NotificationIntegrationTarget {

notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ public void getAllNotificationRules(
108108
.addAllNotificationRules(
109109
notificationRuleStore.getAllObjects(requestContext, request.getFilter()).stream()
110110
.map(ConfigObject::getData)
111+
.filter(
112+
notificationRule ->
113+
!notificationRule.getNotificationRuleMutableData().getIsDeleted())
111114
.collect(Collectors.toUnmodifiableList()))
112115
.build());
113116
responseObserver.onCompleted();
@@ -145,6 +148,7 @@ public void getNotificationRule(
145148
NotificationRule notificationRule =
146149
notificationRuleStore
147150
.getData(requestContext, request.getNotificationRuleId())
151+
.filter(rule -> !rule.getNotificationRuleMutableData().getIsDeleted())
148152
.orElseThrow(Status.NOT_FOUND::asRuntimeException);
149153
responseObserver.onNext(
150154
GetNotificationRuleResponse.newBuilder().setNotificationRule(notificationRule).build());

0 commit comments

Comments
 (0)