WebRTC ERD

Tables (22)

auction_participant

  • auction_participant_id — BIGINT — Primary key — NOT NULL
  • auction_room_id — BIGINT — Foreign key → auction_room.auction_room_id — NOT NULL
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • participation_type — VARCHAR(20) — NOT NULL
  • participated_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

auction_result

  • auction_result_id — BIGINT — Primary key — NOT NULL
  • auction_room_id — BIGINT — Foreign key → auction_room.auction_room_id — NOT NULL
  • result_status — VARCHAR(20) — NOT NULL
  • termination_reason — VARCHAR(30) — NOT NULL
  • winner_participant_id — BIGINT — Foreign key → auction_participant.auction_participant_id
  • winning_bid_id — BIGINT — Foreign key → bid.bid_id
  • highest_bid_amount — BIGINT
  • second_highest_bid_amount — BIGINT
  • final_price — BIGINT
  • valid_bidder_count — INT — NOT NULL
  • total_bid_count — INT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

auction_room

  • auction_room_id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL
  • reserve_price — BIGINT — NOT NULL
  • duration_minutes — INT — NOT NULL
  • start_type — VARCHAR(20) — NOT NULL
  • scheduled_at — TIMESTAMPTZ
  • started_at — TIMESTAMPTZ
  • ends_at — TIMESTAMPTZ
  • ended_at — TIMESTAMPTZ
  • extension_count — INT — NOT NULL
  • status — VARCHAR(30) — NOT NULL
  • openvidu_session_id — VARCHAR(100)
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

betting_point_ledger

  • betting_point_ledger_id — BIGINT — Primary key — NOT NULL
  • wallet_id — BIGINT — Foreign key → wallet.wallet_id — NOT NULL
  • transaction_type — VARCHAR(40) — NOT NULL
  • available_delta — BIGINT — NOT NULL
  • held_delta — BIGINT — NOT NULL
  • available_balance_after — BIGINT — NOT NULL
  • held_balance_after — BIGINT — NOT NULL
  • prediction_id — BIGINT — Foreign key → prediction.prediction_id
  • prediction_result_id — BIGINT — Foreign key → prediction_result.prediction_result_id
  • idempotency_key — VARCHAR(100) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

bid

  • bid_id — BIGINT — Primary key — NOT NULL
  • auction_participant_id — BIGINT — Foreign key → auction_participant.auction_participant_id — NOT NULL
  • amount — BIGINT — NOT NULL
  • sequence_no — INT — NOT NULL
  • idempotency_key — VARCHAR(100) — NOT NULL
  • submitted_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

chat_message

  • chat_message_id — BIGINT — Primary key — NOT NULL
  • auction_room_id — BIGINT — Foreign key → auction_room.auction_room_id — NOT NULL
  • sender_member_id — BIGINT — Foreign key → member.member_id
  • message_type — VARCHAR(20) — NOT NULL
  • content — TEXT — NOT NULL
  • moderation_status — VARCHAR(20) — NOT NULL
  • moderation_reason — VARCHAR(100)
  • is_pinned — BOOLEAN — NOT NULL
  • question_queue_status — VARCHAR(20)
  • is_deleted — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

deal

  • deal_id — BIGINT — Primary key — NOT NULL
  • auction_result_id — BIGINT — Foreign key → auction_result.auction_result_id — NOT NULL
  • seller_member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • buyer_member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • final_price — BIGINT — NOT NULL
  • escrow_amount — BIGINT — NOT NULL
  • escrow_status — VARCHAR(20) — NOT NULL
  • deal_status — VARCHAR(30) — NOT NULL
  • snapshot_image_url — VARCHAR(500)
  • created_at — TIMESTAMPTZ — NOT NULL
  • completed_at — TIMESTAMPTZ
  • cancelled_at — TIMESTAMPTZ
  • Key — Foreign key — NOT NULL

deal_shipping

  • deal_shipping_id — BIGINT — Primary key — NOT NULL
  • deal_id — BIGINT — Foreign key → deal.deal_id — NOT NULL
  • recipient_name — VARCHAR(50)
  • recipient_phone — VARCHAR(30)
  • postal_code — VARCHAR(20)
  • address — VARCHAR(255)
  • address_detail — VARCHAR(255)
  • carrier — VARCHAR(50)
  • tracking_number — VARCHAR(100)
  • address_submitted_at — TIMESTAMPTZ
  • shipped_at — TIMESTAMPTZ
  • received_confirmed_at — TIMESTAMPTZ
  • auto_confirm_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

member

  • member_id — BIGINT — Primary key — NOT NULL
  • nickname — VARCHAR(30)
  • role — VARCHAR(20) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • withdrawn_at — TIMESTAMPTZ

member_terms_agreement

  • member_terms_agreement_id — BIGINT — Primary key — NOT NULL
  • terms_id — BIGINT — Foreign key → terms.terms_id — NOT NULL
  • member_id (member_id2) — BIGINT — Foreign key → member.member_id — NOT NULL
  • is_agreed — BOOLEAN — NOT NULL
  • agreed_at — TIMESTAMPTZ
  • withdrawn_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

