Skip to content

User profile - #1153

Open
Dev-Zully wants to merge 3 commits into
MettaChain:mainfrom
Dev-Zully:User-Profile
Open

User profile#1153
Dev-Zully wants to merge 3 commits into
MettaChain:mainfrom
Dev-Zully:User-Profile

Conversation

@Dev-Zully

Copy link
Copy Markdown

— Trust-score API e2e (test/e2e/trust-score.e2e.spec.ts, 20 tests)

Auth: rejects unauthenticated callers on /trust-score/me, /:userId, /batch-update
GET /trust-score/me: returns full structure (score, breakdown, lastUpdated, nextUpdateTime) for the authenticated user
GET /trust-score/me: returns different scores for different users, respecting their profiles
GET /trust-score/:userId: returns score for another user by ID; 500 for non-existent user
GET /trust-score/me/summary & /:userId/summary: lightweight response without breakdown
GET /trust-score/me/breakdown & /:userId/breakdown: full factor breakdown (emailVerified maxScore=10, idVerified maxScore=20, completedTransactions maxScore=45, totalMaxScore=75)
Score computation correctness:
User A (email-verified + id-verified + 2 txns): emailVerified=10, idVerified=20, completedTransactions=30, totalScore=60
User B (unverified, no id-verification): emailVerified=0, idVerified=0, totalScore lower than User A
User C (email-verified + id-verified + 3 txns): capped at completedTransactions=45, totalScore=75 (maximum)
POST /trust-score/me/calculate & /:userId/calculate: force-recalculation
POST /trust-score/batch-update: returns updated/failed counts for all seeded users
Refresh query parameter: ?refresh=true forces fresh calculation
Combined Bearer + API-key authentication
Issue #1075 — Admin API e2e (test/e2e/admin-api.e2e.spec.ts, 26 tests)

Auth: rejects unauthenticated callers on 5 admin routes (dashboard, users, block, fraud alerts, fraud scan)
USER role rejected (403) on 9 admin endpoints: dashboard, users list, block/unblock, fraud alerts/summary/scan, transaction monitoring, property moderation queue
ADMIN access — user management: list users (paginated response), block a user (state verified), unblock a user (state verified)
ADMIN access — fraud actions: list fraud alerts, get fraud summary (statuses + severity counts), scan user for fraud
ADMIN access — dashboard: returns userStats, propertyStats, revenueMetrics, systemHealth
ADMIN access — email preview: valid template returns sampleData; unknown template returns 404
ADMIN access — transaction monitoring: list transactions, get summary (pending/completed/cancelled/totalValue)
ADMIN access — property moderation: moderation queue with items and total
closes #1070
closes #1074
closes #1075
closes #1076

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Dev-Zully Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment