test

Tables (49)

amenities

  • amenity_id — BIGINT — Primary key — NOT NULL
  • amenity_code — VARCHAR(50) — NOT NULL
  • amenity_name — VARCHAR(100) — NOT NULL
  • category — ENUM('HOTEL', 'ROOM', 'SERVICE', 'MEAL', 'PARKING', 'POOL', 'WIFI', 'ETC') — NOT NULL
  • icon_name — VARCHAR(100)
  • is_filterable — BOOLEAN — NOT NULL
  • display_order — INT — NOT NULL

audit_logs

  • audit_log_id — BIGINT — Primary key — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.user_id
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id
  • action_type — VARCHAR(100) — NOT NULL
  • target_table — VARCHAR(100)
  • target_id — BIGINT
  • old_value — LONGTEXT
  • new_value — LONGTEXT
  • ip_address — VARCHAR(45)
  • user_agent — VARCHAR(500)
  • created_at — DATETIME(6) — NOT NULL

booking_channels

  • booking_channel_id — BIGINT — Primary key — NOT NULL
  • channel_code — VARCHAR(50) — NOT NULL
  • channel_name — VARCHAR(100) — NOT NULL
  • commission_rate — DECIMAL(5,2) — NOT NULL
  • is_active — BOOLEAN — NOT NULL

booking_charges

  • booking_charge_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • charge_type — ENUM('ROOM', 'BREAKFAST', 'FNB', 'PARKING', 'SERVICE_FEE', 'TAX', 'DISCOUNT', 'COUPON', 'POINT', 'ETC') — NOT NULL
  • charge_name — VARCHAR(100) — NOT NULL
  • quantity — INT — NOT NULL
  • unit_amount — DECIMAL(15,2) — NOT NULL
  • total_amount — DECIMAL(15,2) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

booking_guests

  • booking_guest_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • guest_name — VARCHAR(100) — NOT NULL
  • guest_type — ENUM('ADULT', 'CHILD', 'INFANT') — NOT NULL
  • phone — VARCHAR(30)
  • email — VARCHAR(255)
  • is_primary — BOOLEAN — NOT NULL

booking_item_nights

  • booking_item_night_id — BIGINT — Primary key — NOT NULL
  • booking_item_id — BIGINT — Foreign key → booking_items.booking_item_id — NOT NULL
  • stay_date — DATE — NOT NULL
  • list_price — DECIMAL(15,2) — NOT NULL
  • sale_price — DECIMAL(15,2) — NOT NULL
  • applied_promotion_id — BIGINT — Foreign key → promotions.promotion_id

booking_items

  • booking_item_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • assigned_room_id — BIGINT — Foreign key → rooms.room_id
  • check_in_date — DATE — NOT NULL
  • check_out_date — DATE — NOT NULL
  • nights — INT
  • adult_count — INT — NOT NULL
  • child_count — INT — NOT NULL
  • item_room_amount — DECIMAL(15,2) — NOT NULL
  • item_discount_amount — DECIMAL(15,2) — NOT NULL
  • item_final_amount — DECIMAL(15,2) — NOT NULL
  • status — ENUM('RESERVED', 'CHECKED_IN', 'CHECKED_OUT', 'CANCELLED', 'NO_SHOW') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

booking_qr_tokens

  • booking_qr_token_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • token_hash — VARCHAR(255) — NOT NULL
  • purpose — ENUM('CHECK_IN', 'BOOKING_CONFIRMATION') — NOT NULL
  • expires_at — DATETIME(6) — NOT NULL
  • used_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL

