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:
@@ -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;
|
||||
"#;
|
||||
|
||||
Reference in New Issue
Block a user