Commit Graph

6 Commits

Author SHA1 Message Date
Jeremiah Russell
051507856a feat(retention): enhance message age with parsing and validation
- add `TryFrom<&str>` implementation for `MessageAge`
  - allows creating `MessageAge` from string slices
  - returns `Error` for invalid formats
- improve `MessageAge::new` to return a `Result`
  - changes error type to `Error` enum
- add `Error::InvalidMessageAge` for specific message age errors
- mark `MessageAge::parse` and other methods as `must_use`
- use byte string literals for character matching in `parse`
- update error messages to include the invalid input value
- add `#[derive(Hash)]` to `MessageAge`
2025-10-19 07:54:12 +01:00
Jeremiah Russell
c40e4dfa86 feat(retention): introduce message age specification
- introduces `MessageAge` enum to represent retention periods
- supports days, weeks, months, and years
- adds parsing and formatting for `MessageAge` instances
- includes label generation for categorization
2025-10-19 07:54:12 +01:00
Jeremiah Russell
49e7ff5617 🐛 fix(message_age): correct data type for message age count
- change the data type of count from usize to i64 to allow negative values
- add parse method to parse message age from string
2025-10-11 09:35:12 +01:00
Jeremiah Russell
7b08bfe13a feat(retention): add message age enum creation
- implement `new` function for MessageAge enum
- allow creating MessageAge from string period and count
2025-10-08 07:56:41 +01:00
Jeremiah Russell
90383226aa 🐛 fix(message_age): correct retention label formatting
- fix format string for weeks, months and years
2025-10-08 06:42:29 +01:00
Jeremiah Russell
17dc58c4a7 feat(retention): introduce message age enum
- add MessageAge enum to represent retention periods in days, weeks, months, or years
- implement Display trait for MessageAge to format retention periods
- implement label function to generate retention label
2025-10-07 15:59:18 +01:00