[JITERA] Add Reader Model
Created by: chi-jitera
Overview
This pull request introduces a new Mongoose model for managing readers in the application. The Reader model includes fields for storing reader information and tracking borrowed books.
Changes
-
Reader Schema:
- Added a new schema for the
Readermodel located in/models/Reader.js. - The schema includes the following fields:
-
name: A required string field to store the reader's name. -
contactInfo: A required string field to store the reader's contact information. -
borrowedBooks: An array of objects that track the books borrowed by the reader. Each object contains:-
book: A reference to theBookmodel. -
borrowDate: The date the book was borrowed, defaulting to the current date. -
returnDate: The date the book was returned (optional). -
status: A string that indicates whether the book is 'borrowed' or 'returned', defaulting to 'borrowed'. -
dueDate: The date by which the book should be returned (optional).
-
-
- Added a new schema for the
This model will facilitate the management of readers and their borrowed books within the application.