Commit Graph

19 Commits

Author SHA1 Message Date
Jeremiah Russell
81157e6ce9 feat(config): add date calculation for EOL queries
- introduce calculate_for_date function to allow EOL query generation for specific dates
- add test cases for EOL query generation with different time spans
2025-10-11 09:35:12 +01:00
Jeremiah Russell
c25f925373 📝 docs(config): fix typo in EolRule::describe documentation
- fix typo "peformed" to "performed" in the documentation for the `EolRule::describe` function
2025-10-11 09:35:12 +01:00
Jeremiah Russell
d48abdc3ad feat(config): add retention period to eol rule
- add retention functionality to EolRule
- parse retention string to calculate EOL deadline
- generate 'before:' query based on retention period
2025-10-11 09:35:12 +01:00
Jeremiah Russell
66edab897f feat(config): add eol query function
- add `eol_query` function to `EolRule` struct
- function returns a string with the current date formatted as "YYYY-MM-DD"
2025-10-11 09:35:12 +01:00
Jeremiah Russell
04308dbbef 📝 docs(config): document labels function in EolRule
- add documentation for the labels function in the EolRule struct
2025-10-11 09:35:12 +01:00
Jeremiah Russell
e291eaf001 feat(eol_rule): add describe function for eol rule
- add describe function to report the action
- improve code readability
2025-10-11 09:35:12 +01:00
Jeremiah Russell
40ea9e52f4 ♻️ refactor(cli): rename command to sub_command for clarity
- rename `command` field to `sub_command` in `Cli` and `ConfigCli` structs
- rename `Commands` enum to `SubCmds` to reflect its role as subcommand
- update references to the renamed fields and enum variants
- this improves code readability and avoids confusion with other command concepts

🐛 fix(config): correct method name for setting eol action

- rename `set_command` to `set_action` in `EolRule` struct
- update references in `config.rs` to use the correct method name
- this fixes a bug where the eol action was not being set correctly
2025-10-09 14:30:21 +01:00
Jeremiah Russell
992e62f0c9 🐛 fix(config): correct typo in eol_cmd module name
- fix a typo in the module name from `eol_cmd` to `eol_action`
- update the `set_command` function to accept a reference to `EolAction`
2025-10-09 14:12:41 +01:00
Jeremiah Russell
b9fec9a064 🐛 fix(eol_rule): correct grammar in rule descriptions
- improve clarity and grammatical correctness of EolRule descriptions
- use backticks for retention values for better readability
2025-10-09 13:00:18 +01:00
Jeremiah Russell
02d7a49f31 🐛 fix(config): correct grammar in EolRule display
- fix grammar error in EolRule display implementation
2025-10-09 13:00:18 +01:00
Jeremiah Russell
adc50f63a2 ♻️ refactor(config): make EolRule fields public
- make EolRule fields public for external access
2025-10-09 09:53:09 +01:00
Jeremiah Russell
6df0ef6536 ♻️ refactor(config): enhance EolRule for label management
- migrate labels from Vec to BTreeSet for uniqueness and order
- add `remove_label` function to remove specific labels
- change `labels()` function return type from `&Vec<String>` to `Vec<String>`
- implement `Clone` trait for `EolRule`
2025-10-08 16:25:06 +01:00
Jeremiah Russell
b47629d076 🐛 fix(eol_rule): correct rule description in to_string method
- fix the inaccurate description in the `to_string` method for `EolRule`
- correct the description to properly display that the rule moves the message to trash
2025-10-08 12:20:34 +01:00
Jeremiah Russell
5096fd2b19 ♻️ refactor(config): rename EolCmd to EolAction for clarity
- rename `command` field in `EolRule` to `action`
- update `set_command` method to use `EolAction` enum
- adjust display formatting to reflect the change to "action"
2025-10-08 12:20:34 +01:00
Jeremiah Russell
432c1635af feat(config): add labels method to EolRule
- add `labels` method to `EolRule` to access labels vector
2025-10-08 11:40:55 +01:00
Jeremiah Russell
5c42c0f66d feat(config): add retention attribute to EolRule
- introduce retention attribute in EolRule struct
- implement getter method for accessing retention value
2025-10-08 10:39:38 +01:00
Jeremiah Russell
6b1dedc10a 🐛 fix(config): correct pluralization of time periods in EolRule display
- fix pluralization logic for day, week, month, and year
- avoid redundant match arms by pushing 's' when count > 1
2025-10-08 06:42:29 +01:00
Jeremiah Russell
9e547b62e7 feat(config): implement display for eolrule struct
- add display trait implementation for eolrule struct to provide a user-friendly representation of the rule's configuration
- the display format includes the rule id, labels, and retention period, making it easier to understand the rule's settings
2025-10-08 06:42:29 +01:00
Jeremiah Russell
e77b372413 feat(config): add EolRule struct for managing end-of-life rules
- introduce EolRule struct with fields for id, retention, labels, query, and command
- implement methods for creating new rules, setting retention, and adding labels
- add default implementation for EolRule
2025-10-07 15:59:18 +01:00