diff --git a/bruno/ebooks/Create-Update Ebook Rating.bru b/bruno/ebooks/Create-Update Ebook Rating.bru index dc3ee60..95031d7 100644 --- a/bruno/ebooks/Create-Update Ebook Rating.bru +++ b/bruno/ebooks/Create-Update Ebook Rating.bru @@ -12,7 +12,7 @@ post { body:json { { - "rating": 4 + "rating": 7 } } @@ -32,18 +32,24 @@ docs { - `id` (string): Ebook UUID **Request Body:** - - `rating` (number, required): Rating value (1-5) + - `rating` (number, required): Rating value (1-10, where odd numbers = half-stars) + - 1,3,5,7,9 = 0.5,1.5,2.5,3.5,4.5 stars (half-star precision) + - 2,4,6,8,10 = 1,2,3,4,5 stars (full stars) + + **Example Request:** + - `"rating": 7` = 3.5 stars (frontend display) + - `"rating": 8` = 4.0 stars (frontend display) **Response:** - `id` (string): Rating UUID - `ebook_id` (string): Ebook UUID - `user_id` (string): User UUID - - `rating` (number): Rating value (1-5) + - `rating` (number): Rating value (1-10) - `created_at` (string): Creation timestamp - `updated_at` (string): Last update timestamp **Error Responses:** - - 400: Invalid rating value + - 400: Invalid rating value (must be 1-10) - 401: Invalid authentication - 404: Ebook not found } diff --git a/bruno/ebooks/Get Ebook Rating.bru b/bruno/ebooks/Get Ebook Rating.bru index 5f3f0cd..4d2aa74 100644 --- a/bruno/ebooks/Get Ebook Rating.bru +++ b/bruno/ebooks/Get Ebook Rating.bru @@ -29,7 +29,7 @@ docs { - `id` (string): Rating UUID - `ebook_id` (string): Ebook UUID - `user_id` (string): User UUID - - `rating` (number): Rating value (1-5) + - `rating` (number): Rating value (1-10, where odd numbers = half-stars) - `created_at` (string): Creation timestamp - `updated_at` (string): Last update timestamp @@ -41,5 +41,10 @@ docs { **Error Responses:** - 401: Invalid authentication + **Rating System:** + - Backend: 1-10 scale (odd numbers = half-stars: 1,3,5,7,9) + - Frontend: 1-5 stars with half-star precision (0.5, 1.5, 2.5, 3.5, 4.5) + - Example: Backend rating 3 = Frontend display 1.5 stars + **Note:** This endpoint returns HTTP 200 with rating 0 when no rating exists, instead of HTTP 404. } \ No newline at end of file diff --git a/bruno/ebooks/Get Ebook Ratings.bru b/bruno/ebooks/Get Ebook Ratings.bru index e853ef2..9782001 100644 --- a/bruno/ebooks/Get Ebook Ratings.bru +++ b/bruno/ebooks/Get Ebook Ratings.bru @@ -29,10 +29,14 @@ docs { - `id` (string): Rating UUID - `ebook_id` (string): Ebook UUID - `user_id` (string): User UUID - - `rating` (number): Rating value (1-5) + - `rating` (number): Rating value (1-10, where odd numbers = half-stars) - `created_at` (string): Creation timestamp - `updated_at` (string): Last update timestamp - `username` (string): Username of the rating user + + **Rating Conversion:** + - Frontend displays: 1-5 stars with half-star precision + - Backend stores: 1-10 (where 1,3,5,7,9 = half-stars) **Error Responses:** - 401: Invalid authentication