Skip to content

[JITERA] Implement Reader-Book Management Module

chi le requested to merge feat/reader-book-management-1749195054 into main

Created by: chi-jitera

Overview

This pull request introduces a new module to manage the relationships between readers and books. It includes the creation of a ReaderBook model, a controller for handling operations, a service for business logic, and routes for API endpoints. This module will allow us to track which reader is reading which books effectively.

Changes

  1. ReaderBook Model:

    • Created models/ReaderBook.js to define the schema for the ReaderBook model. This model establishes a many-to-many relationship between readers and books, allowing us to track which reader is associated with which book.
  2. ReaderBook Controller:

    • Implemented controllers/readerBookController.js to handle CRUD operations related to reader-book relationships. This includes functions to create, read, update, and delete records in the ReaderBook model.
  3. ReaderBook Service:

    • Developed services/readerBookService.js to encapsulate the business logic for managing reader-book relationships. This service interacts with the ReaderBook model and provides methods that the controller can call.
  4. ReaderBook Routes:

    • Set up routes/readerBookRoutes.js to define the API endpoints for reader-book operations. This includes routes for creating, retrieving, updating, and deleting reader-book relationships.
  5. Server Integration:

    • Updated server.js to include the newly created reader-book routes, ensuring that the application can handle requests related to reader-book management.

This implementation provides a comprehensive solution for managing the relationships between readers and books, enhancing the overall functionality of the application.

Merge request reports