Livoa LogoLivoa
Online Food Delivery System – E-R Diagram
Restaurant PK restaurant_id name cuisine_type phone
Menu_Category PK category_id FK restaurant_id = Restaurant.restaurant_id
Menu_Item PK item_id FK restaurant_id = Restaurant.restaurant_id FK category_id = Menu_Category.category_id name description price is_available (bool)
Driver PK driver_id name phone vehicle_type license_plate
Delivery PK delivery_id FK order_id = Order.order_id (UNIQUE) FK driver_id = Driver.driver_id (nullable) pickup_time dropoff_time delivery_fee status {ASSIGNED, PICKED_UP, DELIVERED, CANCELED}
Restaurant_Location PK location_id FK restaurant_id = Restaurant.restaurant_id name street city state zip open_time close_time delivery_radius_km
Customer PK customer_id name email (UNIQUE) phone created_at
Address PK address_id FK customer_id = Customer.customer_id label street city state zip is_default (bool)
Order PK order_id FK customer_id = Customer.customer_id FK address_id = Address.address_id FK location_id = Restaurant_Location.location_id order_datetime status {PLACED, CONFIRMED, PREPARING, OUT_FOR_DELIVERY, DELIVERED, CANCELED} total_amount payment_status {PENDING, PAID, FAILED}
Order_Item PK (order_id, item_id) FK order_id = Order.order_id FK item_id = Menu_Item.item_id quantity unit_price
Payment PK payment_id FK order_id = Order.order_id (UNIQUE) method {CARD, CASH, WALLET} amount status {PENDING, SUCCESS, FAILED, REFUNDED} paid_at txn_ref
Promotion PK promo_id FK restaurant_id = Restaurant.restaurant_id (nullable) code (UNIQUE) description discount_type {PCT, AMOUNT} discount_value start_date end_date min_order_amount is_active (bool)
Order_Promotion PK (order_id, promo_id) FK order_id = Order.order_id FK promo_id = Promotion.promo_id

m

by k

0
0 uses