Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
495441d
report corrections - daily cancellations/active by product term
reshmabidikar Sep 18, 2025
4e70d98
report corrections - invoice balance daily
reshmabidikar Sep 18, 2025
5cdd1dd
report corrections - invoice amount daily
reshmabidikar Sep 18, 2025
35ae02c
report corrections - daily new accounts
reshmabidikar Sep 18, 2025
f7738ae
Merge remote-tracking branch 'origin/master' into work-for-ts-54
reshmabidikar Sep 18, 2025
f7a24d8
report corrections - refunds total daily
reshmabidikar Sep 18, 2025
c042574
report corrections - conversions dollar amount
reshmabidikar Sep 19, 2025
aac8cca
report corrections - daily MRR
reshmabidikar Sep 19, 2025
26c97a1
report corrections - daily payments value
reshmabidikar Sep 19, 2025
8f5ca49
report corrections - payments total daily - fix image
reshmabidikar Sep 19, 2025
ad91907
Merge pull request #170 from reshmabidikar/work-for-ts-54
pierre Sep 19, 2025
815e945
Move report views to separate directories and add documentation
reshmabidikar Sep 23, 2025
a980896
Delete sanity and system reports
reshmabidikar Sep 23, 2025
c56d7cb
Merge pull request #171 from reshmabidikar/work-for-ts-54
reshmabidikar Sep 23, 2025
82a6546
Reports from extracts/finance
reshmabidikar Sep 24, 2025
230c04e
Reports from extracts/finance
reshmabidikar Sep 24, 2025
b69227f
Corrections to reports
reshmabidikar Sep 25, 2025
5368ca2
delete invoice adjustments monthly
reshmabidikar Sep 25, 2025
15b6829
Move all reports to top level reports directory
reshmabidikar Sep 26, 2025
276fd1b
minor corrections to Readme files
reshmabidikar Sep 26, 2025
6cfa74c
Use Hourly refresh frequency, add sample data to Readme
reshmabidikar Sep 26, 2025
4f09f03
use original columns instead of the converted_xxx columns
reshmabidikar Sep 26, 2025
b1b1147
Merge pull request #172 from reshmabidikar/work-for-ts-54
pierre Sep 26, 2025
5ec323a
Fix seeds-report.sh, add readme for it
reshmabidikar Sep 29, 2025
553010b
Delete src/main/resources/README and update reports/README with accur…
reshmabidikar Sep 29, 2025
fe5a439
Moved payment related complex reports to top reports directory
reshmabidikar Oct 1, 2025
e9ff138
Additional reports from AWS
reshmabidikar Oct 1, 2025
1509014
Merge pull request #173 from reshmabidikar/work-for-ts-54-2
pierre Oct 1, 2025
bc0d98d
Merge remote-tracking branch 'upstream/reports-cleanup' into work-for…
reshmabidikar Oct 1, 2025
1bcccd5
Improvements to README
reshmabidikar Oct 3, 2025
8917f8f
Merge pull request #174 from reshmabidikar/work-for-ts-54-3
reshmabidikar Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

152 changes: 152 additions & 0 deletions reports/README.md

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions reports/accounts_summary/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Accounts summary report
# Accounts Summary Report

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

The snapshot view is: `v_report_accounts_summary`

## Pie chart configuration
## Report Creation

```
curl -v \
Expand All @@ -15,9 +15,15 @@ curl -v \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_accounts_summary",
"reportType": "TABLE",
"reportPrettyName": "Accounts summary",
"reportPrettyName": "Accounts Summary",
"sourceTableName": "report_accounts_summary",
"refreshProcedureName": "refresh_report_accounts_summary",
"refreshFrequency": "HOURLY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```

## Report UI:

![accounts-summary.png](accounts-summary.png)


Binary file added reports/accounts_summary/accounts-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions reports/active_by_product_term_monthly/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Monthly Active Subscriptions Report

Compute (at the end of each month) the total number of active subscriptions per product and billing period.

The snapshot view is: `v_report_active_by_product_term_monthly`

## Report Creation

