8
0
Fork 0

bitlair_mqtt: Add hook to publish the amount of cash

This commit is contained in:
polyfloyd 2025-07-06 15:08:07 +02:00
parent be4abcb9dc
commit 8d9b7459a1

View file

@ -17,3 +17,11 @@ sub hook_checkout {
for 1..$entry->quantity;
}
}
sub hook_user_balance {
my ($class, $user, $old, $delta, $new, $transaction_id) = @_;
return if $user != "-cash";
$mqtt->publish("bitlair/bank/cash" => -$new);
}