Closed IkkiOcean closed 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
daneizo | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 21, 2024 11:56am |
@SaranshBangar please look into my pr soon
Description
This PR introduces two new Mongoose models:
RentalItem
andItem
. These models will help manage rental items and track rental histories effectively in our rental application.Changes Made
Added Item Model:
Item
model schema with the following fields:name
: String, requireddescription
: String, requiredcategory
: String, requiredpricePerDay
: Number, requiredavailability
: Boolean, default to truecreatedAt
: Date, default to the current dateupdatedAt
: Date, default to the current dateAdded RentalItem Model:
RentalItem
model schema with the following fields:itemId
: Reference to theItem
modeluserId
: Reference to theUser
model (to be defined)rentalStartDate
: Date, requiredrentalEndDate
: Date, requiredtotalPrice
: Number, calculated based on rental durationstatus
: String, to track rental status (e.g., active, completed, overdue)Implementation Details
Both models are located in the
/models
directory:models/Item.js
models/RentalItem.js
Used Mongoose schema validation to ensure data integrity.
Related Issues
Closes # [Issue number related to model creation]
Screenshots (if applicable)
[Include any relevant screenshots or logs]