| Version 2 (modified by , 13 days ago) ( diff ) |
|---|
Admin Removes a Story
Actor: Admin
An admin removes an inappropriate published story from the platform after reviewing it for content violations.
1. The admin navigates to the content moderation dashboard.
2. The system displays all published stories with their details.
SELECT s.story_id, s.short_description, s.mature_content,
u.username AS author, s.status,
COUNT(DISTINCT c.comment_id) AS total_comments,
s.story_created_at
FROM STORY s
JOIN USERS u ON s.user_id = u.user_id
LEFT JOIN COMMENT c ON s.story_id = c.story_id
WHERE s.status = 'published'
GROUP BY s.story_id, u.username, s.status
ORDER BY s.story_created_at DESC;
3. The admin selects a story flagged for inappropriate content and reviews it.
4. The admin confirms the story violates platform rules and proceeds to delete it.
5. The system notifies the writer that their story is being removed due to a policy violation, before the story record is deleted.
INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at)
VALUES ('Your story "Moonlight Promises" has been removed by an administrator due to a content policy violation.', 'story_removed', FALSE, 6, 3, CURRENT_TIMESTAMP);
6. The system deletes the story, and all related records (chapters, comments, likes, collaborations, genre links, reading list entries) are automatically removed via CASCADE.
DELETE FROM STORY WHERE story_id = 3;
7. The system logs the action and confirms the story is no longer visible on the platform.
