User profile - #1153
Open
Dev-Zully wants to merge 3 commits into
Open
Conversation
|
@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! 🚀 |
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.
— 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