Changes between Version 1 and Version 2 of WriterArchivesAStory
- Timestamp:
- 08/24/26 16:19:08 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WriterArchivesAStory
v1 v2 1 1 == Writer Archives a Story 2 === Actor: **Writer** 2 3 3 === Actor: **Writer**4 4 A writer decides to archive a published story, making it no longer visible to regular users and guests but keeping it in the system. 5 5 … … 8 8 **2.** The system displays all stories with their current statuses. 9 9 {{{#!sql 10 SELECT s.story_id, s.short_description, s t.status,10 SELECT s.story_id, s.short_description, s.status, 11 11 COUNT(DISTINCT c.chapter_id) AS total_chapters, 12 12 COUNT(DISTINCT l.user_id) AS total_likes 13 13 FROM STORY s 14 JOIN STATUS st ON s.story_id = st.story_id15 14 LEFT JOIN CHAPTER c ON s.story_id = c.story_id 16 15 LEFT JOIN LIKES l ON s.story_id = l.story_id 17 16 WHERE s.user_id = 2 18 GROUP BY s.story_id, s t.status;17 GROUP BY s.story_id, s.status; 19 18 }}} 20 19 … … 23 22 **4.**The system updates the story status from published to archived. 24 23 {{{#!sql 25 UPDATE ST ATUS24 UPDATE STORY 26 25 SET status = 'archived' 27 26 WHERE story_id = 1 AND status = 'published'; … … 30 29 **5.** The system verifies the story no longer appears in public browsing queries. 31 30 {{{#!sql 32 SELECT s.story_id, s.short_description, st.status 33 FROM STORY s 34 JOIN STATUS st ON s.story_id = st.story_id 35 WHERE st.status = 'published' AND s.story_id = 1; 31 SELECT story_id, short_description, status 32 FROM STORY 33 WHERE status = 'published' AND story_id = 1; 36 34 }}} 37 35 38 36 **6.** The system sends a notification to users who had the story in their reading lists informing them it is no longer available. 39 37 {{{#!sql 40 INSERT INTO NOTIFICATION ( content, is_read,created_at)41 VALUES ('"The Chronicles of Eldoria" has been archived by the author and is no longer available.', FALSE, CURRENT_TIMESTAMP);38 INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at) 39 VALUES ('"The Chronicles of Eldoria" has been archived by the author and is no longer available.', 'story_archived', FALSE, 4, 1, CURRENT_TIMESTAMP); 42 40 }}} 43 41
