Tag multi account billing
Multi-account billing schema
Add parent_customer_id to plan_log
customer_plans view includes this new column
balances shows parent balance if there is a parent (non recursive)
INSERT INTO transactions inserts for parent if there is one (non recursive)
NOTIFY possible_renewal for self and all expired children
Tag for notify on top up an expired account
Maybe renew a customer when they top up
If they are expired and they top up, ask sgx-jmp to check if they and registered
and bill/renew them.
Tag settled_after NOT NULL
Require settled_after to be NOT NULL
Sqitch tag for settled_after
Add settled_after to transactions table
Tag for default rate for customers with no plan
Customer with no plan gets highest matching rate
Since we don't know their plan, be safe and pick the highest rate. This means
we can still get a sense of Transitional users' usage instead of not knowing at all.
Fix for cdr_with_charge performance
Call limits and billing rollout tag
Allow check_and_notify_low_balance to be called outside of trigger
For use from, eg, jmp-pay
NOTIFY on low balance
This will be picked up by the LISTEN in sgx-jmp to auto-top-up or notify the
customer of low balance.
Do not charge for voicemail
Do not bill over user limit without consent
If the user has no configured limit in Redis, limit is 0
If the CDR would cost less than their limit, bill normally
If they have already spent more than within buffer of their limit, bill normally
Else, bill only enough to get up to their limit