point_charge

  • point_charge_id — BIGINT — Primary key — NOT NULL
  • wallet_id — BIGINT — Foreign key → wallet.wallet_id — NOT NULL
  • order_id — VARCHAR(100) — NOT NULL
  • charge_point_amount — BIGINT — NOT NULL
  • payment_amount — BIGINT — NOT NULL
  • payment_provider — VARCHAR(30)
  • payment_key — VARCHAR(200)
  • status — VARCHAR(20) — NOT NULL
  • failure_code — VARCHAR(100)
  • failure_message — VARCHAR(500)
  • requested_at — TIMESTAMPTZ — NOT NULL
  • approved_at — TIMESTAMPTZ
  • cancelled_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key → wallet.Key — NOT NULL

prediction

  • prediction_id — BIGINT — Primary key — NOT NULL
  • auction_participant_id — BIGINT — Foreign key → auction_participant.auction_participant_id — NOT NULL
  • predicted_price — BIGINT — NOT NULL
  • stake_amount — BIGINT — NOT NULL
  • idempotency_key — VARCHAR(100) — NOT NULL
  • submitted_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

prediction_leaderboard

  • prediction_leaderboard_id — BIGINT — Primary key — NOT NULL
  • member_id (member_id2) — BIGINT — Foreign key → member.member_id — NOT NULL
  • ranking_date — DATE — NOT NULL
  • rank_no — INT — NOT NULL
  • score — BIGINT — NOT NULL
  • prediction_count — INT — NOT NULL
  • rewarded_count — INT — NOT NULL
  • lost_count — INT — NOT NULL
  • total_stake_amount — BIGINT — NOT NULL
  • total_payout_amount — BIGINT — NOT NULL
  • average_error_rate — NUMERIC(10, 6)
  • best_error_rate — NUMERIC(10, 6)
  • created_at — TIMESTAMPTZ — NOT NULL

prediction_result

  • prediction_result_id — BIGINT — Primary key — NOT NULL
  • prediction_id — BIGINT — Foreign key → prediction.prediction_id — NOT NULL
  • auction_result_id — BIGINT — Foreign key → auction_result.auction_result_id — NOT NULL
  • result_status — VARCHAR(20) — NOT NULL
  • error_rate — NUMERIC(8, 6)
  • reward_multiplier — NUMERIC(5, 2) — NOT NULL
  • payout_amount — BIGINT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

product

  • product_id — BIGINT — Primary key — NOT NULL
  • seller_member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • category_id — BIGINT — Foreign key → product_category.category_id — NOT NULL
  • title — VARCHAR(100) — NOT NULL
  • description — TEXT — NOT NULL
  • condition_status — VARCHAR(30)
  • moderation_status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

product_category

  • category_id — BIGINT — Primary key — NOT NULL
  • code — VARCHAR(50) — NOT NULL
  • name — VARCHAR(50) — NOT NULL

product_image

  • product_image_id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL
  • image_url — VARCHAR(500) — NOT NULL
  • sort_order — INT — NOT NULL
  • is_thumbnail — BOOLEAN — NOT NULL
  • moderation_status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

report

  • report_id — BIGINT — Primary key — NOT NULL
  • reporter_member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • target_type — VARCHAR(30) — NOT NULL
  • reported_member_id — BIGINT — Foreign key → member.member_id
  • auction_room_id — BIGINT — Foreign key → auction_room.auction_room_id
  • chat_message_id — BIGINT — Foreign key → chat_message.chat_message_id
  • deal_id — BIGINT — Foreign key → deal.deal_id
  • reason_code — VARCHAR(40) — NOT NULL
  • description — TEXT
  • status — VARCHAR(20) — NOT NULL
  • processed_by_member_id — BIGINT — Foreign key → member.member_id
  • resolution_note — TEXT
  • created_at — TIMESTAMPTZ — NOT NULL
  • processed_at — TIMESTAMPTZ
  • Key — Foreign key — NOT NULL

social_account

  • social_account_id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • provider — VARCHAR(20) — NOT NULL
  • provider_user_id — VARCHAR(100) — NOT NULL
  • Key — Foreign key — NOT NULL

terms

  • terms_id — BIGINT — Primary key — NOT NULL
  • terms_type — VARCHAR(30) — NOT NULL
  • version — VARCHAR(20) — NOT NULL
  • title — VARCHAR(100) — NOT NULL
  • content — TEXT — NOT NULL
  • is_required — BOOLEAN — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • effective_at — TIMESTAMPTZ — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

trade_point_ledger

  • trade_point_ledger_id — BIGINT — Primary key — NOT NULL
  • wallet_id — BIGINT — Foreign key → wallet.wallet_id — NOT NULL
  • transaction_type — VARCHAR(40) — NOT NULL
  • available_delta — BIGINT — NOT NULL
  • held_delta — BIGINT — NOT NULL
  • available_balance_after — BIGINT — NOT NULL
  • held_balance_after — BIGINT — NOT NULL
  • auction_participant_id — BIGINT — Foreign key → auction_participant.auction_participant_id
  • bid_id — BIGINT — Foreign key → bid.bid_id
  • deal_id — BIGINT — Foreign key → deal.deal_id
  • point_charge_id — BIGINT — Foreign key → point_charge.point_charge_id
  • idempotency_key — VARCHAR(100) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL

wallet

  • wallet_id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • wallet_type — VARCHAR(20) — NOT NULL
  • available_balance — BIGINT — NOT NULL
  • held_balance — BIGINT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • Key — Foreign key — NOT NULL