| | 1 | == User Creates a Reading List |
| | 2 | |
| | 3 | === Authors: **Regular User / Writer** |
| | 4 | A user creates a new personal reading list, choosing whether to make it public or private. |
| | 5 | |
| | 6 | **1.** The user navigates to their profile and selects "Create New Reading List". |
| | 7 | |
| | 8 | **2.** The system displays a form requesting the list name, description, and visibility setting. |
| | 9 | |
| | 10 | **3.** The user fills in the details and selects whether the list is public or private. |
| | 11 | |
| | 12 | **4.** The system inserts a new record into the READING_LIST table. |
| | 13 | {{{#!sql |
| | 14 | INSERT INTO READING_LIST (name, content, is_public, user_id, created_at, updated_at) |
| | 15 | VALUES ('Sara''s Fantasy Favorites', |
| | 16 | 'My collection of the best fantasy stories with strong female leads', |
| | 17 | TRUE, 4, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); |
| | 18 | }}} |
| | 19 | |
| | 20 | **5.** The system confirms the reading list was created and redirects the user to their new empty list. |
| | 21 | |
| | 22 | **6.** The system displays the reading list with zero stories added yet. |
| | 23 | {{{#!sql |
| | 24 | SELECT rl.list_id, rl.name, rl.content, rl.is_public, COUNT(rli.story_id) AS total_stories |
| | 25 | FROM READING_LIST rl |
| | 26 | LEFT JOIN READING_LIST_ITEMS rli ON rl.list_id = rli.list_id |
| | 27 | WHERE rl.user_id = 4 |
| | 28 | GROUP BY rl.list_id; |
| | 29 | }}} |