Skip to content

[Feature] Create QuestComment backend logic - post new commentΒ #84

@karastoyanov

Description

@karastoyanov

✨ Feature Description

Allow users to post comments on any coding quest. Each quest can have many comments from many users, and each user can post multiple comments on the same quest.

🧩 Problem Statement

Users currently have no way to discuss or leave feedback on quests. A comments system encourages community engagement and helps other users understand quests better.

πŸ’‘ Proposed Solution

πŸ”„ Alternatives Considered

πŸ“‹ Acceptance Criteria

  • quest_id is a foreign key to coding_quests and is not unique
  • comment_author is a foreign key to users
  • POST /api/quests/<quest_id>/comments creates a comment for the authenticated user
  • Posting a comment to a non-existent quest returns 404 Not Found
  • Posting with an empty or missing comment field returns 400 Bad Request
  • Unauthenticated requests return 401 Unauthorized
  • An index on quest_id exists in the migration for quest_comments
  • Unit tests cover: successful create, fetch with pagination, delete own comment, delete other user's comment (forbidden), quest not found

πŸ”— Related Issues / Links

πŸ“Ž Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality or behavior
    No fields configured for Feature.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions