Repository navigation
feat(reports,puzzles): implement player reporting and puzzle bulk import tool (#466, #467) - #498
Merged
Mkalbani merged 1 commit intoNov 20, 2026
Conversation
…ort tool (MindFlowInteractive#466, MindFlowInteractive#467) - MindFlowInteractive#467 In-Game Player Reporting: - Add ReportReason enum and evidence field - Implement player report submission endpoint POST /reports/player and extend POST /reports - Prevent duplicate reports from same reporter on same active target - Route reports to moderation queue with priority scoring, auto-escalation, and GET /reports/queue - Add request throttling and service-level rate limiting to deter spam abuse - Notify reporter with resolution outcome via ReportEventsListener - Add comprehensive unit tests - MindFlowInteractive#466 Puzzle Bulk Import Tool: - Add PuzzleImportHistory entity and BulkImportPuzzlesDto for structured file imports (JSON, CSV, YAML) - Implement file upload and parsing with multi-format support - Validate each record with exact row numbers for any malformed fields - Add dry-run mode returning validation report without committing database changes - Commit valid records atomically in a transaction via DataSource.transaction - Record import history log in database and AdminAuditLog - Add import endpoints to AdminPuzzlesController and comprehensive unit tests Closes MindFlowInteractive#466 Closes MindFlowInteractive#467
|
@Alhaandr 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! 🚀 |
Closed
7 tasks
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
This pull request implements two backend features:
What changed
In-Game Player Reporting (#467)
ReportReasonenum (cheating,abusive_name,abusive_chat,other).evidencetext column toContentReportentity.CreatePlayerReportDtoand extendedCreateReportDtoto support optional evidence and reasons.POST /reports/playerendpoint for submitting player reports.POST /reportsfor general content/player reporting with evidence.@Throttle({ default: { limit: 5, ttl: 60000 } })decorators on submission endpoints.checkRateLimit) preventing spam reporting beyond configured thresholds.GET /reports/queueinReportsControllerandgetModerationQueueinReportsServicereturning reports ordered by priority and recency.report.queuedevent upon report creation.report.resolvedpayload andReportEventsListenerto deliver notifications to reporters containing resolution outcome details.reports.service.spec.ts,reports.controller.spec.ts, andreport-events.listener.spec.tscovering player report creation, duplicate prevention, rate limiting, moderation queue retrieval, and notifications.Puzzle Bulk Import Tool (#466)
PuzzleImportHistoryentity (puzzle_import_historytable) tracking import batches, admin ID, filename, format, record counts, dry-run flag, and detailed JSON execution report.BulkImportPuzzlesDtoandPuzzleImportFormatenum (json,csv,yaml).POST /admin/puzzles/importandPOST /admin/puzzles/bulk-importsupportingmultipart/form-datafile uploads viaFileInterceptorand JSON payloads.{ puzzles: [...] }, CSV files with quoted values and nested JSON strings/arrays, and YAML.row,title,errors).dryRun: truemode validates all records, generates a full report (validCount,invalidCount, row errors), logs dry-run history, and makes zero modifications to the puzzles table.DataSource.transactionto ensure valid puzzle records are committed atomically.GET /admin/puzzles/import/historyandGET /admin/puzzles/import/history/:idto retrieve past import logs.AdminAuditLogServicefor audit trail tracking.puzzle-bulk-import.service.spec.tscovering multi-format imports, dry-run isolation, transaction atomicity, row-number error tracking, and history retrieval.admin-puzzles.controller.spec.tsto test import and history endpoints.Why
Testing performed
npm test -- src/reports src/puzzles/services/puzzle-bulk-import.service.spec.ts src/admin/controllers/__tests__/admin-puzzles.controller.spec.tsnpx tsc --project tsconfig.build.json --noEmitacross all modified and newly created files.Risks considered
DataSource.transaction), rolling back completely if a fatal database error occurs.POST /reports,GET /reports,AdminPuzzlesControllerroutes) remain fully backwards-compatible.Edge cases handled
BadRequestException.BadRequestException.CRITICALwhen 5+ reports are submitted within 24 hours.Closes #466
Closes #467