bookings

  • booking_id — BIGINT — Primary key — NOT NULL
  • booking_no — VARCHAR(50) — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • booking_channel_id — BIGINT — Foreign key → booking_channels.booking_channel_id — NOT NULL
  • user_coupon_id — BIGINT — Foreign key → user_coupons.user_coupon_id
  • promotion_id — BIGINT — Foreign key → promotions.promotion_id
  • guest_name — VARCHAR(100) — NOT NULL
  • guest_email — VARCHAR(255) — NOT NULL
  • guest_phone — VARCHAR(30) — NOT NULL
  • guest_nationality — VARCHAR(100)
  • status — ENUM( 'PENDING_PAYMENT', 'CONFIRMED', 'CHECKIN_READY', 'CHECKED_IN', 'CHECKED_OUT', 'CANCEL_REQUESTED', 'CANCELLED', 'NO_SHOW', 'EXPIRED' ) — NOT NULL
  • payment_status — ENUM( 'UNPAID', 'PARTIAL_PAID', 'PAID', 'PARTIAL_REFUNDED', 'REFUNDED', 'FAILED' ) — NOT NULL
  • total_room_amount — DECIMAL(15,2) — NOT NULL
  • total_option_amount — DECIMAL(15,2) — NOT NULL
  • total_discount_amount — DECIMAL(15,2) — NOT NULL
  • point_used_amount — DECIMAL(15,2) — NOT NULL
  • tax_amount — DECIMAL(15,2) — NOT NULL
  • service_fee_amount — DECIMAL(15,2) — NOT NULL
  • final_amount — DECIMAL(15,2) — NOT NULL
  • currency — CHAR(3) — NOT NULL
  • special_request — TEXT
  • free_cancel_until — DATETIME(6)
  • booked_at — DATETIME(6) — NOT NULL
  • cancelled_at — DATETIME(6)
  • checked_in_at — DATETIME(6)
  • checked_out_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

cancellation_policies

  • cancellation_policy_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • policy_name — VARCHAR(100) — NOT NULL
  • description — TEXT
  • free_cancel_until_hours — INT
  • no_show_penalty_rate — DECIMAL(5,2) — NOT NULL
  • is_default — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

cancellation_policy_rules

  • cancellation_policy_rule_id — BIGINT — Primary key — NOT NULL
  • cancellation_policy_id — BIGINT — Foreign key → cancellation_policies.cancellation_policy_id — NOT NULL
  • hours_before_checkin_min — INT — NOT NULL
  • hours_before_checkin_max — INT
  • refund_rate — DECIMAL(5,2) — NOT NULL
  • penalty_rate — DECIMAL(5,2) — NOT NULL

cancellation_requests

  • cancellation_request_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • requested_by — BIGINT — Foreign key → users.user_id
  • reason — VARCHAR(500)
  • expected_refund_amount — DECIMAL(15,2) — NOT NULL
  • status — ENUM('REQUESTED', 'APPROVED', 'REJECTED', 'COMPLETED') — NOT NULL
  • requested_at — DATETIME(6) — NOT NULL
  • processed_at — DATETIME(6)

coupons

  • coupon_id — BIGINT — Primary key — NOT NULL
  • coupon_code — VARCHAR(50) — NOT NULL
  • coupon_name — VARCHAR(150) — NOT NULL
  • discount_type — ENUM('RATE', 'AMOUNT') — NOT NULL
  • discount_value — DECIMAL(15,2) — NOT NULL
  • min_order_amount — DECIMAL(15,2) — NOT NULL
  • max_discount_amount — DECIMAL(15,2)
  • valid_from — DATETIME(6) — NOT NULL
  • valid_to — DATETIME(6) — NOT NULL
  • issue_limit — INT
  • issued_count — INT — NOT NULL
  • used_count — INT — NOT NULL
  • status — ENUM('ACTIVE', 'INACTIVE', 'EXPIRED') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

destinations

  • destination_id — BIGINT — Primary key — NOT NULL
  • parent_destination_id — BIGINT — Foreign key → destinations.destination_id
  • destination_name — VARCHAR(100) — NOT NULL
  • destination_type — ENUM('COUNTRY', 'PROVINCE', 'CITY', 'DISTRICT', 'LANDMARK') — NOT NULL
  • display_order — INT — NOT NULL
  • is_popular — BOOLEAN — NOT NULL
  • image_url — VARCHAR(1000)
  • created_at — DATETIME(6) — NOT NULL

hotel_amenities

  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • amenity_id — BIGINT — Foreign key → amenities.amenity_id — NOT NULL

hotel_images

  • hotel_image_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • image_url — VARCHAR(1000) — NOT NULL
  • image_alt — VARCHAR(255)
  • image_type — ENUM('THUMBNAIL', 'MAIN', 'GALLERY', 'DETAIL') — NOT NULL
  • sort_order — INT — NOT NULL
  • is_visible — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

hotel_staff

  • hotel_staff_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • staff_role — ENUM('OWNER', 'MANAGER', 'FRONT_DESK', 'ACCOUNTING', 'VIEWER') — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

