[JITERA] Implement Reader Management Module
Created by: chi-jitera
Overview
This pull request introduces a new module for managing readers, which includes the implementation of a Reader Model, Service, Controller, and Routes. This module allows for the creation, retrieval, updating, and deletion of reader data through defined API endpoints.
Changes
-
Reader Model (
models/Reader.js):- Defined a schema for the Reader model to represent reader data, including fields such as
name,email, andmembershipDate.
- Defined a schema for the Reader model to represent reader data, including fields such as
-
Reader Service (
services/readerService.js):- Implemented business logic for managing readers, including functions for creating, retrieving, updating, and deleting reader records.
-
Reader Controller (
controllers/readerController.js):- Created a controller to handle HTTP requests related to readers. This includes methods for handling CRUD operations and responding with appropriate status codes and messages.
-
Reader Routes (
routes/readerRoutes.js):- Defined API endpoints for reader operations, mapping HTTP methods to the corresponding controller functions.
-
Update
server.js:- Integrated the new reader routes into the main server file to ensure that the application can handle requests related to readers.
These changes collectively create a robust module for managing readers, facilitating easy interaction with reader data through a RESTful API.