You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a threading (nested comments) feature to the comment module, allowing users and admins to reply to specific comments, creating a hierarchical conversation structure. This will enable replies to be linked to a parent comment, improving discussion clarity and organization.
Acceptance Criteria
Users can create a top-level comment without specifying a parentId.
Users can create a reply to an existing comment by providing a valid parentId in the POST /comments/add request.
A new endpoint GET /comments/:id/thread returns a comment with its nested replies, including user details for each.
The database schema supports threading with a parent_id column in the comments table.
Validation ensures parentId is a valid UUID (v4) when provided, and it’s optional for top-level comments.
Error handling returns appropriate HTTP status codes (e.g., 404 for invalid parentId, 400 for empty comments).
Purpose
This feature is needed to enhance the comment system by allowing structured conversations, making it easier for admins to respond directly to user comments for clarification or follow-up. It improves user experience and aligns the system with common discussion patterns seen in platforms like Reddit or X.
Requirements
Expected Outcome
A user can post a comment: POST /comments/add with { "model_id": "prod1", "model_type": "product", "comment": "Great product!" }, resulting in a top-level comment.
An admin can reply: POST /comments/add with { "model_id": "prod1", "model_type": "product", "comment": "Thanks! Why?", "parentId": "" }, creating a nested reply.
Fetching GET /comments//thread returns a JSON object like:
The database reflects the hierarchy with parent_id linking replies to their parent comments.
Additional Context
Current State: The comment module supports flat comments only (POST /comments/add and GET /comments/:id). Threading is not implemented.
Database: Using PostgreSQL, so the parent_id column must be added via a migration (e.g., ALTER TABLE comments ADD COLUMN parent_id UUID REFERENCES comments(id)).
Handoff: The application code is ready, but the PostgreSQL schema update is TBD by the database team.
Use Case: Admins need to reply directly to user comments for clarification, which flat comments don’t support effectively.
The text was updated successfully, but these errors were encountered:
Description
Add a threading (nested comments) feature to the comment module, allowing users and admins to reply to specific comments, creating a hierarchical conversation structure. This will enable replies to be linked to a parent comment, improving discussion clarity and organization.
Acceptance Criteria
Users can create a top-level comment without specifying a parentId.
Users can create a reply to an existing comment by providing a valid parentId in the POST /comments/add request.
A new endpoint GET /comments/:id/thread returns a comment with its nested replies, including user details for each.
The database schema supports threading with a parent_id column in the comments table.
Validation ensures parentId is a valid UUID (v4) when provided, and it’s optional for top-level comments.
Error handling returns appropriate HTTP status codes (e.g., 404 for invalid parentId, 400 for empty comments).
Purpose
This feature is needed to enhance the comment system by allowing structured conversations, making it easier for admins to respond directly to user comments for clarification or follow-up. It improves user experience and aligns the system with common discussion patterns seen in platforms like Reddit or X.
Requirements
Expected Outcome
A user can post a comment: POST /comments/add with { "model_id": "prod1", "model_type": "product", "comment": "Great product!" }, resulting in a top-level comment.
An admin can reply: POST /comments/add with { "model_id": "prod1", "model_type": "product", "comment": "Thanks! Why?", "parentId": "" }, creating a nested reply.
Fetching GET /comments//thread returns a JSON object like:
The database reflects the hierarchy with parent_id linking replies to their parent comments.
Additional Context
Current State: The comment module supports flat comments only (POST /comments/add and GET /comments/:id). Threading is not implemented.
Database: Using PostgreSQL, so the parent_id column must be added via a migration (e.g., ALTER TABLE comments ADD COLUMN parent_id UUID REFERENCES comments(id)).
Handoff: The application code is ready, but the PostgreSQL schema update is TBD by the database team.
Use Case: Admins need to reply directly to user comments for clarification, which flat comments don’t support effectively.
The text was updated successfully, but these errors were encountered: