| | 1 | == User Adds a Story to a Reading List |
| | 2 | |
| | 3 | === Authors: ** Regular User / Writer** |
| | 4 | A user adds a published story to one of their existing reading lists for later reading. |
| | 5 | |
| | 6 | **1.** The user opens a published story they want to save. |
| | 7 | |
| | 8 | **2.** The user clicks "Add to Reading List". |
| | 9 | |
| | 10 | **3.** The system retrieves all reading lists belonging to the user. |
| | 11 | {{{#!sql |
| | 12 | SELECT list_id, name, is_public |
| | 13 | FROM READING_LIST |
| | 14 | WHERE user_id = 4; |
| | 15 | }}} |
| | 16 | |
| | 17 | **4.** The system displays the user's reading lists as options. |
| | 18 | |
| | 19 | **5.** The user selects which reading list to add the story to. |
| | 20 | |
| | 21 | **6.** The system checks if the story is already in the selected reading list. |
| | 22 | {{{#!sql |
| | 23 | SELECT * FROM READING_LIST_ITEMS |
| | 24 | WHERE list_id = 1 AND story_id = 1; |
| | 25 | }}} |
| | 26 | |
| | 27 | **7.** The system inserts the story into the selected reading list. |
| | 28 | {{{#!sql |
| | 29 | INSERT INTO READING_LIST_ITEMS (list_id, story_id, added_at) |
| | 30 | VALUES (1, 1, CURRENT_TIMESTAMP); |
| | 31 | }}} |
| | 32 | |
| | 33 | **8.** The system confirms the story was added and updates the reading list count. |