== 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, st.status, COUNT(DISTINCT c.chapter_id) AS total_chapters, COUNT(DISTINCT l.user_id) AS total_likes FROM STORY s JOIN STATUS st ON s.story_id = st.story_id 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, st.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 STATUS 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 s.story_id, s.short_description, st.status FROM STORY s JOIN STATUS st ON s.story_id = st.story_id WHERE st.status = 'published' AND s.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 (content, is_read, created_at) VALUES ('"The Chronicles of Eldoria" has been archived by the author and is no longer available.', FALSE, CURRENT_TIMESTAMP); }}} **7.** The system confirms the story is archived and updates the writer's dashboard.