Creating Backend Schema For Rental and Lease products #681
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Title
Creating Backend Schema For Rental and Lease products
Description
Referenced many other applications as suggested by the admin and creating AgriProductSchema along with controllers, middleware, routes.
https://github.com/MohamedAmineALLAF/MERN_car_rental
https://github.com/VaibhavArora314/StyleShare
This schema represents agricultural products that users can list, including categories like equipment, land, seeds, and fertilizers. It supports various transaction types such as rent, lease, sale, or purchase and includes fields for product details, location, availability, and more.
Fields
owner
ObjectId
(Reference to theUser
model)productName
String
productType
String
(Enumeration)['Equipment', 'Land', 'Seeds', 'Fertilizers', 'Other']
description
String
price
Number
priceType
.priceType
String
(Enumeration)['Rent', 'Lease', 'Sell', 'Buy']
availability
Object
startDate
:String
— The date from which the product is available for rental/lease.endDate
:String
— The date until which the product is available for rental/lease.location
Object
address
:String
— Full address of the product's location.city
:String
— City where the product is located.state
:String
— State where the product is located.zipcode
:String
— Zipcode of the location.contactDetails
Object
phone
:String
— Contact phone number for inquiries.email
:String
— Contact email for inquiries.condition
String
imageUrl
String
postedDate
Date
Date.now
isAvailable
Boolean
true
Related Issues
Fixes #634
Changes Made
Added AgriProductSchema along with controllers, middleware, routes.
Checklist
Screenshots (if applicable)
Additional Notes
Following this, I would like to work on frontend side for displaying these products. Followed by which, I would work on admin side to CRUD products.