feat: #416 Implement Fraud Detection#476
Merged
Merged
Conversation
Contributor
Author
|
@LaGodxy please review |
LaGodxy
approved these changes
Apr 24, 2026
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.
Implemented #416 end to end.
The backend now has a dedicated fraud subsystem centered in src/fraud/fraud.service.ts (line 1) with new Prisma models and a migration in prisma/schema.prisma (line 1) and migration.sql (line 1). It persists fraud alerts and investigation notes, detects patterns like excessive failed logins, shared IPs across accounts, multiple IPs on one account, new-device logins, token reuse, rapid listing bursts, duplicate property addresses, and high-value listings from very new accounts, and sends alert emails when FRAUD_ALERT_RECIPIENTS is configured.
Admin investigation tooling is wired through src/admin/admin.controller.ts (line 1) and src/admin/admin.service.ts (line 1): list alerts, summary view, alert details, review/update status, add notes, block a user from an alert, and manually scan users or properties. Enforcement is hooked into src/auth/auth.service.ts (line 1) and src/properties/properties.service.ts (line 1), so suspicious auth/property activity creates alerts automatically, and critical cases like token reuse can auto-block the
closes #416