feat(admin): add admin cash-flow control dashboard#24
Merged
Conversation
Add an admin-only dashboard for platform-wide cash-flow oversight. Members gain an isAdmin flag (Flyway V6); admins are routed to /admin on login (form + OAuth) instead of /dashboard, and /admin/** is gated by a session-based AdminAuthInterceptor that redirects non-admins. The dashboard shows aggregate stats (member count, per-status tx counts, completed deposit/withdrawal totals, total wallet balance) and a paginated, filterable table of every wallet's transactions (name, actorId, transactionId, status, time). Filtering supports date range, transaction status, and an order number matching either the transaction UUID or the gateway paymentExternalId, via a new TransactionSpec.adminFilter and repository aggregate queries. i18n keys added for en/ja/zh-TW. Also harden scripts/dev-up.ps1: relax $ErrorActionPreference around the git version-detection calls so benign stderr warnings (e.g. LF/CRLF) no longer abort the script under 'Stop'. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
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
Adds an admin-only cash-flow control dashboard to
wallet_system: admins see platform-wide stats and a paginated, filterable view of every user's transactions.π― Motivation
The app previously only let each user see their own wallet's transactions. Operators need a back-office view to monitor all money movement across the platform.
π§ Changes
Member.isAdmin(FlywayV6); form-login and Google-OAuth flows route admins to/admininstead of/dashboard, stamping anIS_ADMINsession flag.AdminAuthInterceptorgates/admin/**via the session flag (non-admins redirected to/dashboard), consistent with the existing session-based authorization (no Spring roles introduced).TransactionSpec.adminFilter(all wallets + status + order-number + date range); order number matches either the transaction UUID or the gatewaypaymentExternalId. New repository aggregates for per-status counts, completed deposit/withdrawal totals, and total wallet balance.AdminService(stats + resolves each transaction's initiating member into name/actorId),AdminDashboardController, andAdminStats/AdminTxViewDTOs.admin-dashboard.html(stat cards, filter form, transaction table, pagination) reusing the existing dashboard styling; admin message keys for en/ja/zh-TW.scripts/dev-up.ps1so benign git stderr warnings (e.g. LF/CRLF) no longer abort version detection under$ErrorActionPreference='Stop'.π§ͺ How to Test
cd wallet_system && ./mvnw testβ full suite green (256 tests).docker compose up --build, thenUPDATE members SET is_admin=true WHERE email='[email protected]';./admin; verify stats, the status / order-number / date-range filters, 10-per-page pagination, and the name/actorId columns./dashboard; hitting/admindirectly redirects back to/dashboard.V6__add_is_admin_to_members.sql(additive column, defaultfalse).β Checklist
π€ Generated with Claude Code