~singpolyma/jmp-pay

ref: 68ed9c34b0d4a2eaa0e49def372deabe4eb55daf jmp-pay/lib/auto_top_up_repo.rb -rw-r--r-- 714 bytes
Check for low balance when setting auto top up

People expect to be able to set their auto top up setting in response to a low
balance alert, and have this solve the problem instantly.  This change resets
the lock that prevents sgx-jmp from acting on a low_balance notification, and
then asks the database to check if the balance is low and issue a notify if
relevant, which would then result in sgx-jmp acting and charging their card at
the newly-configured level.
Factor out AutoTopUpRepo and add tests