Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Backend Schema For Rental and Lease products #681

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

J-B-Mugundh
Copy link
Contributor

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

  • Type: ObjectId (Reference to the User model)
  • Description: References the user (typically a farmer or vendor) who owns or has listed the product.

productName

  • Type: String
  • Description: The name of the product, such as "Tractor," "Fertilizer," or "Seeds."

productType

  • Type: String (Enumeration)
  • Options: ['Equipment', 'Land', 'Seeds', 'Fertilizers', 'Other']
  • Description: Specifies the category of the product, allowing users to filter or search by type.

description

  • Type: String
  • Description: Detailed description of the product, including features, usage, or benefits.

price

  • Type: Number
  • Description: The price of the product, which could be per day, per hour, or a total cost depending on the priceType.

priceType

  • Type: String (Enumeration)
  • Options: ['Rent', 'Lease', 'Sell', 'Buy']
  • Description: The transaction type, indicating whether the product is available for rent, lease, sale, or purchase.

availability

  • Type: 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

  • Type: 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.
  • Description: Location details of the product, allowing for regional or local searches.

contactDetails

  • Type: Object
    • phone: String — Contact phone number for inquiries.
    • email: String — Contact email for inquiries.
  • Description: Contact details to reach the owner regarding the product.

condition

  • Type: String
  • Description: Describes the product's condition, such as "New" or "Used."

imageUrl

  • Type: String
  • Description: URL link to an image of the product, allowing users to visualize the item.

postedDate

  • Type: Date
  • Default: Date.now
  • Description: The date when the product was listed, automatically set to the current date.

isAvailable

  • Type: Boolean
  • Default: true
  • Description: Indicates whether the product is currently available or not.

Related Issues

Fixes #634

Changes Made

Added AgriProductSchema along with controllers, middleware, routes.

Checklist

  • I have tested the changes locally
  • Documentation has been updated (if necessary)
  • Changes are backward-compatible

Screenshots (if applicable)

image

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.

Copy link

vercel bot commented Oct 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agro-tech-ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 26, 2024 2:56pm

Copy link
Contributor

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@J-B-Mugundh
Copy link
Contributor Author

J-B-Mugundh commented Oct 26, 2024

@manikumarreddyu please check if the fields in the schema looks good or let me know if I need to add any more.

Following this, I'm starting to work on the issues for the features I have mentioned in additonal notes.

@manikumarreddyu manikumarreddyu merged commit 44bd4ac into manikumarreddyu:main Oct 26, 2024
4 checks passed
Copy link
Contributor

🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Creating Backend Schema For Rental and Lease products
2 participants