Skip to content

Commit fe5a439

Browse files
committed
Moved payment related complex reports to top reports directory
1 parent 553010b commit fe5a439

45 files changed

Lines changed: 556 additions & 512 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

reports/README.md

Lines changed: 36 additions & 29 deletions
Large diffs are not rendered by default.

src/main/resources/reports/churn/README.md renamed to reports/churn/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This report tracks customer churn in dollar terms, showing both the total churne
44

55
The snapshot view is: `v_report_churn_percent_and_total_usd`
66

7+
## Database Indices
8+
9+
The churn reports requires some additional database indices to be created. See [churn-indices.ddl](churn-indices.ddl)
10+
711
## Churn Percent Configuration
812

913
```
@@ -18,13 +22,13 @@ curl -v \
1822
"reportPrettyName": "Churn Percent (Monthly and Annual)",
1923
"sourceTableName": "report_churn_percent",
2024
"refreshProcedureName": "refresh_report_churn_percent",
21-
"refreshFrequency": "DAILY"}' \
25+
"refreshFrequency": "HOURLY"}' \
2226
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
2327
```
2428

2529
## Churn Percentage Report UI
2630

27-
31+
![churn-percent.png.png](churn-percent.png)
2832

2933
## Churn Amount Configuration
3034

@@ -47,3 +51,4 @@ curl -v \
4751
## Churn Amount Report UI
4852

4953

54+
![churn-amount.png](churn-amount.png)

reports/churn/churn-amount.png

112 KB
Loading

reports/churn/churn-indices.ddl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CREATE INDEX idx_ai_tenant_bundle ON analytics_invoice_items(tenant_record_id, bundle_id, invoice_original_amount_charged, invoice_balance);
2+
CREATE INDEX idx_ast_bundle_tenant_event ON analytics_subscription_transitions(bundle_id, tenant_record_id, event, next_start_date, next_end_date, next_billing_period);
3+
CREATE INDEX idx_subs_id_tenant ON subscriptions(id, tenant_record_id);
4+
CREATE INDEX idx_se_sub_tenant_type ON subscription_events(subscription_id, tenant_record_id, user_type);

reports/churn/churn-percent.png

110 KB
Loading
File renamed without changes.
File renamed without changes.

src/main/resources/reports/churn/v_report_churn_percent_and_total_usd.ddl renamed to reports/churn/v_report_churn_percent_and_total_usd.ddl

File renamed without changes.

src/main/resources/reports/payment_provider_conversion/README.md renamed to reports/payment_provider_conversions/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Payment Provider Conversion report
22

3-
Compare the total number of transactions and the number of successful transactions that have occurred in a recent 15 minutes
4-
period to the same metrics that occurred in the corresponding 15 minutes from 14 days ago.
3+
Compare the total number of transactions and the number of successful transactions that have occurred in a recent 15 minutes period to the same metrics that occurred in the corresponding 15 minutes from 14 days ago.
54

65
The snapshot view is: `v_report_payment_provider_conversion`.
76

8-
## History table configuration
7+
## Report Creation
98

109
```
1110
curl -v \
@@ -17,8 +16,8 @@ curl -v \
1716
-d '{"reportName": "report_payment_provider_conversion",
1817
"reportType": "TABLE",
1918
"reportPrettyName": "Payment Provider Conversion",
20-
"sourceTableName": "report_payment_provider_conversion_history",
21-
"refreshProcedureName": "refresh_report_payment_provider_conversion_history",
19+
"sourceTableName": "report_payment_provider_conversion",
20+
"refreshProcedureName": "refresh_report_payment_provider_conversion",
2221
"refreshFrequency": "HOURLY"}' \
2322
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
2423
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
create table report_payment_provider_conversion as select * from v_report_payment_provider_conversion limit 0;
2+
3+
drop procedure if exists refresh_report_payment_provider_conversion;
4+
DELIMITER //
5+
CREATE PROCEDURE refresh_report_payment_provider_conversion()
6+
BEGIN
7+
8+
DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
9+
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;
10+
11+
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
12+
insert into report_payment_provider_conversion select * from v_report_payment_provider_conversion;
13+
14+
END;
15+
//
16+
DELIMITER ;

0 commit comments

Comments
 (0)