~singpolyma/sgx-jmp

ref: 045da39f25b74034e7bba44cb5f1db48a935ba84 sgx-jmp/test d---------
Hotfix: arguments in wrong order
Merge branch 'finish-btc'

* finish-btc:
  No more legacy session for BTC
  Do not lose WebRegisterManager on retart
No more legacy session for BTC

Set the same key as web register manager, so that on next register jmp.chat the
tel we were using in this flow will be used.   Not needed if they came from web
register, but will still extend expiry in that case and no harm.

Clean up pending tel key on Finish.
Do not lose WebRegisterManager on retart

Store web registrations in redis.  Set an expiry so they don't grow in RAM
forever as they previously would have without a restart.
Customer Info

This should allow us, the admins, to query information about a customer
without having to dive in and run a couple redis queries and some
database queries before getting the full picture of who we're talking
to.

It also allows the users to request some data about themselves. Balance and
phone number are already visible in other places, but their expiry is currently
not, and people have been asking about it.
Remove BigDecimal.new

It turns out in newer versions of Ruby this isn't cool anymore.
The new way is BigDecimal(value), which is dumb, but whatever...
Bring in line with the key from billing_monthly_cronjob
Customer always has a JID
Merge branch 'low-balance-auto-top-up'

* low-balance-auto-top-up:
  Some people have exactly 5 who don't need to be told
  On low balance, top-up or notify
  ExpiringLock helper
On low balance, top-up or notify

On start up, check for users with low balance and NOTIFY about them.  LISTEN for
such notifications and process by either sending a low-balance warning message
or else attempting an auto-top-up as configured.

Using NOTIFY/LISTEN because then we can NOTIFY after any INSERT that leaves the
balance too low (using a trigger).  Doing the sync on start-up in case we missed
a NOTIFY during any downtime.  Using the Redis lock to prevent spamming a
low-balance user in case of many restarts or if they have many small
transactions happen in one day.
Merge branch 'command-object'

* command-object:
  ErrorToSend => FinalStanza
  Since Command#finish causes an error, a then off the end won't work
  Refactor commands to have Command and Command::Execution objects
Refactor commands to have Command and Command::Execution objects

Brings the common elements of all commands together, and threads the most useful
state (such as ability to reply) through automatically using the new EMPromise
fiber trampoline.
Ask electrum to notify on new BTC addresses

Otherwise we won't know when someone has paid...
Factor out CustomerRepo

Using the Repository pattern to encapsulate the fetch and create operations on
the persistence layer for a domain object.  These were not really factories in
the classic sense, but rather "fetch from persisitence layer" methods, and so
they now have a home.
Merge branch 'btc_spop'

* btc_spop:
  Get new Bitcoin address from Redis set
Get new Bitcoin address from Redis set

This set is populated by a cron job to have only known-good available addresses
in it.
monthly_price is in 10000ths of a dollar, not 1000ths
No more "choose next"

Instead, adhoc bot will show the options for actions to take
Set catapult_fwd_timeout on our backend-facing JID

Not on our inbound-facing JID.  This is why we shouldn't be mucking in the SGX's
Redis at all...
Next