hotels

  • hotel_id — BIGINT — Primary key — NOT NULL
  • property_type_id — BIGINT — Foreign key → property_types.property_type_id — NOT NULL
  • destination_id — BIGINT — Foreign key → destinations.destination_id
  • hotel_name — VARCHAR(200) — NOT NULL
  • hotel_name_en — VARCHAR(200)
  • description — LONGTEXT
  • star_rating — TINYINT
  • address — VARCHAR(500) — NOT NULL
  • address_detail — VARCHAR(255)
  • country — VARCHAR(100) — NOT NULL
  • province — VARCHAR(100)
  • city — VARCHAR(100) — NOT NULL
  • district — VARCHAR(100)
  • latitude — DECIMAL(10,7)
  • longitude — DECIMAL(10,7)
  • phone — VARCHAR(30)
  • email — VARCHAR(255)
  • website_url — VARCHAR(1000)
  • check_in_time — TIME — NOT NULL
  • check_out_time — TIME — NOT NULL
  • parking_info — VARCHAR(255)
  • status — ENUM('ACTIVE', 'INACTIVE', 'PENDING', 'SUSPENDED') — NOT NULL
  • is_featured — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

membership_grades

  • membership_grade_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • grade_code — VARCHAR(30) — NOT NULL
  • grade_name — VARCHAR(50) — NOT NULL
  • min_booking_count — INT — NOT NULL
  • min_paid_amount — DECIMAL(15,2) — NOT NULL
  • point_rate — DECIMAL(5,2) — NOT NULL
  • description — VARCHAR(255)

notifications

  • notification_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • notification_type — ENUM('BOOKING', 'PAYMENT', 'CANCEL', 'PROMOTION', 'REVIEW', 'SYSTEM') — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • content — TEXT — NOT NULL
  • link_url — VARCHAR(1000)
  • is_read — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • read_at — DATETIME(6)

oauth_accounts

  • oauth_account_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • provider — ENUM('KAKAO', 'NAVER', 'GOOGLE') — NOT NULL
  • provider_user_id — VARCHAR(255) — NOT NULL
  • provider_email — VARCHAR(255)
  • connected_at — DATETIME(6) — NOT NULL

password_reset_tokens

  • password_reset_token_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • token_hash — VARCHAR(255) — NOT NULL
  • expires_at — DATETIME(6) — NOT NULL
  • used_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL

payments

  • payment_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • payment_method — ENUM('CARD', 'KAKAO_PAY', 'NAVER_PAY', 'TOSS_PAY', 'BANK_TRANSFER', 'PAYPAL', 'POINT') — NOT NULL
  • payment_status — ENUM('READY', 'PAID', 'FAILED', 'CANCELLED', 'REFUNDED', 'PARTIAL_REFUNDED') — NOT NULL
  • amount — DECIMAL(15,2) — NOT NULL
  • currency — CHAR(3) — NOT NULL
  • card_company — VARCHAR(50)
  • card_last4 — CHAR(4)
  • transaction_id — VARCHAR(150)
  • pg_provider — VARCHAR(50)
  • paid_at — DATETIME(6)
  • cancelled_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL

point_transactions

  • point_transaction_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id
  • transaction_type — ENUM('EARN', 'USE', 'CANCEL_EARN', 'CANCEL_USE', 'EXPIRE', 'ADMIN_ADJUST') — NOT NULL
  • point_amount — INT — NOT NULL
  • balance_after — INT — NOT NULL

promotion_room_types

  • promotion_id — BIGINT — Foreign key → promotions.promotion_id — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL

promotions

  • promotion_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id
  • promotion_name — VARCHAR(150) — NOT NULL
  • promotion_type — ENUM('DISCOUNT', 'PACKAGE', 'FLASH', 'MEMBER_ONLY', 'LONG_STAY') — NOT NULL
  • discount_type — ENUM('RATE', 'AMOUNT', 'FREE_NIGHT') — NOT NULL
  • discount_value — DECIMAL(15,2) — NOT NULL
  • min_nights — INT — NOT NULL
  • valid_from — DATETIME(6) — NOT NULL
  • valid_to — DATETIME(6) — NOT NULL
  • status — ENUM('SCHEDULED', 'ACTIVE', 'PAUSED', 'ENDED') — NOT NULL
  • description — VARCHAR(500)
  • created_by — BIGINT — Foreign key → users.user_id
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

