CoffeeShop

Tables (6)

coffee_menu

  • menu_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • price — INT — NOT NULL
  • is_available — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

coffee_order

  • order_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user_point.user_id — NOT NULL
  • total_amount — INT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • paid_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL

coffee_order_item

  • order_item_id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → coffee_order.order_id — NOT NULL
  • menu_id — BIGINT — Foreign key → coffee_menu.menu_id — NOT NULL
  • menu_name — VARCHAR(50) — NOT NULL
  • unit_price — INT — NOT NULL
  • quantity — INT — NOT NULL

outbox_event

  • event_id — BIGINT — Primary key — NOT NULL
  • aggregate_type — VARCHAR(30) — NOT NULL
  • aggregate_id — BIGINT — NOT NULL
  • event_type — VARCHAR(50) — NOT NULL
  • payload — TEXT — NOT NULL
  • published_at — DATETIME
  • created_at — DATETIME — NOT NULL

point_charge

  • point_charge_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user_point.user_id — NOT NULL
  • request_id — VARCHAR(100) — NOT NULL
  • charge_amount — INT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL

user_point

  • user_id — BIGINT — Primary key — NOT NULL
  • balance — BIGINT — NOT NULL
  • version — BIGINT — NOT NULL
  • updated_at — DATETIME — NOT NULL