Changes between Version 2 and Version 3 of RegularUserCommentsOnStory


Ignore:
Timestamp:
08/24/26 16:11:00 (13 days ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RegularUserCommentsOnStory

    v2 v3  
    22
    33=== Actor: ** Regular User**
     4
    45A regular user leaves a comment on a published story, and the writer receives a notification.
    56
     
    89**2.** The system displays all existing comments for the story.
    910{{{#!sql
    10 SELECT c.comment_id, u.username, c.content, c.created_at
     11SELECT c.comment_id, u.username, c.comment_content, c.comment_created_at
    1112FROM COMMENT c
    1213JOIN USERS u ON c.user_id = u.user_id
    1314WHERE c.story_id = 1
    14 ORDER BY c.created_at DESC;
     15ORDER BY c.comment_created_at DESC;
    1516}}}
    1617
     
    1920**4.** The system inserts the new comment into the COMMENT table.
    2021{{{#!sql
    21 INSERT INTO COMMENT (content, user_id, story_id, created_at, updated_at)
     22INSERT INTO COMMENT (comment_content, user_id, story_id, comment_created_at, comment_updated_at)
    2223VALUES ('This is absolutely breathtaking! The world-building is incredible!', 4, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
    2324}}}
     
    2526**5.** The system creates a notification for the writer.
    2627{{{#!sql
    27 INSERT INTO NOTIFICATION (content, is_read, created_at)
    28 VALUES ('Sara commented on your story "The Chronicles of Eldoria"', FALSE, CURRENT_TIMESTAMP);
     28INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at)
     29VALUES ('Sara commented on your story "The Chronicles of Eldoria"', 'comment', FALSE, 2, 1, CURRENT_TIMESTAMP);
    2930}}}
    3031
    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.