Skip to content

Slice 7: Reports (manager dashboard) - #12

Merged
DanMat merged 2 commits into
nimbus-rebuildfrom
slice/reports
Sep 6, 2026
Merged

Slice 7: Reports (manager dashboard)#12
DanMat merged 2 commits into
nimbus-rebuildfrom
slice/reports

Conversation

@DanMat

@DanMat DanMat commented Sep 6, 2026

Copy link
Copy Markdown
Owner

The last operational vertical — read-only revenue reporting for managers, gated on the :manage action (its first use).

What's here

  • Reports servicerevenueBetween / revenueByDay / topItems / activeOrders, over paid orders (revenue is the recorded amount_paid, never recomputed). Callers pass explicit [from, to) bounds, so it's deterministic and testable; bound SQL throughout.
  • Admin — a manager dashboard: today + last-7-days revenue cards, active-orders count, a 7-day breakdown, and the week's top items. Read-only, gated on danmat.restaurant:manage, mobile cards.
  • MCP — a reports read tool (today / last_7_days / active_orders / top_items).
  • Guide — reports section.

Tests

ReportsTest (windowed revenue sums, an unpaid order is not revenue but is active, by-day grouping, top-items ranking), ReportsAdminTest (today's revenue + item-name escaping + a clean empty period), RestaurantToolsetTest (reports tool listed for read tokens), RestaurantPluginTest (the reports page is gated :manage).

No new tables, no core change. cs-fixer + PHPStan L6 green locally; phpunit in CI (8.2 + 8.3).

🤖 Generated with Claude Code

DanMat and others added 2 commits September 5, 2026 21:27
Read-only revenue reporting over paid orders — the last operational vertical.

- Reports service: revenueBetween / revenueByDay / topItems / activeOrders, over
  paid orders (revenue = recorded amount_paid, never recomputed). Callers pass
  explicit [from,to) bounds, so it's deterministic and testable; bound SQL.
- Admin: a manager dashboard (today + last-7-days revenue cards, active orders,
  a 7-day breakdown, week's top items). Read-only, gated on the manage action
  (danmat.restaurant:manage) — the first use of that grant. Mobile cards.
- MCP: a reports read tool (today/last_7_days/active_orders/top_items).
- Guide: reports section.
- Tests: ReportsTest (windowed revenue, unpaid≠revenue but active, by-day
  grouping, top-items ranking), ReportsAdminTest (today's revenue + escapes item
  names + empty period), RestaurantToolsetTest (reports tool listed),
  RestaurantPluginTest (reports page gated :manage; manage label).

No new tables, no core change. cs-fixer + PHPStan green locally; phpunit in CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…atch)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 8a68a88 into nimbus-rebuild Sep 6, 2026
4 checks passed
@DanMat
DanMat deleted the slice/reports branch September 6, 2026 01:31
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