Real Time
1. Store Management:
Store Table:
- Represents individual stores or restaurants.
- Each
Storeis uniquely identified by anid. - Has a
nameto represent the name of the store. - Each store is associated with a
userId, indicating which user manages or owns that store.
2. Product and Category Management:
Category Table:
- Represents the various categories of products (like "Appetizers", "Main Course", etc.).
- Each
Categoryis associated with a particularStorethroughstoreId. - Each category can also be associated with a
Billboard(which seems to be an advertisement or featured display for that category) usingbillboardId.
Product Table:
- Represents the individual items or dishes available for order in a store.
- Each
Productis associated with a particularCategorythroughcategoryId. - Products have various attributes like
name,price,description, and flags to indicate if they areisFeaturedorisArchived.
Image Table:
- Represents images of individual products.
- Each image is linked to a
Productvia theproductId. - Contains a URL (
url) pointing to the actual image file.
3. Table Management and Ordering:
Table Table (a bit of a tongue-twister):
- Represents the physical tables inside a store.
- Each table is associated with a particular
StorethroughstoreId. - Tables have an
isPaidflag to indicate if the current orders on that table have been paid or not.
Order Table:
- Represents orders placed by customers.
- Each order is linked to a
Storevia thestoreId. - Orders have different states, represented by the
orderStateenum. It can be "NOTREADY", "IN_PROGRESS", "READY", or "PAID". - The
isPaidflag indicates if the order has been paid for or not. - Each order is associated with a table through
tableId, indicating where the order is placed.
OrderItem Table:
- Represents individual items within an order.
- Each
OrderItemis linked to a specific order usingorderIdand to a specific product usingproductId. - The
countrepresents the quantity of that product in the order.
4. Billboard Management:
Billboard Table:
- Represents billboards or advertisements for specific categories or promotional events.
- Each billboard is associated with a specific
StorethroughstoreId. - Has attributes like
labelandimageUrlto display the content of the billboard.
Relationships:
- A user can manage multiple stores, but each store is associated with only one user.
- Each store can have multiple tables, categories, products, billboards, and orders.
- A category belongs to one store and can be associated with one billboard.
- A product belongs to one category and one store.
- Each product can have multiple images.
- An order is associated with one store and one table and can have multiple order items.
- An order item is linked to one product and one order.
- Each billboard is associated with one store.