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 96d0e0f51c

View file

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