property_types

  • property_type_id — BIGINT — Primary key — NOT NULL
  • type_code — VARCHAR(50) — NOT NULL
  • type_name — VARCHAR(100) — NOT NULL
  • description — VARCHAR(255)
  • display_order — INT — NOT NULL
  • is_active — BOOLEAN — NOT NULL

refunds

  • refund_id — BIGINT — Primary key — NOT NULL
  • payment_id — BIGINT — Foreign key → payments.payment_id — NOT NULL
  • refund_no — VARCHAR(50) — NOT NULL
  • refund_amount — DECIMAL(15,2) — NOT NULL
  • refund_reason — VARCHAR(500)
  • refund_status — ENUM('REQUESTED', 'APPROVED', 'REJECTED', 'COMPLETED', 'FAILED') — NOT NULL
  • requested_at — DATETIME(6) — NOT NULL
  • completed_at — DATETIME(6)

review_images

  • review_image_id — BIGINT — Primary key — NOT NULL
  • review_id — BIGINT — Foreign key → reviews.review_id — NOT NULL
  • image_url — VARCHAR(1000) — NOT NULL
  • sort_order — INT — NOT NULL

review_replies

  • review_reply_id — BIGINT — Primary key — NOT NULL
  • review_id — BIGINT — Foreign key → reviews.review_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • content — TEXT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

reviews

  • review_id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id
  • rating — DECIMAL(2,1) — NOT NULL
  • cleanliness_rating — DECIMAL(2,1)
  • service_rating — DECIMAL(2,1)
  • location_rating — DECIMAL(2,1)
  • value_rating — DECIMAL(2,1)
  • title — VARCHAR(200)
  • content — TEXT
  • status — ENUM('PENDING', 'APPROVED', 'HIDDEN', 'REPORTED') — NOT NULL
  • is_visible — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

room_blocks

  • room_block_id — BIGINT — Primary key — NOT NULL
  • room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
  • block_start_date — DATE — NOT NULL
  • block_end_date — DATE — NOT NULL
  • reason — VARCHAR(255)
  • status — ENUM('ACTIVE', 'CANCELLED') — NOT NULL
  • created_by — BIGINT — Foreign key → users.user_id
  • created_at — DATETIME(6) — NOT NULL

room_daily_rates

  • room_daily_rate_id — BIGINT — Primary key — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • stay_date — DATE — NOT NULL
  • list_price — DECIMAL(15,2) — NOT NULL
  • sale_price — DECIMAL(15,2) — NOT NULL
  • available_count — INT
  • min_stay_nights — INT — NOT NULL
  • is_closed — BOOLEAN — NOT NULL
  • memo — VARCHAR(255)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

room_rate_seasons

  • room_rate_season_id — BIGINT — Primary key — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • season_name — VARCHAR(100) — NOT NULL
  • start_date — DATE — NOT NULL
  • end_date — DATE — NOT NULL
  • weekday_price — DECIMAL(15,2) — NOT NULL
  • weekend_price — DECIMAL(15,2) — NOT NULL
  • min_stay_nights — INT — NOT NULL
  • status — ENUM('SCHEDULED', 'ACTIVE', 'ENDED', 'INACTIVE') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

room_type_amenities

  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • amenity_id — BIGINT — Foreign key → amenities.amenity_id — NOT NULL

room_type_images

  • room_type_image_id — BIGINT — Primary key — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • image_url — VARCHAR(1000) — NOT NULL
  • image_alt — VARCHAR(255)
  • image_type — ENUM('THUMBNAIL', 'GALLERY') — NOT NULL
  • sort_order — INT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

room_type_inventory

  • room_type_inventory_id — BIGINT — Primary key — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • stay_date — DATE — NOT NULL
  • total_count — INT — NOT NULL
  • closed_count — INT — NOT NULL
  • sold_count — INT — NOT NULL
  • extra_count — INT — NOT NULL
  • remaining_count — INT
  • updated_at — DATETIME(6) — NOT NULL

