~singpolyma/sgx-jmp

TrustLevel{,Repo}

To determine how much permission a customer account should have to take risky
actions.  Seperate from their plan, this is not how much they could do in
theory, but how much the system will allow in practise due to perceived risk.

Starts out with a simple model based on amount of settled payments, and being
used to decide what is an "expensive" route for outbound calls.
Merge branch 'insert-settled-after'

* insert-settled-after:
  Credit card transactions settle after 90 days, bills instantly
Update to schema with settled_after
Merge branch 'bill-with-note'

* bill-with-note:
  Add a note when billing account
Add a note when billing account
Credit card transactions settle after 90 days, bills instantly
Merge branch 'activate-with-balance'

* activate-with-balance:
  If customer already has enough balance, just bill them and finish
  New BillPay registration step
  Save plan to DB as soon as it is selected
  Move credit_to lookup into relevant class
If customer already has enough balance, just bill them and finish
New BillPay registration step

Assumes they have enough balance (anyone using this step must be sure of this)
and then does the billing before proceeding to finish.
Save plan to DB as soon as it is selected

Customer will appear as instantly expired (having been active for 1 second in
the immediate past).

This can replace the pending_plan key for BTC activations. It also serves as a
record for mail-in activation of what plan they had selected.

Once the account is really activated the tiny row is removed.
Move credit_to lookup into relevant class
Merge branch 'monthly-billing'

* monthly-billing:
  Allow the DB to notify us to bill a customer
  Command.execution setter
  Bill plan command
  Clearer name for lock bypass factory
Allow the DB to notify us to bill a customer
Command.execution setter
Bill plan command

Implements the full logic of the billing_monthly_cronjob for one customer by
reusing code that has been written more robustly in sgx-jmp for some time.  This
will allow the cronjob to just execute this command once a day for each expiring
customer to get all the correct billing behaviours.
Clearer name for lock bypass factory
Declines should be an Int

Previously this retured a string and everywhere that used it had to
convert it into an it, or handle it if it's nil.

That's dumb.
Now it's always an int, and `nil.to_i` is 0 anyway so I don't have to
check that either.
Do not allow nil tndetails
LazyObject is not nil, so safenav doesn't work
Next