delivery

Tables (15)

Cart

  • cart_id — INT — Primary key — NOT NULL
  • customer_id — INT — Foreign key → Customer.customer_id — NOT NULL
  • created_at — Datetime
  • updated_at — Datetime
  • status — VARCHAR(50)
  • total_price — DECIMAL(10,2)

CartItem

  • cart_item_id — INT — Primary key — NOT NULL
  • cart_id — INT — Foreign key → Cart.cart_id — NOT NULL
  • menu_id — INT — Foreign key → Menu.menu_id — NOT NULL
  • quantity — INT — NOT NULL
  • created_at — Datetime
  • updated_at — Datetime
  • price — DECIMAL(10,2)

Customer

  • customer_id — INT — Primary key — NOT NULL
  • name — VARCHAR(255)
  • email — VARCHAR(255)
  • created_at — Datetime
  • updated_at — Datetime
  • phone — VARCHAR(255)

CustomerPromotion

  • customerPromotion_id — INT — Primary key — NOT NULL
  • customer_id — INT — Foreign key → Customer.customer_id — NOT NULL
  • promotion_id — INT — Foreign key → Promotion.promotion_id — NOT NULL
  • applied_at — DATETIME — NOT NULL
  • created_at — Datetime
  • updated_at — Datetime

Delivery

  • delivery_id — INT — Primary key — NOT NULL
  • order_id — INT — Foreign key → Orders.order_id — NOT NULL
  • delivery_person_id — INT — Foreign key → DeliveryPerson.delivery_person_id — NOT NULL
  • status — VARCHAR(50)
  • created_at — Datetime
  • updated_at — Datetime
  • delivery_address — VARCHAR(255)

DeliveryPerson

  • delivery_person_id — INT — Primary key — NOT NULL
  • name — VARCHAR(255)
  • created_at — Datetime
  • updated_at — Datetime
  • phone — VARCHAR(255)

Menu

  • menu_id — INT — Primary key — NOT NULL
  • store_id — INT — Foreign key → Store.store_id — NOT NULL
  • name — VARCHAR(255)
  • price — DECIMAL(10,2)
  • image — VARCHAR(255)
  • created_at — Datetime
  • updated_at — Datetime

Notification

  • notification_id — INT — Primary key — NOT NULL
  • customer_id — INT — Foreign key → Customer.customer_id — NOT NULL
  • message — TEXT — NOT NULL
  • is_read — BOOLEAN
  • created_at — Datetime
  • updated_at — Datetime

OrderItem

  • order_item_id — INT — Primary key — NOT NULL
  • order_id — INT — Foreign key → Orders.order_id — NOT NULL
  • menu_id — INT — Foreign key → Menu.menu_id — NOT NULL
  • quantity — INT
  • created_at — Datetime
  • updated_at — Datetime
  • store_id — INT

Orders

  • order_id — INT — Primary key — NOT NULL
  • customer_id — INT — Foreign key → Customer.customer_id — NOT NULL
  • store_id — INT — Foreign key → Store.store_id — NOT NULL
  • order_date — Datetime
  • status — VARCHAR(50)
  • created_at — Datetime
  • updated_at — Datetime
  • total_price — DECIMAL(10,2)

Payment

  • payment_id — INT — Primary key — NOT NULL
  • order_id — INT — Foreign key → Orders.order_id — NOT NULL
  • amount — DECIMAL(10,2)
  • payment_date — Datetime
  • created_at — Datetime
  • updated_at — Datetime

Promotion

  • promotion_id — INT — Primary key — NOT NULL
  • store_id — INT — Foreign key → Store.store_id — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • description — VARCHAR(255)
  • discount_percentage — DECIMAL(5,2) — NOT NULL
  • start_date — Datetime — NOT NULL
  • end_date — Datetime — NOT NULL
  • created_at — Datetime
  • updated_at — Datetime

Review

  • review_id — INT — Primary key — NOT NULL
  • customer_id — INT — Foreign key → Customer.customer_id — NOT NULL
  • store_id — INT — Foreign key → Store.store_id — NOT NULL
  • owner_id — INT — Foreign key → Store.owner_id — NOT NULL
  • rating — INT
  • comment — VARCHAR(500) — EX
  • created_at — Datetime
  • updated_at — Datetime

Store

  • store_id — INT — Primary key — NOT NULL
  • owner_id — INT — Foreign key → StoreOwner.owner_id — NOT NULL
  • name — VARCHAR(255)
  • created_at — Datetime
  • updated_at — Datetime

StoreOwner

  • owner_id — INT — Primary key — NOT NULL
  • name — VARCHAR(255)
  • email — VARCHAR(255)
  • created_at — Datetime
  • updated_at — Datetime
  • phone — VARCHAR(255)