ccc

테이블 (10)

객실 타입 (room_type)

  • roomTypeId (id) — BIGINT — 기본 키 — NOT NULL
  • productId (accommodation_id) — BIGINT — 외래 키 → 숙소.productId — NOT NULL
  • name — VARCHAR
  • amount — BIGINT — NOT NULL
  • capacity — INT
  • roomCount (room_count) — INT
  • checkInTime (check_in_time) — TIME
  • checkOutTime (check_out_time) — TIME
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

결제 (payment)

  • paymentId (id) — BIGINT — 기본 키 — NOT NULL
  • bookingId (booking_id) — BIGINT — 외래 키 → 예약.bookingId — NOT NULL
  • paymentType (payment_type) — ENUM
  • amount — BIGINT
  • pgTransactionId (pg_transaction_id) — VARCHAR
  • paymentStatus (status) — ENUM
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

숙소 (accommodation)

  • productId (id) — BIGINT — 기본 키 — NOT NULL
  • hostId (host_id) — BIGINT — 외래 키 → 유저.userId — NOT NULL
  • name — VARCHAR
  • address — VARCHAR
  • description — VARCHAR
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

숙소 예약 가능 수 (room_availability)

  • room_availability_id (id) — BIGINT — 기본 키 — NOT NULL
  • roomTypeId (room_type_id) — BIGINT — 외래 키 → 객실 타입.roomTypeId — NOT NULL
  • date — DATE
  • availableCount (available_count) — INT
  • amount — BIGINT
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

예약 (booking)

  • bookingId (id) — BIGINT — 기본 키 — NOT NULL
  • userId (user_id) — BIGINT — 외래 키 → 유저.userId — NOT NULL
  • roomTypeId (room_type_id) — BIGINT — 외래 키 → 객실 타입.roomTypeId — NOT NULL
  • promotionRoomTypeId (promotion_room_type_id) — BIGINT — 외래 키 → 프로모션 타입.promotion_room_type_id — NOT NULL
  • orderId (order_id) — VARCHAR
  • checkInDate (check_in_date) — DATE
  • checkOutDate (check_out_date) — DATE
  • bookingStatus (booking_status) — ENUM
  • totalAmount (total_amount) — BIGINT
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

유저 (user)

  • userId (id) — BIGINT — 기본 키 — NOT NULL
  • name — VARCHAR
  • phone — VARCHAR
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

유저포인트 (user_point)

  • userPointId (id) — BIGINT — 기본 키 — NOT NULL
  • userId (user_id) — BIGINT — 외래 키 → 유저.userId — NOT NULL
  • currentPoint (current_point) — BIGINT
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

포인트 사용이력 (point_history)

  • userHistoryId (id) — BIGINT — 기본 키 — NOT NULL
  • userPointId (user_point_id) — BIGINT — 외래 키 → 유저포인트.userPointId — NOT NULL
  • bookingId (booking_id2) — BIGINT — 외래 키 → 예약.bookingId — NOT NULL
  • amount — BIGINT
  • type — ENUM
  • description — VARCHAR
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

프로모션 (promotion)

  • promotionId (id) — BIGINT — 기본 키 — NOT NULL
  • name — VARCHAR
  • startDateTime (start_date_time) — DATETIME
  • endDateTime (end_date_time) — DATETIME
  • dailyStartTime (daily_start_time) — TIME
  • dailyEndTime (daily_end_time) — TIME
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME

프로모션 타입 (promotion_room_type)

  • promotion_room_type_id (id) — BIGINT — 기본 키 — NOT NULL
  • promotionId (promotion_id) — BIGINT — 외래 키 → 프로모션.promotionId — NOT NULL
  • roomTypeId (id2) — BIGINT — 외래 키 → 객실 타입.roomTypeId — NOT NULL
  • promotionAmount (promotion_amount) — BIGINT
  • stock — INT
  • createAt (create_at) — DATETIME
  • updateAt (update_at) — DATETIME