Answer the question
In order to leave comments, you need to log in
How to design this "colossus"?
I'm building a food delivery website.
Customers place an order. The order can be single (single) and joint (joint).
A single order - nothing special, a row in the database with columns ID , customer , cost , status , etc.
Joint order - an order that several customers make, they are combined into so-called "groups" - there they have a chat, there they they see who they order food with, see the order status, price, etc. Joint orders are also put into the orders table marked "joint"
The site works only through the rest API. The order scheme is as follows:
Answer the question
In order to leave comments, you need to log in
A single order is a special case of a group order.
I would make an order entity, and an order item entity, and link them 1 to many.
Single order - 1 order entity - 1 order item entity
Group order - 1 order entity - N order item entities.
The status, of course, belongs to the order, when the status changes, only the essence of the order changes, and the order items are not touched.
Something like this, taking into account that the other points of the TK are not known to me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question