-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Complexity: High (200 points)
Description
Add administrative endpoints for platform oversight including user management, escrow overview, and system statistics.
Requirements and Context
README mentions "Admin Monitoring: Centralized tools for oversight and analytics"
No admin role or admin-specific endpoints exist
Platform operators need oversight of all escrows, not just their own
Required for dispute arbitration and compliance
Suggested Execution
Fork repo, create branch feat/admin-api
Add role field to User entity with enum: USER, ADMIN, SUPER_ADMIN
Create AdminGuard that checks user role
Create AdminModule with:
AdminController with admin-only endpoints
AdminService for admin operations
Implement endpoints:
GET /admin/escrows - list all escrows with advanced filters
GET /admin/users - list all users
GET /admin/stats - platform statistics (counts, volumes)
POST /admin/users/:id/suspend - suspend user
Add admin seed script for development
Test and Commit
Test admin guard rejects non-admin users
Test all admin endpoints with mock admin user
Verify regular users cannot access admin routes
Include example statistics response
Example Commit Message
feat: implement admin dashboard API endpoints
Add role-based admin system with endpoints for platform oversight
including user management, escrow listing, and system statistics.
Guidelines
Never expose admin endpoints to regular users
Log all admin actions for audit
Statistics should be cacheable (add cache headers)
Consider pagination for user/escrow lists