Changes between Initial Version and Version 1 of UserReadsAChapter


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

--

Legend:

Unmodified
Added
Removed
Modified
  • UserReadsAChapter

    v1 v1  
     1==  User Reads a Chapter
     2
     3=== Actor: **Guest User / Regular User / Writer**
     4A user opens and reads a specific chapter of a story, and the system records the view count for that chapter.
     5**1.** The user selects a chapter from the story page.
     6
     7**2.** The system retrieves the full chapter content.
     8{{{#!sql
     9SELECT chapter_id, chapter_number, chapter_name, title,
     10       content, word_count, rating, published_at, view_count
     11FROM CHAPTER
     12WHERE chapter_id = 1 AND story_id = 1;
     13}}}
     14
     15**3.** The system increments the view count for that chapter.
     16{{{#!sql
     17UPDATE CHAPTER
     18SET view_count = view_count + 1,
     19    updated_at = CURRENT_TIMESTAMP
     20WHERE chapter_id = 1;
     21}}}
     22
     23**4.** The system displays navigation buttons to the previous and next chapters.
     24{{{#!sql
     25SELECT chapter_id, chapter_number, title
     26FROM CHAPTER
     27WHERE story_id = 1
     28AND chapter_number IN (
     29    (SELECT chapter_number - 1 FROM CHAPTER WHERE chapter_id = 1),
     30    (SELECT chapter_number + 1 FROM CHAPTER WHERE chapter_id = 1)
     31)
     32ORDER BY chapter_number ASC;
     33}}}
     34
     35**5.**The user finishes reading and navigates to the next chapter.