schema

Tables (27)

admin_products

  • id — integer — NOT NULL
  • product_id — integer
  • purchase_price — integer
  • purchased_from_seller_id — integer
  • purchased_at — timestamp
  • is_auctioned — boolean

admins

  • id — integer — NOT NULL
  • email — character — NOT NULL
  • password — character — NOT NULL
  • name — character — NOT NULL
  • created_at — timestamp
  • updated_at — timestamp(6)

auction_payments

  • id — bigint — NOT NULL
  • created_at — timestamp(6)
  • updated_at — timestamp(6)
  • amount — integer — NOT NULL
  • auction_id — integer — NOT NULL
  • customer_id — bigint — NOT NULL
  • delivery_address — character — NOT NULL
  • order_id — bigint
  • paid_at — timestamp(6)
  • payment_key — character — NOT NULL
  • payment_method — character — NOT NULL
  • phone — character — NOT NULL
  • receiver_name — character — NOT NULL
  • status — character — NOT NULL
  • IN_PROGRESS::character — varying
  • WAITING_FOR_DEPOSIT::character — varying
  • COMPLETED::character — varying
  • CANCELED::character — varying
  • PARTIAL_CANCELED::character — varying
  • REFUNDED::character — varying
  • FAILED::character — varying)::text)))

auctions

  • id — integer — NOT NULL
  • start_price — integer — NOT NULL
  • current_price — integer
  • start_time — timestamp
  • end_time — timestamp
  • created_at — timestamp
  • admin_product_id — integer
  • updated_at — timestamp(6)
  • product_id — integer
  • status — character — NOT NULL
  • winning_bid_price — integer
  • winning_customer_id — bigint

bids

  • id — integer — NOT NULL
  • auction_id — integer
  • customer_id — bigint
  • bid_price — integer — NOT NULL
  • bid_time — timestamp
  • created_at — timestamp(6)
  • updated_at — timestamp(6)

cart_items

  • id — bigint — NOT NULL
  • customer_id — bigint
  • product_id — bigint
  • quantity — integer
  • updated_at — timestamp
  • created_at — timestamp(6)

categories

  • id — bigint — NOT NULL
  • name — character — NOT NULL
  • parent_id — bigint

commission_logs

  • id — integer — NOT NULL
  • sales_log_id — integer
  • commission_rate — numeric(5,2)
  • commission_amount — integer
  • recorded_at — timestamp

customer_qna

  • id — bigint — NOT NULL
  • seller_id — bigint — NOT NULL
  • product_id — bigint — NOT NULL
  • customer_id — bigint — NOT NULL
  • title — character — NOT NULL
  • content — text — NOT NULL
  • answer — text
  • is_answered — boolean
  • answered_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp(6)

customers

  • id — bigint — NOT NULL
  • email — character — NOT NULL
  • password — character — NOT NULL
  • name — character — NOT NULL
  • phone — character
  • address — character
  • is_verified — boolean
  • is_active — boolean
  • penalty_score — integer
  • birth — date
  • gender — character
  • signup_method — character
  • created_at — timestamp
  • updated_at — timestamp

delivery_policy

  • id — bigint — NOT NULL
  • product_id — bigint
  • type — character — NOT NULL
  • cost — integer
  • region_limit — text
  • created_at — timestamp(6)
  • updated_at — timestamp(6)

order_delivery

  • id — bigint — NOT NULL
  • order_id — bigint — NOT NULL
  • delivery_status — character
  • start_date — timestamp
  • complete_date — timestamp
  • tracking_number — character
  • carrier — character
  • created_at — timestamp
  • updated_at — timestamp

order_items

  • id — bigint — NOT NULL
  • order_id — bigint
  • product_id — bigint
  • quantity — integer
  • price — integer — NOT NULL

orders

  • id — bigint — NOT NULL
  • customer_id — integer
  • status — character — NOT NULL
  • total_price — integer
  • delivery_address — character
  • ordered_at — timestamp
  • updated_at — timestamp
  • product_id — bigint — NOT NULL
  • customers_id — bigint — NOT NULL

payments

  • id — bigint — NOT NULL
  • payment_key — character — NOT NULL
  • order_id — bigint — NOT NULL
  • amount — bigint — NOT NULL
  • balance_amount — bigint
  • method — character — NOT NULL
  • status — character — NOT NULL
  • requested_at — timestamp — NOT NULL
  • approved_at — timestamp
  • type — character — NOT NULL
  • customer_key — character
  • currency — character — NOT NULL
  • last_transaction_key — character
  • raw_response_data — jsonb
  • created_at — timestamp
  • updated_at — timestamp

payout_logs

  • id — integer — NOT NULL
  • seller_id — integer
  • period_start — date
  • period_end — date
  • total_sales — integer
  • total_commission — integer
  • payout_amount — integer
  • processed_at — timestamp

penalty_logs

  • id — integer — NOT NULL
  • customer_id — bigint
  • reason — character
  • points — integer — NOT NULL
  • description — character
  • created_at — timestamp
  • updated_at — timestamp(6)

product_images

  • id — bigint — NOT NULL
  • product_id — bigint
  • url — character — NOT NULL
  • is_thumbnail — boolean
  • media_type — character

products

  • id — bigint — NOT NULL
  • seller_id — bigint
  • name — character — NOT NULL
  • description — text
  • price — integer — NOT NULL
  • stock — integer
  • width — integer
  • depth — integer
  • height — integer
  • status — character
  • category_id — bigint — NOT NULL
  • is_active — boolean
  • created_at — timestamp
  • updated_at — timestamp

review_images

  • id — bigint — NOT NULL
  • review_id — bigint — NOT NULL
  • url — character — NOT NULL
  • is_thumbnail — boolean
  • created_at — timestamp
  • updated_at — timestamp(6)
  • image_url — character — NOT NULL
  • thumbnail — boolean — NOT NULL

review_reports

  • id — integer — NOT NULL
  • seller_review_id — integer
  • reporter_id — integer
  • reason — character
  • created_at — timestamp
  • updated_at — timestamp(6)
  • status — character

sales_logs

  • id — integer — NOT NULL
  • order_item_id — integer
  • product_id — integer
  • seller_id — integer
  • customer_id — bigint
  • quantity — integer
  • unit_price — integer
  • total_price — integer
  • sold_at — date

seller_documents

  • id — bigint — NOT NULL
  • seller_id — bigint
  • file_type — character
  • file_url — character
  • is_verified — boolean
  • created_at — timestamp
  • updated_at — timestamp
  • verified_at — timestamp

seller_qna

  • id — bigint — NOT NULL
  • seller_id — bigint — NOT NULL
  • title — character — NOT NULL
  • content — text — NOT NULL
  • answer — text
  • is_answered — boolean
  • created_at — timestamp
  • answered_at — timestamp
  • updated_at — timestamp(6)
  • is_active — boolean
  • deleted — boolean — NOT NULL

seller_reviews

  • id — bigint — NOT NULL
  • order_id — bigint
  • customer_id — bigint
  • seller_id — bigint
  • rating — double — NOT NULL
  • content — character
  • is_hidden — boolean
  • created_at — timestamp
  • updated_at — timestamp

sellers

  • id — bigint — NOT NULL
  • name — character — NOT NULL
  • email — character — NOT NULL
  • phone — character
  • business_number — character
  • password — character
  • is_approved — boolean
  • approved_at — timestamp
  • created_at — timestamp
  • updated_at — timestamp
  • is_active — boolean

wishlists

  • id — bigint — NOT NULL
  • customer_id — bigint
  • product_id — bigint
  • created_at — timestamp