room_types

  • room_type_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • cancellation_policy_id — BIGINT — Foreign key → cancellation_policies.cancellation_policy_id
  • room_type_name — VARCHAR(150) — NOT NULL
  • description — TEXT
  • bed_type — VARCHAR(100)
  • room_size_sqm — DECIMAL(6,2)
  • max_adults — INT — NOT NULL
  • max_children — INT — NOT NULL
  • standard_adults — INT — NOT NULL
  • breakfast_included — BOOLEAN — NOT NULL
  • free_cancellation — BOOLEAN — NOT NULL
  • base_price — DECIMAL(15,2) — NOT NULL
  • status — ENUM('ACTIVE', 'INACTIVE', 'SOLD_OUT') — NOT NULL
  • display_order — INT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

room_weekday_rates

  • room_weekday_rate_id — BIGINT — Primary key — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • day_of_week — TINYINT — NOT NULL — 1=월, 2=화, ... 7=일
  • price — DECIMAL(15, 2) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

rooms

  • room_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • room_type_id — BIGINT — Foreign key → room_types.room_type_id — NOT NULL
  • room_number — VARCHAR(50) — NOT NULL
  • floor_name — VARCHAR(50)
  • status — ENUM('SELLING', 'MAINTENANCE', 'OUT_OF_SERVICE', 'HIDDEN') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

search_histories

  • search_history_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id
  • destination_keyword — VARCHAR(100)
  • check_in_date — DATE
  • check_out_date — DATE
  • adult_count — INT — NOT NULL
  • child_count — INT — NOT NULL
  • room_count — INT — NOT NULL
  • searched_at — DATETIME(6) — NOT NULL

settlement_batches

  • settlement_batch_id — BIGINT — Primary key — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • settlement_month — CHAR(7) — NOT NULL — YYYY-MM
  • gross_amount — DECIMAL(15, 2) — NOT NULL
  • commission_amount — DECIMAL(15, 2) — NOT NULL
  • refund_amount — DECIMAL(15, 2) — NOT NULL
  • payout_amount — DECIMAL(15, 2) — NOT NULL
  • status — ENUM('CREATED', 'CONFIRMED', 'PAID', 'CANCELLED') — NOT NULL
  • paid_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL

settlement_items

  • settlement_item_id — BIGINT — Primary key — NOT NULL
  • settlement_batch_id — BIGINT — Foreign key → settlement_batches.settlement_batch_id — NOT NULL
  • payment_id — BIGINT — Foreign key → payments.payment_id — NOT NULL
  • booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
  • sale_amount — DECIMAL(15,2) — NOT NULL
  • commission_amount — DECIMAL(15,2) — NOT NULL
  • payout_amount — DECIMAL(15,2) — NOT NULL

system_settings

  • setting_key — VARCHAR(100) — Primary key — NOT NULL
  • setting_value — LONGTEXT — NOT NULL
  • description — VARCHAR(255)
  • updated_by — BIGINT — Foreign key → users.user_id
  • updated_at — DATETIME(6) — NOT NULL

terms

  • terms_id — BIGINT — Primary key — NOT NULL
  • terms_code — VARCHAR(50) — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • content — LONGTEXT — NOT NULL
  • is_required — BOOLEAN — NOT NULL
  • version — VARCHAR(30) — NOT NULL
  • effective_from — DATE — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

user_coupons

  • user_coupon_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • coupon_id — BIGINT — Foreign key → coupons.coupon_id — NOT NULL
  • issued_at — DATETIME(6) — NOT NULL
  • used_at — DATETIME(6)
  • expired_at — DATETIME(6)
  • status — ENUM('ISSUED', 'USED', 'EXPIRED', 'CANCELLED') — NOT NULL

user_terms_agreements

  • user_terms_agreement_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • terms_id — BIGINT — Foreign key → terms.terms_id — NOT NULL
  • agreed — BOOLEAN — NOT NULL
  • agreed_at — DATETIME(6) — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255)
  • name — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(30)
  • birth_date — DATE
  • gender — ENUM('M', 'F', 'OTHER', 'UNKNOWN') — NOT NULL
  • role — ENUM('CUSTOMER', 'HOTEL_MANAGER', 'ADMIN', 'SUPER_ADMIN') — NOT NULL
  • status — ENUM('ACTIVE', 'DORMANT', 'LOCKED', 'WITHDRAWN') — NOT NULL
  • profile_image_url — VARCHAR(1000)
  • marketing_agreed — BOOLEAN — NOT NULL
  • last_login_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

wishlists

  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • hotel_id — BIGINT — Foreign key → hotels.hotel_id — NOT NULL
  • created_at — DATETIME(6) — NOT NULL