~singpolyma/jmp-schemas

ref: a855f8fc525133e6be89f121f9f4d2376ed59dd4 jmp-schemas/sqitch.plan -rw-r--r-- 3.7 KiB
a855f8fcStephen Paul Weber invites.rewarded_at 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%syntax-version=1.0.0
%project=jmp

transactions 2021-02-22T19:15:25Z Stephen Paul Weber <singpolyma@singpolyma.net> # Creates a table to track user's transactions
balances 2021-02-23T15:08:09Z Stephen Paul Weber <singpolyma@singpolyma.net> # Creates a view to lookup customer balances
sub_cent_transactions 2021-02-24T01:37:35Z Stephen Paul Weber <singpolyma@singpolyma.net> # Minutes cost less than 1 cent, so we need more decimal places
plan_log 2021-02-24T01:53:29Z Stephen Paul Weber <singpolyma@singpolyma.net> # Log to show what plans an account has had
customer_plans 2021-02-24T02:06:25Z Stephen Paul Weber <singpolyma@singpolyma.net> # View of current customer plans
cdr 2021-02-24T18:36:49Z Stephen Paul Weber <singpolyma@singpolyma.net> # Create CDR table for Asterisk
@2021062 2021-03-03T14:38:01Z Stephen Paul Weber <singpolyma@singpolyma.net> # First production deploy of jmp-pay

plan_log_with_range [plan_log customer_plans] 2021-05-03T19:30:36Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Switch plan_log to use a tsrange
@2021130 2021-05-11T01:37:34Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Deploy to production

invites 2021-05-17T20:31:00Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Table to store invite codes and their state
unused_invites 2021-05-17T20:40:20Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # View for invites not yet used
invite_per_15 [transactions invites] 2021-08-18T17:46:38Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # $15 gives you an invite code
call_rates 2021-11-17T01:29:07Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Table to store per-plan per-direction rates to different prefixes
cdr_with_charge [cdr call_rates customer_plans] 2021-11-17T01:44:14Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # View to get CDR records augmented with rate and charge amount
plans 2021-11-17T18:06:30Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Table for plan metadata\n\nIdeally this would come from a dhall_fdw, but for now we can import to this.
customers 2021-11-30T16:36:48Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Get customers from Redis\n\nRequires a redis_server to be configured on the postgres instance.
cdr_charge [customer_plans plans cdr_with_charge] 2021-11-17T18:09:49Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Get the amount to charge a customer for a given CDR
insert_charge_for_cdr [cdr_charge cdr_with_charge transactions] 2021-11-23T14:41:15Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Trigger to insert a transaction for the charge for this CDR
notify_low_balance [transactions balances] 2021-12-22T00:36:03Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # NOTIFY when balance dips low
@2022039 2022-02-08T15:35:37Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Call limits and billing rollout

cdr_with_charge_faster [cdr_with_charge] 2022-02-08T17:12:16Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Allow Postgres to push down WHERE over customer_id
@2022039.1 2022-02-08T17:16:11Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Fix for cdr_with_charge performance

cdr_with_charge_rate_when_no_plan [cdr_with_charge_faster] 2022-02-09T01:55:13Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Get a default rate when customer has no plan
@2022040 2022-02-09T16:08:26Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Default rate for customers with no plan

invites_rewarded_at [invites] 2022-02-22T16:54:33Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Add rewarded_at to invites so we can track rewards\n\nNeed this because we don't reward right at use, but later after they have paid.
@2022075 2022-03-16T14:08:42Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # invites.rewarded_at