bangbang
Tables (10)
amenity
- amenity_id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(50)
- name — VARCHAR(100) — NOT NULL
- category — VARCHAR(50)
booking
- booking_id — BIGINT — Primary key
- cancelled_by — BIGINT — Primary key
- checkin_date — DATE — NOT NULL
- checkout_date — DATE — NOT NULL
- nights — INT — NOT NULL
- price_per_day — DECIMAL(10,2) — NOT NULL
- price_for_stay — DECIMAL(10,2) — NOT NULL
- discount_amount — DECIMAL(10,2)
- cleaning_fee — DECIMAL(10,2)
- service_fee — DECIMAL(10,2)
- tax_amount — DECIMAL(10,2)
- total_amount — DECIMAL(10,2) — NOT NULL
- status — ENUM('PENDING','CONFIRMED','CANCELLED','COMPLETED')
- booked_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- cancel_reason — VARCHAR(255)
- cancel_free_until — DECIMAL(5,2)
- cancel_fee_fixed — DECIMAL(10,2)
- cancel_fee_rate — DECIMAL(5,2)
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- property_id — BIGINT — Foreign key → property.property_id — NOT NULL
- room_type_id — BIGINT — Foreign key → room_type.room_type_id — NOT NULL
occupancy
- occupancy_id — BIGINT — Primary key — NOT NULL
- max_adults — INT — NOT NULL
- max_children — INT
- max_infants — INT
- base_occupancy — INT — NOT NULL
- extra_person_fee — DECIMAL(10,2)
property
- property_id — BIGINT — Primary key — NOT NULL
- host_id — BIGINT — Foreign key → users.user_id
- property_type_id — BIGINT — Foreign key → property_type.property_type_id
- name — VARCHAR(150) — NOT NULL
- description — TEXT
- country_code — CHAR(2) — NOT NULL
- state — VARCHAR(100)
- city — VARCHAR(120)
- address_line1 — VARCHAR(200) — NOT NULL
- address_line2 — VARCHAR(200)
- latitude — DECIMAL(10,7) — NOT NULL
- longitude — DECIMAL(10,7) — NOT NULL
- checkin_from — TIME
- checkin_to — TIME
- checkout_until — TIME
- smoking_allowed — BOOLEAN
- pets_allowed — BOOLEAN
- avg_rating — DECIMAL(3,2)
- review_count — INT
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
property_type
- property_type_id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(50)
- name — VARCHAR(100) — NOT NULL
rate_plan
- rate_plan_id — BIGINT — Primary key — NOT NULL
- property_id — BIGINT — NOT NULL
- name — VARCHAR(100) — NOT NULL
- refund_policy — VARCHAR(100)
- meal_plan — VARCHAR(50)
- cancellation_rule — TEXT
room_type
- room_type_id — BIGINT — Primary key — NOT NULL
- occupancy_id — BIGINT — Foreign key → occupancy.occupancy_id — NOT NULL
- property_id — BIGINT — Foreign key → property.property_id — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — TEXT
- size_sqm — DECIMAL(6,2)
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
room_type_amenity
- room_type_id — BIGINT — Foreign key → room_type.room_type_id — NOT NULL
- amenity_id — BIGINT — Foreign key → amenity.amenity_id — NOT NULL
room_type_rate_plan
- room_type_id — BIGINT — Foreign key → room_type.room_type_id — NOT NULL
- rate_plan_id — BIGINT — Foreign key → rate_plan.rate_plan_id — NOT NULL
- base_price — DICIMAL — NOT NULL
- cleaning_fee (cleaningFee)
- currency
users
- user_id — BIGINT — Primary key
- email — VARCHAR(255) — NOT NULL
- password_hash — VARCHAR(255) — NOT NULL
- name — VARCHAR(100)
- is_admin — BOOLEAN
- current_mode — ENUM('GUEST','HOST')
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL