Skip to content

[JITERA] Add Book Service for Managing Book Data

Klebson Leite requested to merge feat/add-book-service-1747755710 into main

Overview

This pull request introduces a new service for managing book data within the application. The bookService.js file provides essential functions for creating, retrieving, updating, and deleting book records.

Changes Explained

  • Created bookService.js: This file contains the core functionality for handling book data.

    • addBook(book): A function to add a new book to the database.
    • getBookById(id): A function to retrieve a book's details by its ID.
    • updateBook(id, updatedData): A function to update the details of an existing book.
    • deleteBook(id): A function to remove a book from the database.
  • Error Handling: Each function includes error handling to manage potential issues, such as missing data or database errors.

  • Unit Tests: Basic unit tests have been added to ensure the functionality of the book service methods.

This service will serve as a foundation for future features related to book management in the application.

Merge request reports