Changes between Version 2 and Version 3 of RegularUserCommentsOnStory
- Timestamp:
- 08/24/26 16:11:00 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RegularUserCommentsOnStory
v2 v3 2 2 3 3 === Actor: ** Regular User** 4 4 5 A regular user leaves a comment on a published story, and the writer receives a notification. 5 6 … … 8 9 **2.** The system displays all existing comments for the story. 9 10 {{{#!sql 10 SELECT c.comment_id, u.username, c.co ntent, c.created_at11 SELECT c.comment_id, u.username, c.comment_content, c.comment_created_at 11 12 FROM COMMENT c 12 13 JOIN USERS u ON c.user_id = u.user_id 13 14 WHERE c.story_id = 1 14 ORDER BY c.c reated_at DESC;15 ORDER BY c.comment_created_at DESC; 15 16 }}} 16 17 … … 19 20 **4.** The system inserts the new comment into the COMMENT table. 20 21 {{{#!sql 21 INSERT INTO COMMENT (co ntent, user_id, story_id, created_at,updated_at)22 INSERT INTO COMMENT (comment_content, user_id, story_id, comment_created_at, comment_updated_at) 22 23 VALUES ('This is absolutely breathtaking! The world-building is incredible!', 4, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); 23 24 }}} … … 25 26 **5.** The system creates a notification for the writer. 26 27 {{{#!sql 27 INSERT INTO NOTIFICATION ( content, is_read,created_at)28 VALUES ('Sara commented on your story "The Chronicles of Eldoria"', FALSE, CURRENT_TIMESTAMP);28 INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at) 29 VALUES ('Sara commented on your story "The Chronicles of Eldoria"', 'comment', FALSE, 2, 1, CURRENT_TIMESTAMP); 29 30 }}} 30 31 31 **6.** The system records the notification type. 32 {{{#!sql 33 INSERT INTO CONTENT_TYPE (notification_id, content_type) 34 VALUES (2, 'comment'); 35 }}} 36 37 **7.** The system links the notification to the writer. 38 {{{#!sql 39 INSERT INTO NOTIFY (user_id, story_id, notification_id) 40 VALUES (2, 1, 2); 41 }}} 42 43 **8.** The system displays the new comment immediately under the story. 32 **6.** The system displays the new comment immediately under the story.
