Expand admin-sales-summary with Ultra + products breakdown - #519
Merged
Conversation
Include Ultra Cashier subscriptions plus plugin and first-party product sales (sales_view), with breakdown, by-product rollups, comps, all_time lookback, and notes on price_paid renewal limitations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
admin-sales-summaryso attributable inbound dollars include Ultra (Cashier Max/Ultra) subscriptions, plugin sales, and first-party product sales — not only PluginLicense + Anystack license counts.breakdown,by_product,ultra(active / comped / window revenue),compedcounts,all_time+daysup to 3650, and keepsplugin_license_revenue/top_plugins/ Anystack license fields for compatibility.subscriptions.price_paidis overwritten on invoice paid (renewals do not create rows), matching FilamentSubscriberIncomeChart.Response shape (approx)
{ "days": 30, "all_time": false, "since": "…", "total_revenue_cents": 0, "breakdown": [ { "source": "plugins", "revenue_cents": 0, "sales_count": 0, "currency": "USD" }, { "source": "products", "revenue_cents": 0, "sales_count": 0, "currency": "USD" }, { "source": "ultra_subscriptions", "revenue_cents": 0, "sales_count": 0, "currency": "USD", "caveat": "…" } ], "by_product": [{ "product_name": "…", "source": "plugins|products", "revenue_cents": 0, "sales_count": 0, "currency": "USD" }], "plugin_license_revenue": [{ "currency": "USD", "licenses_count": 0, "revenue_cents": 0 }], "top_plugins": [], "ultra": { "active_count": 0, "active_comped_count": 0, "created_in_window": 0, "paid_created_in_window": 0, "revenue_cents_in_window": 0, "currency": "USD", "caveat": "…" }, "nativephp_licenses_created": [], "active_nativephp_licenses": 0, "comped": { "plugin_count": 0, "product_count": 0, "ultra_active_count": 0 }, "note": "…" }Caveats
price_paidis latest invoice total only; window revenue under-counts renewals.comped.maxis named Ultra and lives on Cashiersubscriptions.Test plan
php artisan test --filter=AdminSalesSummaryTestdays/all_timeagainst staging or local admin OAuth (optional)