Skip to content

Feat/ssad 0111/admin reviewing comments and replies#121

Merged
Serpantyn merged 7 commits into
devfrom
feat/SSAD-0111/admin_reviewing_comments
Mar 4, 2026
Merged

Feat/ssad 0111/admin reviewing comments and replies#121
Serpantyn merged 7 commits into
devfrom
feat/SSAD-0111/admin_reviewing_comments

Conversation

@Serpantyn
Copy link
Copy Markdown
Contributor

@Serpantyn Serpantyn commented Mar 3, 2026

dev

Code reviewers

Summary of issue

The comment system lacked support for nested discussions (replies to comments) and required a moderation flow. Administrators needed the ability to review pending comments, understand their context within a thread, update their approval statuses, and forcefully remove inappropriate content.

Summary of change

Implemented nested comment replies and a complete administrative moderation suite.
Key changes:

  • Replies implementation: added logic to build hierarchical comment trees in memory, allowing users to see comments with their nested replies sorted by date.
  • Admin endpoints (CommentController):
    • GET /pending: gets a flat list of all comments awaiting moderation (CommentStatus.Pending), sorted from oldest to newest.
    • GET /withReplies/{id}: fetches a specific comment and its entire nested reply tree to provide context for moderation (ignores status filters).
    • PUT /updateStatus: allows admins to change a comment status (to Approved or Rejected).
    • DELETE /adminDelete/{id}: enables admins to delete any comment and its cascade of replies without ownership checks.
  • Created corresponding commands, queries, handlers, and DTOs.
  • Testing: added unit tests for all new handlers, validators, and the controller, covering tree building, sorting, and cascade deletion.

Tasks

CHECK LIST

  • СI passed
  • Сode coverage >=80%
  • All reviewers agreed to merge the PR
  • I've checked new feature as logged in and logged out user if needed
  • PR meets all conventions

@Serpantyn Serpantyn self-assigned this Mar 3, 2026
@Serpantyn Serpantyn added enhancement New feature or request task Regular task labels Mar 3, 2026
@Serpantyn Serpantyn changed the title Feat/ssad 0111/admin reviewing comments Feat/ssad 0111/admin reviewing comments and replies Mar 3, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

@Darsicl Darsicl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

@Serpantyn Serpantyn merged commit 4f32a18 into dev Mar 4, 2026
2 of 3 checks passed
@Serpantyn Serpantyn moved this from To Review to Sprint 6 Done in Streetcode-January-2026 Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request task Regular task

Projects

Status: Sprint 6 Done

3 participants