Changes between Version 1 and Version 2 of AdminRemovesAStory


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

--

Legend:

Unmodified
Added
Removed
Modified
  • AdminRemovesAStory

    v1 v2  
    22
    33=== Actor: **Admin**
     4
    45An admin removes an inappropriate published story from the platform after reviewing it for content violations.
    56
     
    910{{{#!sql
    1011SELECT s.story_id, s.short_description, s.mature_content,
    11        u.username AS author, st.status,
     12       u.username AS author, s.status,
    1213       COUNT(DISTINCT c.comment_id) AS total_comments,
    13        s.created_at
     14       s.story_created_at
    1415FROM STORY s
    1516JOIN USERS u ON s.user_id = u.user_id
    16 JOIN STATUS st ON s.story_id = st.story_id
    1717LEFT JOIN COMMENT c ON s.story_id = c.story_id
    18 WHERE st.status = 'published'
    19 GROUP BY s.story_id, u.username, st.status
    20 ORDER BY s.created_at DESC;
     18WHERE s.status = 'published'
     19GROUP BY s.story_id, u.username, s.status
     20ORDER BY s.story_created_at DESC;
    2121}}}
    2222
     
    2525**4.** The admin confirms the story violates platform rules and proceeds to delete it.
    2626
    27 **5.** The system deletes the story, and all related records are automatically removed via CASCADE.
     27**5.** The system notifies the writer that their story is being removed due to a policy violation, before the story record is deleted.
     28{{{#!sql
     29INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at)
     30VALUES ('Your story "Moonlight Promises" has been removed by an administrator due to a content policy violation.', 'story_removed', FALSE, 6, 3, CURRENT_TIMESTAMP);
     31}}}
     32
     33**6.** The system deletes the story, and all related records (chapters, comments, likes, collaborations, genre links, reading list entries) are automatically removed via CASCADE.
    2834{{{#!sql
    2935DELETE FROM STORY
     
    3137}}}
    3238
    33 **6.** The system notifies the writer that their story was removed due to a policy violation.
    34 {{{#!sql
    35 INSERT INTO NOTIFICATION (content, is_read, created_at)
    36 VALUES ('Your story "Moonlight Promises" has been removed by an administrator due to a content policy violation.', FALSE, CURRENT_TIMESTAMP);
    37 }}}
    38 
    3939**7.** The system logs the action and confirms the story is no longer visible on the platform.