Skip to content

feat: add financial overview dashboard for conference management#27

Merged
JacobCoffee merged 4 commits intomainfrom
feat/financial-dashboard
Feb 14, 2026
Merged

feat: add financial overview dashboard for conference management#27
JacobCoffee merged 4 commits intomainfrom
feat/financial-dashboard

Conversation

@JacobCoffee
Copy link
Owner

@JacobCoffee JacobCoffee commented Feb 14, 2026

Summary

  • Add comprehensive financial dashboard to management UI
  • Shows revenue summary, order/cart/payment breakdowns, ticket sales analytics
  • Uses Django ORM aggregation for all calculations (no raw SQL)
  • Revenue, refunds, and credits computed accurately (refunds from Credit records, not order totals)
  • Efficient single-query aggregations for order/payment status breakdowns

How to test in the UI

  1. Start the dev server:
    uv run python examples/manage.py migrate
    uv run python examples/manage.py runserver
  2. Log in as a superuser and navigate to the management dashboard
  3. Go to Financial Dashboard at /manage/<conference-slug>/financial/
  4. With no data: verify the dashboard loads cleanly with zero values and "No payments recorded" / empty tables
  5. Create some test data:
    • Add ticket types, create orders (via admin or shell), add payments
    • Create some credits and vouchers
  6. Refresh the financial dashboard and verify:
    • Summary cards: Net Revenue, Total Orders, Active Carts, Credits Outstanding all show correct values
    • Orders by Status: counts match what you created
    • Payments by Method: Stripe/Comp/Credit/Manual breakdown is accurate
    • Ticket Type Sales: sold count, remaining quantity, and revenue per type
    • Recent Orders: last 20 orders listed with correct details
    • Active Carts: open carts with item counts and expiry times

Test plan

  • Dashboard loads with empty data (no 500 errors)
  • Revenue calculations are accurate (net = gross - refunds from credits)
  • Ticket sales show correct sold counts (uses quantity, not line item count)
  • Credits Outstanding shows remaining spendable balance, not total issued
  • Payment breakdowns use efficient single-query aggregation
  • Recent orders limited to 20, sorted by most recent

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 14, 2026 01:08
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new management-facing “Financial Overview” dashboard for a conference, aggregating order/cart/payment/ticket metrics via Django ORM and rendering them in a dedicated template.

Changes:

  • Introduces FinancialDashboardView to compute revenue, credits, order/cart breakdowns, payment analytics, ticket sales, and recent activity.
  • Adds URL routing for the dashboard under /<conference_slug>/financial/.
  • Adds a new management template to present the financial dashboard.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
src/django_program/manage/views_financial.py New dashboard view with ORM aggregations for revenue, credits, orders/carts/payments, ticket sales, and recent activity.
src/django_program/manage/urls_financial.py URLconf for the financial dashboard endpoint.
src/django_program/manage/urls.py Wires the financial dashboard URLconf under the conference management routes.
src/django_program/manage/templates/django_program/manage/financial_dashboard.html New UI template rendering financial summary cards and analytics tables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JacobCoffee
Copy link
Owner Author

Curious how this ties into stripe

JacobCoffee and others added 3 commits February 13, 2026 22:20
- Compute refunds from Credit records instead of Order.total (partial refund accuracy)
- Aggregate orders_by_status and payments_by_status in single queries
- Use Sum(quantity) instead of Count for ticket sold_count, include PARTIALLY_REFUNDED
- Show remaining_amount for AVAILABLE credits as "Credits Outstanding"
- Replace unreachable {% empty %} on payments_by_method with total_payments check
- Add 20 tests for financial dashboard (permissions, revenue, orders, carts, payments, tickets)
- Cover ActivityOrganizerMixin unauthenticated redirect for 100% coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix payments_by_method N+1 queries by using a single aggregated query
with values().annotate() instead of per-method filter().aggregate().
Add sidebar navigation entry for the financial dashboard under the
Registration section with active_nav highlight support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 14, 2026 04:23
@JacobCoffee JacobCoffee force-pushed the feat/financial-dashboard branch from 25d9ac2 to 0aacd90 Compare February 14, 2026 04:23
@JacobCoffee
Copy link
Owner Author

We may want some kind of cart snooping or ability to cancel cart via manage/ and in the API but fornow this looks good enough

@JacobCoffee JacobCoffee enabled auto-merge (squash) February 14, 2026 04:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JacobCoffee JacobCoffee merged commit b89c82a into main Feb 14, 2026
16 checks passed
@JacobCoffee JacobCoffee deleted the feat/financial-dashboard branch February 14, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments