Changes between Initial Version and Version 1 of WriterArchivesAStory


Ignore:
Timestamp:
03/05/26 15:44:13 (2 weeks ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WriterArchivesAStory

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