Slice 7: Reports (manager dashboard) - #12
Merged
Merged
Conversation
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>
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.
The last operational vertical — read-only revenue reporting for managers, gated on the
:manageaction (its first use).What's here
Reportsservice —revenueBetween/revenueByDay/topItems/activeOrders, over paid orders (revenue is the recordedamount_paid, never recomputed). Callers pass explicit[from, to)bounds, so it's deterministic and testable; bound SQL throughout.danmat.restaurant:manage, mobile cards.reportsread tool (today/last_7_days/active_orders/top_items).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