asdf

Tables (10)

accommodation

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(200) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

idempotency_key

  • key — VARCHAR(80) — Primary key — NOT NULL
  • user_id — BIGINT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • request_fingerprint — VARCHAR(64) — NOT NULL
  • result_ref — BIGINT
  • response_snapshot — JSON
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • expires_at — DATETIME — NOT NULL

payment_line

  • id — BIGINT — Primary key — NOT NULL
  • reservation_id — BIGINT — Foreign key → reservation.id — NOT NULL
  • method — VARCHAR(20) — NOT NULL
  • amount — INT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • pg_key — VARCHAR(80)
  • external_ref — VARCHAR(120)
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

point

  • user_id — BIGINT — Primary key — NOT NULL
  • balance — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

product

  • id — BIGINT — Primary key — NOT NULL
  • room_id — BIGINT — Foreign key → room.id — NOT NULL
  • check_in — DATETIME — NOT NULL
  • check_out — DATETIME — NOT NULL
  • base_price — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

promotion

  • id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → product.id — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • opens_at — DATETIME — NOT NULL
  • special_price — INT — NOT NULL
  • max_per_user — INT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

reservation

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — NOT NULL
  • product_id — BIGINT — Foreign key → product.id — NOT NULL
  • promotion_id — BIGINT — Foreign key → promotion.id
  • status — VARCHAR(20) — NOT NULL
  • cancel_reason — VARCHAR(20)
  • expires_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

room

  • id — BIGINT — Primary key — NOT NULL
  • accommodation_id — BIGINT — Foreign key → accommodation.id — NOT NULL
  • name — VARCHAR(200) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

stock

  • product_id — BIGINT — Foreign key → product.id — NOT NULL
  • qty — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_promotion_quota

  • user_id — BIGINT — Primary key — NOT NULL
  • promotion_id — BIGINT — Foreign key → promotion.id — NOT NULL
  • used — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL