AGelstein / next-bud-ecom

Marijuana ecom store
0 stars 0 forks source link

Discuss and document data structures #3

Open AGelstein opened 1 year ago

AGelstein commented 1 year ago

Product: id: unique identifier name: name of the product description: description of the product price: price of the product image: URL or file path of the product image category: category the product belongs to stock: available stock of the product

Category: id: unique identifier name: name of the category description: description of the category products: array of product IDs that belong to the category

User: id: unique identifier name: name of the user email: email address of the user password: hashed password of the user address: user's shipping address cart: array of product IDs added to the user's cart orders: array of order IDs placed by the user

Order: id: unique identifier user: ID of the user who placed the order products: array of product IDs included in the order totalPrice: total price of the order status: current status of the order (e.g., "pending", "shipped", "delivered") createdAt: timestamp indicating when the order was created

This is just a basic starting point, and you can expand or modify these data structures based on the specific requirements of your ecommerce weed store. Additionally, you may want to consider incorporating database models, such as using an ORM (Object-Relational Mapping) library like Prisma or an ODM (Object-Document Mapping) library if using a NoSQL database like MongoDB.

colburncodes commented 1 year ago

Review: id: unique identifier user: ID of the user who left a review product: ID of the product which has the review rating: stores the rating given by the user for the product. comment: user's review comment or feedback about the product. createdAt: timestamp when the review was created.

*Note to update the Product model to have an array of Reviews.