NBE-14-2-OVENGERS

Tables (10)

audit_log

  • id — BIGINT — Primary key — NOT NULL
  • actor_member_id — BIGINT — Foreign key → member.id
  • action — VARCHAR(50) — NOT NULL
  • target_type — VARCHAR(20) — NOT NULL
  • target_id — BIGINT — NOT NULL
  • reason — VARCHAR(200) — NOT NULL
  • before_value — JSON
  • after_value — JSON
  • created_at — DATETIME — NOT NULL

door_access_log

  • id — BIGINT — Primary key — NOT NULL
  • actor_member_id — BIGINT — Foreign key → member.id
  • reservation_id — BIGINT — Foreign key → reservation.id
  • requested_space_id — BIGINT — Foreign key → space.id
  • result — ENUM('ALLOW', 'DENY') — NOT NULL
  • reason_code — VARCHAR(50) — NOT NULL
  • attempted_at — DATETIME — NOT NULL

door_access_token

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservation.id — NOT NULL
  • token_hash — VARCHAR(255) — NOT NULL
  • issued_at — DATETIME — NOT NULL
  • revoked_at — DATETIME
  • revoke_reason — VARCHAR(200)
  • active_reservation_id — BIGINT

member

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • role — ENUM('MEMBER', 'PLATFORM_ADMIN') — NOT NULL
  • status — ENUM('ACTIVE', 'SUSPENDED') — NOT NULL
  • created_at — DATETIME — NOT NULL

payment

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservation.id — NOT NULL
  • amount — INT — NOT NULL
  • status — ENUM('SUCCESS', 'CANCELLED') — NOT NULL
  • paid_at — DATETIME — NOT NULL
  • cancelled_at — DATETIME

refresh_token

  • id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → member.id — NOT NULL
  • token_hash — VARCHAR(255) — NOT NULL
  • issued_at — DATETIME — NOT NULL
  • expires_at — DATETIME — NOT NULL
  • revoked_at — DATETIME

reservation

  • id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → member.id — NOT NULL
  • space_id — BIGINT — Foreign key → space.id — NOT NULL
  • start_time — DATETIME — NOT NULL
  • end_time — DATETIME — NOT NULL
  • status — ENUM('CONFIRMED', 'CANCELLED', 'COMPLETED') — NOT NULL
  • price_per_slot_snapshot — INT — NOT NULL
  • total_amount — INT — NOT NULL
  • cancelled_at — DATETIME
  • completed_at — DATETIME
  • created_at — DATETIME — NOT NULL

reservation_slot

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservation.id — NOT NULL
  • space_id — BIGINT — Foreign key → reservation.space_id — NOT NULL
  • slot_start — DATETIME — NOT NULL

reservation_status_history

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservation.id — NOT NULL
  • changed_by_member_id — BIGINT — Foreign key → member.id
  • from_status — ENUM('CONFIRMED', 'CANCELLED', 'COMPLETED')
  • to_status — ENUM('CONFIRMED', 'CANCELLED', 'COMPLETED') — NOT NULL
  • reason — VARCHAR(200)
  • changed_at — DATETIME — NOT NULL

space

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • location — VARCHAR(255) — NOT NULL
  • description — VARCHAR(1500)
  • capacity — INT — NOT NULL
  • price_per_slot — INT — NOT NULL
  • image_path — VARCHAR(500)
  • opening_time — TIME — NOT NULL
  • closing_time — TIME — NOT NULL
  • status — ENUM('ACTIVE', 'INACTIVE') — NOT NULL