mohamedsamara / mern-ecommerce

:balloon: Fullstack MERN Ecommerce Application
https://mern-store-gold.vercel.app
MIT License
1.63k stars 770 forks source link

Product based order statuses? #229

Open monecchi opened 6 months ago

monecchi commented 6 months ago

Hi there! First thing first, thanks for your project! It has helped me a lot with a personal project.

Regarding the order statuses and the way they are now implemented, depending on the business model, a "shop" might prefer to apply statuses only to the order itself instead of individual order items.

Also regarding the "cancellation action" customers can perform, a shop might not want customers to be able to cancel individual order items, but preferably the whole order itself.

As of now, all cancelled orders are deleted from database, but a shop might want them stored for later control, filtering, customer order history etc. Perhaps, it'd be a good idea to bring some logic with an option for storing them for 30 days or indefinetly if it comes to it.

Perhaps a better approach for the "cancellation action" would be to provide a separate mongoose model and api on the server side defined as "Cancellation Request". The Cancellation Request model would contain the order and order items as also a "reason" text posted by customers.

Every time customers cancel an order & order item(s), Admins and Merchants would be able to check "cancellation requests" by filtering orders by order.status so they could analyze and then approve or decline those cancelled orders.

Best regards!