Commit Graph

12 Commits

Author SHA1 Message Date
Jeremiah Russell
66dd0dc983 feat(config): add remove label from rule
- implement remove_label_from_rule function to delete labels from rules
- add error handling for rule not found
- save configuration after removing the label
2025-10-09 12:32:56 +01:00
Jeremiah Russell
0a537e4df7 feat(config): add label functionality to rules
- add function to add labels to existing rules
- implement save function to persist changes to the config file
2025-10-09 11:19:11 +01:00
Jeremiah Russell
d05f03fc1e feat(config): add get_rule function to retrieve existing rules
- implement get_rule function to fetch rule by id
2025-10-09 09:53:09 +01:00
Jeremiah Russell
0dab9cc427 🐛 fix(config): improve rule removal and logging
- fix the logic of `remove_rule_by_label` to check label existence correctly
- change the error returned when label not found to include the label
- add log information when removing rules by id or label
2025-10-08 17:37:49 +01:00
Jeremiah Russell
e24d8b1e47 ♻️ refactor(config): use string keys for rules in config
- changed the type of the key used in the rules BTreeMap from usize to String
- this change makes it easier to serialize and deserialize the configuration
- updated the remove_rule_by_id and remove_rule_by_label functions to use string keys
2025-10-08 17:17:57 +01:00
Jeremiah Russell
662d08ba4f feat(config): enhance rule management and label handling
- change rules storage from BTreeMap<String, EolRule> to BTreeMap<usize, EolRule>
- implement functions to remove rules by ID or label
- add helper functions to retrieve labels and rules associated with labels
- improve error handling for missing labels or rules
2025-10-08 16:25:06 +01:00
Jeremiah Russell
c81cd6d6cc feat(config): add delete flag for retention rules
- allow retention rules to be configured to delete messages
- add `delete` flag to `add_rule` function
- add `set_command` function to `EolRule` to set the action to delete
2025-10-08 12:20:34 +01:00
Jeremiah Russell
cf3d93cf13 feat(config): add support for labels to retention rules
- allow associating labels with retention rules for more granular control
- add label parameter to `add_rule` function
- check for duplicate rules and labels before adding new ones
2025-10-08 11:40:55 +01:00
Jeremiah Russell
7610f2a9dc feat(config): enhance rule management with BTreeMap
- migrate rules from Vec to BTreeMap for efficient access
- add rule existence check to prevent duplicates
- improve rule listing by iterating over values
2025-10-08 10:39:38 +01:00
Jeremiah Russell
c1e42dfa50 feat(config): add result type to list_rules function
- modify list_rules to return a Result type
- allows for error handling during rule listing
2025-10-08 07:56:41 +01:00
Jeremiah Russell
6ef1a337a2 feat(config): add function to list rules
- implement list_rules function in Config struct
- iterate through rules and print each rule
2025-10-08 06:42:29 +01:00
Jeremiah Russell
050f00940b feat(config): implement configuration file management
- add config.rs to handle program configuration
- create default configuration with retention rules
- implement save and load functions for persistent storage
- add credential file setting
2025-10-07 15:59:18 +01:00