Enhance money change functionality in EventsWorker: Updated the MoneyChange event effect to include an optional minimum absolute positive value, ensuring that money changes do not result in zero for positive adjustments. Introduced a new SQL query for inserting money history, improving reliability in tracking monetary changes for users.

This commit is contained in:
Torsten Schulz (local)
2026-02-06 07:40:25 +01:00
parent 4baf88b0cf
commit 69dad6854a
2 changed files with 35 additions and 16 deletions

View File

@@ -4,6 +4,11 @@ pub const QUERY_UPDATE_MONEY: &str = r#"
SELECT falukant_data.update_money($1, $2, $3);
"#;
/// Insert in money_history für UI/Verlauf; Betrag als Parameter für zuverlässige Speicherung.
pub const QUERY_INSERT_MONEY_HISTORY: &str = r#"
INSERT INTO falukant_log.money_history (user_id, change, action, created_at) VALUES ($1, $2::numeric, $3, NOW())
"#;
pub const QUERY_GET_MONEY: &str = r#"
SELECT money FROM falukant_data.falukant_user WHERE id = $1;
"#;