-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
mediumA more complex taskA more complex taskscylla-serverDevelopment Focused in the BackendDevelopment Focused in the Backend
Description
Description
Return all rules in the system with a boolean flag indicating if the requesting client is subscribed to each rule. Used for the main rules list UI where users can see all available rules and their subscription status, enabling them to discover and subscribe to existing rules or create new ones. Frontend handles filtering/sorting by topic or subscription status for better UX.
Acceptance Criteria
- Returns all rules in system
- Includes
is_subscribed: boolfor given client_id - Time: O(R) where R = total rules
Proposed Solution
GET /rules/all/{client_id}
Response: Vec<RuleWithSubscription>
where RuleWithSubscription = {
#[serde(flatten)]
rule: Rule,
is_subscribed: bool
}
Add get_all_rules_with_status() method to RuleManager in rule_structs.rs, add endpoint to rule_controller.rs. Reference get_all_rules() for reading from rules hashmap, and handle_msg() for checking subscriptions via subscriptions.read().await.get_right(&client_id). Test using Postman for basic functionality, then add tests to rule_structs_test.rs.
Mocks
No response
Metadata
Metadata
Assignees
Labels
mediumA more complex taskA more complex taskscylla-serverDevelopment Focused in the BackendDevelopment Focused in the Backend
Type
Projects
Status
Todo