Changes between Initial Version and Version 1 of UserViewsPublicReadingLists


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

--

Legend:

Unmodified
Added
Removed
Modified
  • UserViewsPublicReadingLists

    v1 v1  
     1==  User Views Public Reading Lists
     2
     3=== Authors: **Regular User / Guest User**
     4A user browses all public reading lists on the platform to discover new stories recommended by other readers.
     5
     6**1.** The user navigates to the "Community Reading Lists" section.
     7
     8**2.** The system retrieves all public reading lists along with their story counts.
     9{{{#!sql
     10SELECT rl.list_id, rl.name, rl.content, u.username,
     11       COUNT(rli.story_id) AS total_stories, rl.created_at
     12FROM READING_LIST rl
     13JOIN USERS u ON rl.user_id = u.user_id
     14LEFT JOIN READING_LIST_ITEMS rli ON rl.list_id = rli.list_id
     15WHERE rl.is_public = TRUE
     16GROUP BY rl.list_id, u.username
     17ORDER BY total_stories DESC;
     18}}}
     19
     20**3.** The user selects a reading list to view its contents.
     21
     22**4.** The system displays all stories in that reading list with their details.
     23{{{#!sql
     24SELECT s.story_id, s.short_description, s.mature_content,
     25       u.username AS author, COUNT(l.user_id) AS likes,
     26       rli.added_at
     27FROM READING_LIST_ITEMS rli
     28JOIN STORY s ON rli.story_id = s.story_id
     29JOIN USERS u ON s.user_id = u.user_id
     30LEFT JOIN LIKES l ON s.story_id = l.story_id
     31WHERE rli.list_id = 1
     32GROUP BY s.story_id, u.username, rli.added_at
     33ORDER BY rli.added_at DESC;
     34}}}
     35
     36**5.** The user clicks on a story from the list and is redirected to the story page.