In my e-commerce application I would like that buyers and sellers interact via a messaging system to purchase products.
The process consists of:
- The buyer inquiring for a product
- The seller responds with a quote
- The buyer can negotiate
- The seller can create / modify the quote based on negotiations
- The buyer accepts quote which is then transformed into an order
- The seller sends an invoice to the buyer
It's also possible that a buyer immediately starts an order when he accepts the price listed for the product.
I'm a bit clueless as how to model this in a database. Do I create a table for Enquiries, for Quotes and for Orders? Can I use a status table to maintain the type of object? But with a table I then need to keep versions of it for every change that occurs I think? And then how do I link it to a message?
It may seem a lot of questions, but I simply don't know how to tackle this.
The following diagram is a part of my database scheme so that you have an idea of how my it is designed for the moment: