[ledger] Goals and challenges: goal.created/changed/ways_set/saved/closed and challenge.started/abandoned, with their checks; v0.6.0

This commit is contained in:
2026-11-07 22:39:54 +01:00
parent 2e8eee6007
commit c3cb1dd060
9 changed files with 467 additions and 7 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ pub fn merchant_key(raw: &str) -> String {
let folded: String = raw.chars().flat_map(fold).collect::<String>().to_lowercase();
// A processor's prefix before `*`: "paypal *spotify", "sumup *kavarna", "sq *bistro".
let rest = match folded.split_once('*') {
Some((head, tail)) if !tail.trim().is_empty() && head.trim().split_whitespace().count() <= 2 => tail,
Some((head, tail)) if !tail.trim().is_empty() && head.split_whitespace().count() <= 2 => tail,
_ => folded.as_str(),
};
let cleaned: String = rest.chars().map(|c| if c.is_ascii_alphanumeric() { c } else { ' ' }).collect();