[JITERA] Implement ReaderBook Module for Managing Reader-Book Relationships
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
-
Create ReaderBook Model:
- Implemented the schema for the
ReaderBookmodel inmodels/ReaderBook.js. This model defines the relationship between readers and books, including necessary fields such asreaderIdandbookId.
- Implemented the schema for the
-
Create ReaderBook Controller:
- Developed the
readerBookControllerincontrollers/readerBookController.js. This controller includes functions to create, read, update, and delete reader-book relationships.
- Developed the
-
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.
- Implemented business logic in
-
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.
- Set up the routes for reader-book operations in
-
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.
- Integrated the reader-book routes into the main server setup in
This module will enhance the application's capability to manage reader and book interactions effectively.