Skip to content

[JITERA] Implement ReaderBook Module for Managing Reader-Book Relationships

chi le requested to merge feat/reader-book-management-1749195090 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, controller, service, and routes, allowing for efficient tracking of which reader is reading which books.

Changes

  1. Create ReaderBook Model:

    • Implemented the schema for the ReaderBook model in models/ReaderBook.js. This model defines the relationship between readers and books, including necessary fields such as readerId and bookId.
  2. Create ReaderBook Controller:

    • Developed the readerBookController in controllers/readerBookController.js. This controller includes functions to create, read, update, and delete reader-book relationships.
  3. Create ReaderBook Service:

    • Implemented business logic in services/readerBookService.js. This service handles the core functionality related to reader-book relationships, such as validating data and interacting with the database.
  4. Define Routes for ReaderBook:

    • Set up the routes for reader-book operations in routes/readerBookRoutes.js. This includes endpoints for managing reader-book relationships, such as adding a new relationship and retrieving existing ones.
  5. Update Server to Include ReaderBook Routes:

    • Integrated the reader-book routes into the main server setup in server.js, ensuring that the application can handle requests related to reader-book relationships.

This module will enhance the application's capability to manage reader and book interactions effectively.

Merge request reports