Closed armintalaie closed 23 hours ago
Create CRUD endpoints for managing course discussion posts with user tracking, edit history, and threading
[x] posts table:
posts
- id: UUID - course_id: UUID - title: string - content: text - parent_id: UUID (optional) - created_by: UUID - status: enum (active, deleted) - timestamps
[x] post_edits table:
post_edits
- id: UUID - post_id: UUID - edited_by: UUID - previous_content: text - new_content: text - edit_reason: text (optional) - timestamps
Under /courses/{course_id}/posts:
/courses/{course_id}/posts
[x] POST: create new post
POST
{ "title": "string", "content": "string", "parent_id": "UUID (optional)", "tags": "UUID[]" }
[x] GET: list posts with metadata
GET
[x] PATCH /{post_id}: update post
PATCH /{post_id}
[x] DELETE /{post_id}: Hard delete (for now)
DELETE /{post_id}
Tasks:
Overview
Create CRUD endpoints for managing course discussion posts with user tracking, edit history, and threading
Database Tables
[x]
posts
table:[x]
post_edits
table:API Endpoints
Under
/courses/{course_id}/posts
:[x]
POST
: create new post[x]
GET
: list posts with metadata[x]
PATCH /{post_id}
: update post[x]
DELETE /{post_id}
: Hard delete (for now)Track who deletedKeep historyTasks: