Skip to content

Commit 518681c

Browse files
Merge pull request #175 from killbill/reports-cleanup
Reports cleanup
2 parents b27bd3d + 8917f8f commit 518681c

199 files changed

Lines changed: 2796 additions & 3978 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.

.idea/misc.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reports/README.md

Lines changed: 152 additions & 0 deletions
Large diffs are not rendered by default.

reports/accounts_summary/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Accounts summary report
1+
# Accounts Summary Report
22

33
Provides an account summary. Provides details like account balance, account status, currency, etc.
44

55
The snapshot view is: `v_report_accounts_summary`
66

7-
## Pie chart configuration
7+
## Report Creation
88

99
```
1010
curl -v \
@@ -15,9 +15,15 @@ curl -v \
1515
-H 'Content-Type: application/json' \
1616
-d '{"reportName": "report_accounts_summary",
1717
"reportType": "TABLE",
18-
"reportPrettyName": "Accounts summary",
18+
"reportPrettyName": "Accounts Summary",
1919
"sourceTableName": "report_accounts_summary",
2020
"refreshProcedureName": "refresh_report_accounts_summary",
2121
"refreshFrequency": "HOURLY"}' \
2222
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
2323
```
24+
25+
## Report UI:
26+
27+
![accounts-summary.png](accounts-summary.png)
28+
29+
273 KB
Loading

reports/accounts_summary/v_report_account_summary.ddl renamed to reports/accounts_summary/v_report_accounts_summary.ddl

File renamed without changes.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Monthly Active Subscriptions Report
2+
3+
Compute (at the end of each month) the total number of active subscriptions per product and billing period.
4+
5+
The snapshot view is: `v_report_active_by_product_term_monthly`
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_active_by_product_term_monthly",
17+
"reportType": "TIMELINE",
18+
"reportPrettyName": "Monthly Active Subscriptions by Product Term",
19+
"sourceTableName": "report_active_by_product_term_monthly",
20+
"refreshProcedureName": "refresh_active_by_product_term_monthly",
21+
"refreshFrequency": "HOURLY"}' \
22+
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
23+
```
24+
## Sample Data
25+
26+
| tenant_record_id | day | product_name | billing_period | count |
27+
|------------------|------------|--------------|----------------|-------|
28+
| 1 | 2025-08-31 | Gold | MONTHLY | 3 |
29+
| 2 | 2025-08-31 | Gold | MONTHLY | 1 |
30+
| 1 | 2025-08-31 | Gold | ANNUAL | 2 |
31+
| 2 | 2025-09-30 | Silver | MONTHLY | 4 |
32+
| 2 | 2025-09-30 | Gold | QUARTERLY | 1 |
33+
34+
The first row in the above table indicates that on `2025-08-31` the `tenant_record_id=1` had 3 Monthly subscriptions for the `Gold` product.
35+
36+
37+
38+
## Report UI:
39+
40+
![monthly-active-subs-by-product-term.png](monthly-active-subs-by-product-term.png)
176 KB
Loading

src/main/resources/reports/active_by_product_term_monthly/report_active_by_product_term_monthly.ddl renamed to reports/active_by_product_term_monthly/report_active_by_product_term_monthly.ddl

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,7 @@ DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;
1111
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
1212
START TRANSACTION;
1313
delete from report_active_by_product_term_monthly;
14-
insert into report_active_by_product_term_monthly
15-
select
16-
x.tenant_record_id
17-
, cal.d day
18-
, x.product_name
19-
, x.billing_period
20-
, x.count
21-
from calendar cal
22-
join (
23-
select
24-
tenant_record_id
25-
, last_day(day) day
26-
, product_name
27-
, billing_period
28-
, count
29-
from
30-
v_report_active_by_product_term_monthly
31-
where 1=1
32-
) x on last_day(cal.d) = x.day
33-
where 1=1
34-
;
14+
insert into report_active_by_product_term_monthly select * from v_report_active_by_product_term_monthly;
3515
COMMIT;
3616

3717
END;

src/main/resources/reports/active_by_product_term_monthly/v_report_active_by_product_term_monthly.ddl renamed to reports/active_by_product_term_monthly/v_report_active_by_product_term_monthly.ddl

File renamed without changes.

reports/bundles_summary/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Provides a subscription bundle summary. Provides details like CTD, plan name, pr
44

55
The snapshot view is: `v_report_bundles_summary`
66

7-
## Pie chart configuration
7+
## Report Creation
88

99
```
1010
curl -v \
@@ -15,9 +15,13 @@ curl -v \
1515
-H 'Content-Type: application/json' \
1616
-d '{"reportName": "report_bundles_summary",
1717
"reportType": "TABLE",
18-
"reportPrettyName": "Bundles summary",
18+
"reportPrettyName": "Bundles Summary",
1919
"sourceTableName": "report_bundles_summary",
2020
"refreshProcedureName": "refresh_report_bundles_summary",
2121
"refreshFrequency": "HOURLY"}' \
2222
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
2323
```
24+
25+
## Report UI:
26+
27+
![bundles-summary.png](bundles-summary.png)

0 commit comments

Comments
 (0)