Changes between Version 1 and Version 2 of WriterArchivesAStory


Ignore:
Timestamp:
08/24/26 16:19:08 (13 days ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WriterArchivesAStory

    v1 v2  
    11==  Writer Archives a Story
     2=== Actor: **Writer**
    23
    3 === Actor: **Writer**
    44A writer decides to archive a published story, making it no longer visible to regular users and guests but keeping it in the system.
    55
     
    88**2.** The system displays all stories with their current statuses.
    99{{{#!sql
    10 SELECT s.story_id, s.short_description, st.status,
     10SELECT s.story_id, s.short_description, s.status,
    1111       COUNT(DISTINCT c.chapter_id) AS total_chapters,
    1212       COUNT(DISTINCT l.user_id) AS total_likes
    1313FROM STORY s
    14 JOIN STATUS st ON s.story_id = st.story_id
    1514LEFT JOIN CHAPTER c ON s.story_id = c.story_id
    1615LEFT JOIN LIKES l ON s.story_id = l.story_id
    1716WHERE s.user_id = 2
    18 GROUP BY s.story_id, st.status;
     17GROUP BY s.story_id, s.status;
    1918}}}
    2019
     
    2322**4.**The system updates the story status from published to archived.
    2423{{{#!sql
    25 UPDATE STATUS
     24UPDATE STORY
    2625SET status = 'archived'
    2726WHERE story_id = 1 AND status = 'published';
     
    3029**5.** The system verifies the story no longer appears in public browsing queries.
    3130{{{#!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;
     31SELECT story_id, short_description, status
     32FROM STORY
     33WHERE status = 'published' AND story_id = 1;
    3634}}}
    3735
    3836**6.** The system sends a notification to users who had the story in their reading lists informing them it is no longer available.
    3937{{{#!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);
     38INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at)
     39VALUES ('"The Chronicles of Eldoria" has been archived by the author and is no longer available.', 'story_archived', FALSE, 4, 1, CURRENT_TIMESTAMP);
    4240}}}
    4341