The ID of the user creating the comment. This is typically extracted from the session or authentication token.
The ID of the book for which the comment is being created.
A promise resolving to the created comment.
Creates a new comment for a given book ID. The comment is associated with the user who created it, and the text of the comment is provided in the request body. This method is used to allow users to share their thoughts and opinions about a book by adding comments.
The ID of the comment for which to create a like.
The ID of the user creating the like.
A promise resolving to the created like.
The ID of the comment to be deleted.
Deletes an existing comment identified by its ID. This method allows users to remove their comments if they no longer wish to have them displayed, or if they want to delete inappropriate content.
InternalServerErrorException - If there is an error while deleting the comment from the database.
This method also updates the book statistics by decrementing the review count for the associated book. If the specified comment does not exist, a NotFoundException is thrown. If the user is not the owner of the comment, a ForbiddenException is thrown. If there is an error while deleting the comment, an InternalServerErrorException is thrown.
The ID of the comment for which to delete the like.
The ID of the user deleting the like.
A promise resolving to the deleted like.
The ID of the book for which to retrieve comments. *
A list of comments associated with the given book ID. Each comment includes the text of the comment, the creation date, and user information (nickname, email, smaller profile picture).
Retrieves a list of comments associated with a given book ID. The comments are ordered by creation date in descending order and include user information such as nickname, email, and smaller profile picture. This method is used to display the comments section for a book, allowing users to see what others have said about the book.
The ID of the user for whom to retrieve the comment history.
A list of comments made by the specified user. Each comment includes the text of the comment, the creation date, information about the associated book, and the number of likes for the comment.
Retrieves a list of comments made by a specific user. The comments are ordered by creation date in descending order and include information about the associated book and the number of likes for each comment. This method is used to display a user's comment history, allowing them to see all the comments they have made across different books.
The ID of the book that the user has read.
The ID of the user who has read the book.
A promise resolving to the created record indicating that the user has read the book.
Creates a record indicating that a user has read a specific book. This method is used to track which books a user has read, allowing for features such as personalized recommendations and reading history.
If the user has already marked the book as read, this method will not create a duplicate record and will not increment the readers count for the book. If the specified book does not exist, a NotFoundException is thrown. If there is an error while creating the record, an InternalServerErrorException is thrown.
The ID of the author that the user likes.
The ID of the user who likes the author.
A promise resolving to the created record indicating that the user likes the author.
Creates a record indicating that a user likes a specific author. This method is used to track which authors a user has liked, allowing for features such as personalized recommendations and favorite author lists.
The ID of the book that the user likes.
The ID of the user who likes the book.
A promise resolving to the created record indicating that the user likes the book.
Creates a record indicating that a user likes a specific book. This method is used to track which books a user has liked, allowing for features such as personalized recommendations and favorite book lists.
If the user has already liked the book, this method will not create a duplicate record and will not increment the wantToReadCount for the book. If the specified book does not exist, a NotFoundException is thrown. If there is an error while creating the record, an InternalServerErrorException is thrown.
The ID of the book to be rated.
The ID of the user who is rating the book.
The DTO containing the rating score.
A promise resolving to the created rating record.
Creates a rating record for a specific book by a user. This method is used to allow users to rate books, which helps in generating personalized recommendations and maintaining book popularity metrics.
The ID of the author that the user wants to unlike.
The ID of the user who wants to unlike the author.
A promise resolving to the deleted record indicating that the user no longer likes the author.
Deletes a record indicating that a user likes a specific author. This method is used to allow users to remove their like from an author if they no longer wish to express their appreciation for them.
The ID of the book that the user wants to unlike.
The ID of the user who wants to unlike the book.
A promise resolving to the deleted record indicating that the user no longer likes the book.
Deletes a record indicating that a user likes a specific book. This method is used to allow users to remove their like from a book if they no longer wish to express their appreciation for it.
The ID of the comment to be updated.
An object containing the new text for the comment. The text must be between 1 and 500 characters long.
A promise resolving to the updated comment.
Updates the text of an existing comment identified by its ID. The new text for the comment is provided in the request body. This method allows users to edit their comments after they have been created, enabling them to correct mistakes or update their opinions.
The ID of the book for which the rating is to be updated.
The ID of the user who is updating the rating.
The DTO containing the new rating score.
A promise resolving to the updated rating record.
Updates an existing rating record for a specific book by a user. This method allows users to change their rating for a book, which helps in maintaining accurate and up-to-date book ratings.
If the specified book does not exist, a NotFoundException is thrown. If there is an error while updating the rating record, an InternalServerErrorException is thrown.
An object containing the text of the comment to be created.