~singpolyma/jmp-schemas

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
Need redis for CI now
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
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
fix CI

New debian stable doesn't have postgres 11
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.
Hotfix

Creating with a literal stored the time that was 'now' when the view was
created. We want the current time when the view is accessed.
plan_log uses a tsrange instead of two timestamps now

This is honestly just more correct, but also allows for easy checking of
non-overlapping ranges, which we now do.
tag for deploy of jmp-pay to production
Give plan_log a primary key

Can't have two entries starting at the same time
Next