== Regular User Comments on a Story === Actor: ** Regular User** A regular user leaves a comment on a published story, and the writer receives a notification. **1.** The regular user opens a published story and scrolls to the comments section. **2.** The system displays all existing comments for the story. {{{#!sql SELECT c.comment_id, u.username, c.content, c.created_at FROM COMMENT c JOIN USERS u ON c.user_id = u.user_id WHERE c.story_id = 1 ORDER BY c.created_at DESC; }}} **3.** The user types a comment and submits it. **4.** The system inserts the new comment into the COMMENT table. {{{#!sql INSERT INTO COMMENT (content, user_id, story_id, created_at, updated_at) VALUES ('This is absolutely breathtaking! The world-building is incredible!', 4, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); }}} **5.** The system creates a notification for the writer. {{{#!sql INSERT INTO NOTIFICATION (content, is_read, created_at) VALUES ('Sara commented on your story "The Chronicles of Eldoria"', FALSE, CURRENT_TIMESTAMP); }}} **6.** The system records the notification type. {{{#!sql INSERT INTO CONTENT_TYPE (notification_id, content_type) VALUES (2, 'comment'); }}} **7.** The system links the notification to the writer. {{{#!sql INSERT INTO NOTIFY (user_id, story_id, notification_id) VALUES (2, 1, 2); }}} **8.** The system displays the new comment immediately under the story.