```
curl -v \
-X POST \
-u admin:password \
-H "X-Killbill-ApiKey:bob" \
-H "X-Killbill-ApiSecret:lazar" \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_active_by_product_term_monthly",
"reportType": "TIMELINE",
"reportPrettyName": "Monthly Active Subscriptions by Product Term",
"sourceTableName": "report_active_by_product_term_monthly",
"refreshProcedureName": "refresh_active_by_product_term_monthly",
"refreshFrequency": "HOURLY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```
## Sample Data

| tenant_record_id | day | product_name | billing_period | count |
|------------------|------------|--------------|----------------|-------|
| 1 | 2025-08-31 | Gold | MONTHLY | 3 |
| 2 | 2025-08-31 | Gold | MONTHLY | 1 |
| 1 | 2025-08-31 | Gold | ANNUAL | 2 |
| 2 | 2025-09-30 | Silver | MONTHLY | 4 |
| 2 | 2025-09-30 | Gold | QUARTERLY | 1 |

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.



## Report UI:

![monthly-active-subs-by-product-term.png](monthly-active-subs-by-product-term.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,7 @@ DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION;
delete from report_active_by_product_term_monthly;
insert into report_active_by_product_term_monthly
select
x.tenant_record_id
, cal.d day
, x.product_name
, x.billing_period
, x.count
from calendar cal
join (
select
tenant_record_id
, last_day(day) day
, product_name
, billing_period
, count
from
v_report_active_by_product_term_monthly
where 1=1
) x on last_day(cal.d) = x.day
where 1=1
;
insert into report_active_by_product_term_monthly select * from v_report_active_by_product_term_monthly;
COMMIT;

END;
Expand Down
8 changes: 6 additions & 2 deletions reports/bundles_summary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides a subscription bundle summary. Provides details like CTD, plan name, pr

The snapshot view is: `v_report_bundles_summary`

## Pie chart configuration
## Report Creation

```
curl -v \
Expand All @@ -15,9 +15,13 @@ curl -v \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_bundles_summary",
"reportType": "TABLE",
"reportPrettyName": "Bundles summary",
"reportPrettyName": "Bundles Summary",
"sourceTableName": "report_bundles_summary",
"refreshProcedureName": "refresh_report_bundles_summary",
"refreshFrequency": "HOURLY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```

## Report UI:

![bundles-summary.png](bundles-summary.png)
Binary file added reports/bundles_summary/bundles-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions reports/cancellations_daily/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Daily Cancellations Report

Compute the total number of cancellations per day per phase.

The snapshot view is: `v_report_cancellations_daily`

## Report Creation

```
curl -v \
-X POST \
-u admin:password \
-H "X-Killbill-ApiKey:bob" \
-H "X-Killbill-ApiSecret:lazar" \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_cancellations_daily",
"reportType": "TIMELINE",
"reportPrettyName": "Daily Cancellations",
"sourceTableName": "report_cancellations_daily",
"refreshProcedureName": "refresh_report_cancellations_daily",
"refreshFrequency": "HOURLY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```
## Sample Data

| tenant_record_id | phase | day | count |
|------------------|-----------|------------|-------|
| 1 | EVERGREEN | 2025-09-10 | 9 |
| 1 | EVERGREEN | 2025-09-03 | 2 |
| 1 | EVERGREEN | 2025-09-22 | 5 |
| 2 | EVERGREEN | 2025-09-23 | 6 |
| 2 | EVERGREEN | 2025-09-24 | 6 |
| 1 | EVERGREEN | 2025-09-25 | 1 |

The first row in the above table indicates that on `2025-09-10`, the `tenant_record_id=1` had 9 cancellations in `EVERGREEN` phase.

## Report UI:

![daily-cancellations.png](daily-cancellations.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions reports/chargebacks_daily/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Daily Chargebacks Report

Compute the total value (in the reference currency) of chargebacks per day per currency.

The snapshot view is: `v_report_chargebacks_daily`

## Report Creation

```
curl -v \
-X POST \
-u admin:password \
-H "X-Killbill-ApiKey:bob" \
-H "X-Killbill-ApiSecret:lazar" \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_chargebacks_daily",
"reportType": "TIMELINE",
"reportPrettyName": "Daily Chargebacks Value",
"sourceTableName": "report_chargebacks_daily",
"refreshProcedureName": "refresh_report_chargebacks_daily",
"refreshFrequency": "HOURLY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```

## Sample Data

| tenant_record_id | day | currency | count |
|------------------|------------|----------|----------|
| 1 | 2025-09-18 | USD | 100.0000 |
| 1 | 2025-09-26 | USD | 50.0000 |
| 2 | 2025-09-11 | USD | 100.0000 |

The first row in the above table indicates that on `2025-09-18`, the `tenant_record_id=1` had a total chargeback value of `$100`


## Report UI:

![chargebacks-daily.png](chargebacks-daily.png)


Binary file added reports/chargebacks_daily/chargebacks-daily.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ select
ac.tenant_record_id
, date_format(ac.created_date,'%Y-%m-%d') as day
, ac.currency
, sum(ac.converted_amount) as count
, sum(ac.amount) as count
from
analytics_payment_chargebacks ac
where 1=1
Expand Down
54 changes: 54 additions & 0 deletions reports/churn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Churn (Monthly and Annual) Report

This report tracks customer churn in dollar terms, showing both the total churned revenue and the churn percentage for monthly and annual subscriptions on a per-tenant, per-month basis.

The snapshot view is: `v_report_churn_percent_and_total_usd`

## Database Indices

The churn reports requires some additional database indices to be created. See [churn-indices.ddl](churn-indices.ddl)

## Churn Percent Configuration

```
curl -v \
-X POST \
-u admin:password \
-H "X-Killbill-ApiKey:bob" \
-H "X-Killbill-ApiSecret:lazar" \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_churn_percent",
"reportType": "TIMELINE",
"reportPrettyName": "Churn Percent (Monthly and Annual)",
"sourceTableName": "report_churn_percent",
"refreshProcedureName": "refresh_report_churn_percent",
"refreshFrequency": "HOURLY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```

## Churn Percentage Report UI

![churn-percent.png.png](churn-percent.png)

## Churn Amount Configuration

```
curl -v \
-X POST \
-u admin:password \
-H "X-Killbill-ApiKey:bob" \
-H "X-Killbill-ApiSecret:lazar" \
-H 'Content-Type: application/json' \
-d '{"reportName": "report_churn_total_usd",
"reportType": "TIMELINE",
"reportPrettyName": "Churn Total USD (Monthly and Annual)",
"sourceTableName": "report_churn_total_usd",
"refreshProcedureName": "refresh_report_churn_total_usd",
"refreshFrequency": "DAILY"}' \
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
```

## Churn Amount Report UI


![churn-amount.png](churn-amount.png)
Binary file added reports/churn/churn-amount.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions reports/churn/churn-indices.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE INDEX idx_ai_tenant_bundle ON analytics_invoice_items(tenant_record_id, bundle_id, invoice_original_amount_charged, invoice_balance);
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);
CREATE INDEX idx_subs_id_tenant ON subscriptions(id, tenant_record_id);
CREATE INDEX idx_se_sub_tenant_type ON subscription_events(subscription_id, tenant_record_id, user_type);
Binary file added reports/churn/churn-percent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions reports/churn/report_churn_percent.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
create table report_churn_percent as select tenant_record_id
, month day, billing_period, churn_pct count from v_report_churn_percent_and_total_usd limit 0;

drop procedure if exists refresh_report_churn_percent;
DELIMITER //
CREATE PROCEDURE refresh_report_churn_percent()
BEGIN

DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION;
delete from report_churn_percent;
insert into report_churn_percent select tenant_record_id
, month day, billing_period, churn_pct count from v_report_churn_percent_and_total_usd;
COMMIT;

END;
//
DELIMITER ;
21 changes: 21 additions & 0 deletions reports/churn/report_churn_total_usd.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
create table report_churn_total_usd as select tenant_record_id
, month day, billing_period, churn_dollars count from v_report_churn_percent_and_total_usd limit 0;

drop procedure if exists refresh_report_churn_total_usd;
DELIMITER //
CREATE PROCEDURE refresh_report_churn_total_usd()
BEGIN

DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION;
delete from report_churn_total_usd;
insert into report_churn_total_usd select tenant_record_id
, month day, billing_period, churn_dollars count from v_report_churn_percent_and_total_usd;
COMMIT;

END;
//
DELIMITER ;
Loading