sgx-jmp/lib/customer.rb -rw-r--r-- 3.4 KiB
Optional alternate transcription with rev.ai

The bitfield bit 1 was used by a different project (sgx-catapult, see:
This other project no longer uses the bit, and in fact that whole project is
dead and gone, but if you previously ran that project against the same redis
that you now run this project against then please make sure you have zeroed-out
that bit first.

You can verify using this script:

    redis = Redis.new
    redis.keys("catapult_settings_flags-*").each do |k|
      p redis.getbit(k, 1)
Merge branch 'cancel-account'

* cancel-account:
  Admin command to cancel customer
  Move Customer factory/extractor to Customer
Admin command to cancel customer

Notify customer
Deregister from SGX
Deregister from Cheogram
Disconnect from Bandwidth
	If on special list, move intead of disconnect
Move Customer factory/extractor to Customer

The repo's job is to get the data, constructing the object can be a factory's job.
Merge branch 'more-admin-info'

* more-admin-info:
  Test Admin Info with Numbers
  Refetch Customer on Repeated Customer Info Calls
  Trust Level in Customer Info
  Show Callability State in Customer Info
  No Settled Transactions is 0, not Null
Trust Level in Customer Info

We have this thing, so we should probably be able to see it
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
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.
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
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.
Merge branch 'tx-list'

* tx-list:
  Admin Command Menu + Admin Financial View
  Transactions List
  Customer Financials
  Telephone Link
Customer Financials

I've pulled out information about payment methods and bitcoin into its
own thing. It's kind of a repository, except that it only exposes
fetchers and doesn't load anything generally.

There's also a few new methods here that aren't used yet, but will be
Try auto top up / low balance notify when not enough balance for a call

There is an edge case where a customer might not have auto-topped up yet but
they don't have enough balance for this call, so try to charge their card first
before telling them the call is a no go.
Represent plan limit details as a useful object
Merge branch 'overage-limit'

* overage-limit:
  auto_top_up_amount and monthly_overage_limit from CustomerRepo
  Move Bandwidth Tn remote operations to BandwidthTnRepo
  Use value_semantics to DRY up CustomerRepo
  Use NotFound exception for all customer not found cases
auto_top_up_amount and monthly_overage_limit from CustomerRepo

Move load of auto_top_up_amount to the repo, and load monthly_overage_limit in
the same operation.
Move Bandwidth Tn remote operations to BandwidthTnRepo
Customer Info Forms and More Info

There's a bit extra info I wanted about users, so since I was doing this
anyway I figured I may as well port the existing forms to the new form

Then, in order to fit within the guidelines I needed subforms, so
partials were added.
Show CNAM in customer info
Merge branch 'rubocop'

* rubocop:
  Additional fixes for rubocop 1.10.1
  Switch to rubocop 0.89.1