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, st.status,
COUNT(DISTINCT c.comment_id) AS total_comments,
s.created_at
FROM STORY s
JOIN USERS u ON s.user_id = u.user_id
JOIN STATUS st ON s.story_id = st.story_id
LEFT JOIN COMMENT c ON s.story_id = c.story_id
WHERE st.status = 'published'
GROUP BY s.story_id, u.username, st.status
ORDER BY s.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 deletes the story, and all related records are automatically removed via CASCADE.
DELETE FROM STORY WHERE story_id = 3;
6. The system notifies the writer that their story was removed due to a policy violation.
INSERT INTO NOTIFICATION (content, is_read, created_at)
VALUES ('Your story "Moonlight Promises" has been removed by an administrator due to a content policy violation.', FALSE, CURRENT_TIMESTAMP);
7. The system logs the action and confirms the story is no longer visible on the platform.
