%syntax-version=1.0.0 %project=jmp transactions 2021-02-22T19:15:25Z Stephen Paul Weber # Creates a table to track user's transactions balances 2021-02-23T15:08:09Z Stephen Paul Weber # Creates a view to lookup customer balances sub_cent_transactions 2021-02-24T01:37:35Z Stephen Paul Weber # Minutes cost less than 1 cent, so we need more decimal places plan_log 2021-02-24T01:53:29Z Stephen Paul Weber # Log to show what plans an account has had customer_plans 2021-02-24T02:06:25Z Stephen Paul Weber # View of current customer plans cdr 2021-02-24T18:36:49Z Stephen Paul Weber # Create CDR table for Asterisk @2021062 2021-03-03T14:38:01Z Stephen Paul Weber # First production deploy of jmp-pay plan_log_with_range [plan_log customer_plans] 2021-05-03T19:30:36Z Stephen Paul Weber,,, # Switch plan_log to use a tsrange @2021130 2021-05-11T01:37:34Z Stephen Paul Weber,,, # Deploy to production invites 2021-05-17T20:31:00Z Stephen Paul Weber,,, # Table to store invite codes and their state unused_invites 2021-05-17T20:40:20Z Stephen Paul Weber,,, # View for invites not yet used invite_per_15 [transactions invites] 2021-08-18T17:46:38Z Stephen Paul Weber,,, # $15 gives you an invite code call_rates 2021-11-17T01:29:07Z Stephen Paul Weber,,, # 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,,, # View to get CDR records augmented with rate and charge amount plans 2021-11-17T18:06:30Z Stephen Paul Weber,,, # 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,,, # 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,,, # 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,,, # Trigger to insert a transaction for the charge for this CDR notify_low_balance [transactions balances] 2021-12-22T00:36:03Z Stephen Paul Weber,,, # NOTIFY when balance dips low @2022039 2022-02-08T15:35:37Z Stephen Paul Weber,,, # Call limits and billing rollout cdr_with_charge_faster [cdr_with_charge] 2022-02-08T17:12:16Z Stephen Paul Weber,,, # Allow Postgres to push down WHERE over customer_id @2022039.1 2022-02-08T17:16:11Z Stephen Paul Weber,,, # 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,,, # Get a default rate when customer has no plan @2022040 2022-02-09T16:08:26Z Stephen Paul Weber,,, # Default rate for customers with no plan invites_rewarded_at [invites] 2022-02-22T16:54:33Z Stephen Paul Weber,,, # 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,,, # invites.rewarded_at settled_after [transactions] 2022-04-11T17:34:18Z Stephen Paul Weber,,, # Consider transactions settled after some time @2022102 2022-04-12T17:47:32Z Stephen Paul Weber,,, # Add settled_after to transactions require_settled_after [settled_after insert_charge_for_cdr] 2022-04-12T18:45:50Z Stephen Paul Weber,,, # Make sure settled_after is NOT NULL @2022103 2022-04-13T15:05:58Z Stephen Paul Weber,,, # Tag settled_after NOT NULL notify_possible_renewal_on_expired_top_up [transactions customer_plans] 2022-04-19T17:53:50Z Stephen Paul Weber,,, # When an expired customer tops up, notify to try renewal @2022110 2022-04-20T20:48:20Z Stephen Paul Weber,,, # Notify when an expired customer tops up