== Writer Archives a Story === Actor: **Writer** A writer decides to archive a published story, making it no longer visible to regular users and guests but keeping it in the system. **1.** The writer navigates to their story management dashboard. **2.** The system displays all stories with their current statuses. {{{#!sql SELECT s.story_id, s.short_description, s.status, COUNT(DISTINCT c.chapter_id) AS total_chapters, COUNT(DISTINCT l.user_id) AS total_likes FROM STORY s LEFT JOIN CHAPTER c ON s.story_id = c.story_id LEFT JOIN LIKES l ON s.story_id = l.story_id WHERE s.user_id = 2 GROUP BY s.story_id, s.status; }}} **3.** The writer selects a published story and chooses the "Archive" option. **4.**The system updates the story status from published to archived. {{{#!sql UPDATE STORY SET status = 'archived' WHERE story_id = 1 AND status = 'published'; }}} **5.** The system verifies the story no longer appears in public browsing queries. {{{#!sql SELECT story_id, short_description, status FROM STORY WHERE status = 'published' AND story_id = 1; }}} **6.** The system sends a notification to users who had the story in their reading lists informing them it is no longer available. {{{#!sql INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at) VALUES ('"The Chronicles of Eldoria" has been archived by the author and is no longer available.', 'story_archived', FALSE, 4, 1, CURRENT_TIMESTAMP); }}} **7.** The system confirms the story is archived and updates the writer's dashboard.