Skip to content

Commit 8917f8f

Browse files
Merge pull request #174 from reshmabidikar/work-for-ts-54-3
Work for TS 54 (Round 5)
2 parents 1509014 + 1bcccd5 commit 8917f8f

53 files changed

Lines changed: 737 additions & 567 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: 71 additions & 84 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.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Daily New Subscriptions Report
2+
3+
Compute the total amount of new subscriptions created per day for each tenant.
4+
5+
The snapshot view is: `v_report_new_subscriptions_daily`
6+
7+
## Report Creation
8+
9+
```
10+
curl -v \
11+
-X POST \
12+
-u admin:password \
13+
-H "X-Killbill-ApiKey:bob" \
14+
-H "X-Killbill-ApiSecret:lazar" \
15+
-H 'Content-Type: application/json' \
16+
-d '{"reportName": "report_new_subscriptions_daily",
17+
"reportType": "TIMELINE",
18+
"reportPrettyName": "Daily New Subscriptions",
19+
"sourceTableName": "report_new_subscriptions_daily",
20+
"refreshProcedureName": "refresh_report_new_subscriptions_daily",
21+
"refreshFrequency": "HOURLY"}' \
22+
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
23+
```
24+
25+
26+
## Sample Data
27+
28+
| Tenant Record Id | Slug | Day | Count |
29+
|------------------|------------------------------------|------------|-------|
30+
| 1 | blowdart-monthly-notrial-evergreen | 2025-08-20 | 9 |
31+
| 1 | pistol-monthly-notrial-evergreen | 2025-08-20 | 2 |
32+
| 1 | pistol-monthly-notrial-evergreen | 2025-09-01 | 5 |
33+
| 1 | blowdart-monthly-notrial-evergreen | 2025-09-02 | 6 |
34+
| 25 | gold-monthly-notrial-evergreen | 2025-09-02 | 5 |
35+
| 25 | silver-monthly-notrial-evergreen | 2025-09-03 | 6 |
36+
37+
38+
The first row in the above table indicates that on the date `2025-08-20`, the tenant with record id=1 had 9 new subscriptions created.
39+
40+
41+
## Report UI:
42+
43+
44+
![daily-new-subscriptions.png](daily-new-subscriptions.png)
143 KB
Loading

0 commit comments

Comments
 (0)