Tableé

Tables (12)

bid

  • id — BIGINT — Primary key — NOT NULL
  • slot_id — BIGINT — Foreign key → reservation_slot.restaurant_id — NOT NULL
  • id (id2) — BIGINT — Foreign key → reservation_slot.created_by — NOT NULL
  • user_id — BIGINT — NOT NULL
  • amount — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

bidding_participation

  • id — BIGINT — Primary key — NOT NULL
  • slot_id — BIGINT — Foreign key → reservation_slot.id — NOT NULL
  • id (id2) — BIGINT — Foreign key → reservation_slot.created_by — NOT NULL
  • user_id — BIGINT — NOT NULL
  • deposit_amount — INT — NOT NULL
  • deposit_auth_id — VARCHAR(100) — NOT NULL
  • auth_status — ENUM('AUTHORIZED','CAPTURED','CANCELED','FAILED') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

payment_transaction

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservation.id — NOT NULL
  • restaurant_id — BIGINT — Foreign key → reservation.slot_id — NOT NULL
  • id (id22) — BIGINT — Foreign key — NOT NULL
  • id (id2) — BIGINT — Foreign key → reservation.user_id — NOT NULL
  • id (id23) — BIGINT — Foreign key → reservation.id — NOT NULL
  • user_id — BIGINT — NOT NULL
  • slot_id — BIGINT
  • type — ENUM('AUTH','CAPTURE','CANCEL','REFUND') — NOT NULL
  • external_payment_id — VARCHAR(100) — NOT NULL
  • amount — INT — NOT NULL
  • status — ENUM('PENDING','SUCCESS','FAILED') — NOT NULL
  • requested_at — DATETIME — NOT NULL
  • completed_at — DATETIME

penalty

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → payment_transaction.reservation_id — NOT NULL
  • user_id — BIGINT — Foreign key → review.id — NOT NULL
  • restaurant_id — BIGINT — Foreign key → payment_transaction.restaurant_id — NOT NULL
  • id (id22) — BIGINT — Foreign key → payment_transaction.id — NOT NULL
  • id (id2) — BIGINT — Foreign key → payment_transaction.id — NOT NULL
  • id (id23) — BIGINT — Foreign key → payment_transaction.id — NOT NULL
  • type — ENUM('NO_SHOW','LATE_CANCEL','FRAUD','OTHER') — NOT NULL
  • score — INT — NOT NULL
  • reason — VARCHAR(255)
  • created_at — DATETIME — NOT NULL
  • expires_at — DATETIME

reservation

  • id — BIGINT — Primary key — NOT NULL
  • winning_bid_id — BIGINT — Foreign key → bid.id — NOT NULL
  • slot_id — BIGINT — Foreign key → bid.slot_id — NOT NULL
  • user_id — BIGINT — Foreign key → user.id — NOT NULL
  • id (id2) — BIGINT — Foreign key → bid.id — NOT NULL
  • people_count — TINYINT — NOT NULL
  • total_amount — INT — NOT NULL
  • status — ENUM( 'CONFIRMED', 'CANCELED_BY_USER', 'CANCELED_BY_RESTAURANT', 'NO_SHOW', 'PAYMENT_FAILED', 'USED' ) — NOT NULL
  • checkin_qr_token — VARCHAR(255)
  • reserved_at — DATETIME — NOT NULL
  • canceled_at — DATETIME
  • used_at — DATETIME
  • payment_failed_reason — VARCHAR(255)

reservation_slot

  • id — BIGINT — Primary key — NOT NULL
  • created_by — BIGINT — Foreign key → user.id — NOT NULL
  • restaurant_id — BIGINT — Foreign key → restaurant.id — NOT NULL
  • visit_datetime — DATETIME — NOT NULL
  • table_count — TINYINT — NOT NULL
  • min_party_size — TINYINT — NOT NULL
  • max_party_size — TINYINT — NOT NULL
  • start_price — INT — NOT NULL
  • bid_step — INT — NOT NULL
  • bidding_start_at — DATETIME — NOT NULL
  • bidding_end_at — DATETIME — NOT NULL
  • status — ENUM('OPEN_SCHEDULED','OPEN','CLOSED','CANCELED') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

restaurant

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(150) — NOT NULL
  • region — VARCHAR(100) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • phone — VARCHAR(20)
  • price_range — ENUM('MID','HIGH','PREMIUM') — NOT NULL
  • cuisine_type — VARCHAR(100)
  • opening_time — TIME
  • closing_time — TIME
  • description — TEXT
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • popularity_score — INT — NOT NULL
  • latitude — DECIMAL(10,7)
  • longitude — DECIMAL(10,7)

restaurant_user

  • user_id — BIGINT — Foreign key → user.id — NOT NULL
  • restaurant_id (id2restaurant_id) — BIGINT — Foreign key → restaurant.id — NOT NULL
  • created_at — DATETIME — NOT NULL

review

  • id — BIGINT — Primary key — NOT NULL
  • restaurant_id — BIGINT — Foreign key → restaurant.id — NOT NULL
  • reservation_id — BIGINT — NOT NULL
  • user_id — BIGINT — NOT NULL
  • rating — TINYINT — NOT NULL
  • content — TEXT
  • is_visible — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(320) — NOT NULL
  • phone — VARCHAR(20) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • birth_date — DATE — NOT NULL
  • gender — ENUM('M','F') — NOT NULL
  • role — ENUM('USER','RESTAURANT','ADMIN') — NOT NULL
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_kyc

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.id — NOT NULL
  • status — ENUM('NONE','ID_VERIFIED','FULLY_VERIFIED','REJECTED') — NOT NULL
  • id_doc_type — ENUM('RRN','DRIVER_LICENSE','PASSPORT')
  • id_name — VARCHAR(100)
  • id_birth_date — DATE
  • id_gender — ENUM('M','F')
  • ocr_result_token — VARCHAR(255)
  • liveness_score — DECIMAL(5,2)
  • ocr_verified_at — DATETIME
  • liveness_verified_at — DATETIME
  • ocr_retry_count — TINYINT — NOT NULL
  • liveness_retry_count — TINYINT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_oauth

  • id — BIGINT — Foreign key → user.id — NOT NULL
  • user_id — BIGINT — NOT NULL
  • provider — VARCHAR(50) — NOT NULL
  • provider_user_id — VARCHAR(255) — NOT NULL
  • created_at — DATETIME — NOT NULL