c1oud-mall

Tables (10)

cart_item

  • id — BIGINT
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → product.id — NOT NULL
  • quantity — INT — NOT NULL

order_items

  • id — BIGINT
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • product_id — BIGINT — Foreign key → product.id — NOT NULL
  • product_name_snapshot — VARCHAR(255) — NOT NULL
  • price_snapshot — BIGINT — NOT NULL
  • quantity — INT — NOT NULL
  • refunded_quantity — INT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

orders

  • id — BIGINT
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • order_number — VARCHAR(80) — NOT NULL
  • order_status — VARCHAR(20) — NOT NULL
  • total_amount — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

payments

  • id — BIGINT
  • portone_payment_id — VARCHAR(36) — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • user_id — BIGINT — NOT NULL
  • total_amount — BIGINT — NOT NULL
  • pg_amount — BIGINT — NOT NULL
  • point_used_amount — BIGINT — NOT NULL
  • point_earned_amount — BIGINT — NOT NULL
  • status — VARCHAR(16) — NOT NULL
  • confirmed_at — DATETIME(6)
  • pg_tx_id — VARCHAR(100)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

point_histories

  • id — BIGINT
  • user_id — BIGINT — NOT NULL
  • order_id — BIGINT — NOT NULL
  • payment_id — BIGINT — NOT NULL
  • refund_id — BIGINT
  • transaction_type — VARCHAR(20) — NOT NULL
  • amount — BIGINT — NOT NULL
  • balance_after — BIGINT — NOT NULL
  • description — VARCHAR(255)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

product

  • id — BIGINT
  • product_name — VARCHAR(255) — NOT NULL
  • price — BIGINT — NOT NULL
  • stock_quantity — INT — NOT NULL
  • category — VARCHAR(255) — NOT NULL
  • product_status — VARCHAR(255) — NOT NULL
  • product_description — TEXT
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

refund_items

  • id — BIGINT
  • refund_id — BIGINT — Foreign key → refunds.id — NOT NULL
  • order_item_id — BIGINT — NOT NULL
  • quantity — INT — NOT NULL
  • price_snapshot_at_payment — BIGINT — NOT NULL
  • item_refund_amount — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

refunds

  • id — BIGINT
  • payment_id — BIGINT — Foreign key → payments.id — NOT NULL
  • user_id — BIGINT — NOT NULL
  • reason — VARCHAR(255)
  • status — VARCHAR(20) — NOT NULL
  • pg_refund_amount — BIGINT — NOT NULL
  • point_refund_amount — BIGINT — NOT NULL
  • requested_at — DATETIME(6) — NOT NULL
  • db_committed_at — DATETIME(6)
  • pg_cancelled_at — DATETIME(6)
  • pg_cancel_tx_id — VARCHAR(100)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

users

  • id — BIGINT
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • phone_number — VARCHAR(255) — NOT NULL
  • role — VARCHAR(255) — NOT NULL
  • point_balance — BIGINT — NOT NULL
  • deleted_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

webhook_events

  • id — BIGINT
  • portone_payment_id — VARCHAR(36) — Foreign key → payments.portone_payment_id — NOT NULL
  • event_type — VARCHAR(50) — NOT NULL
  • webhook_id — VARCHAR(100)
  • received_at — DATETIME(6) — NOT NULL
  • processed_at — DATETIME(6)
  • process_status — VARCHAR(16) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL