~singpolyma/jmp-schemas

ref: 395bb7970e7ed5168acc8244eb75746d13e08cfc jmp-schemas/sqitch.plan -rw-r--r-- 4.6 KiB
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
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.
Get customer data from Redis
Insert charge for CDR

Trigger to insert a transaction charging the customer for the amount owed for
an INSERTed CDR.
Function to compute the amount to charge a customer for a given cdr

This takes into account how much of their "included" minute credit has already
been used in the calendar month.
Store plans data in a table

Ideally this would come via FDW, but for now we can easily have a script push to
this table from the source of truth.
Table for call_rates and view to augment CDRs with that data
For every $15 deposited, add one invite code
unused_invites view

View to get all invites not yet used up.
invites table

Table to store invite codes and their status.  Stores who make the code and
when, who used the code (if anyone has used it yet) and when, and the code
itself. Codes are single-use so once used_by_id is set the code cannot be used again.
Next