| Column | Type | Null | Key | Default |
|---|---|---|---|---|
| id | int(11) | NO | PRI | NULL |
| booking_reference | varchar(50) | NO | UNI | NULL |
| tenant_id | int(11) | NO | MUL | NULL |
| room_id | int(11) | NO | MUL | NULL |
| agent_id | int(11) | YES | MUL | NULL |
| booking_date | timestamp | NO | current_timestamp() | |
| move_in_date | date | NO | NULL | |
| duration | int(11) | NO | NULL | |
| payment_option | enum('monthly','quarterly','biannual','annual') | NO | monthly | |
| booking_option | enum('pay_then_inspect','inspect_then_pay') | NO | NULL | |
| payment_location | varchar(100) | YES | NULL | |
| inspection_date | date | YES | NULL | |
| inspection_time | time | YES | NULL | |
| status | enum('pending','pending_payment','deposit_paid','inspection_scheduled','inspection_completed','awaiting_full_payment','payment_completed','refund_requested','refunded','cancelled','expired','active','completed','confirmed') | NO | pending_payment | |
| payment_completed_at | datetime | YES | NULL | |
| activated_at | datetime | YES | NULL | |
| deposit_paid | tinyint(1) | NO | 0 | |
| deposit_amount | decimal(10,2) | YES | NULL | |
| deposit_payment_date | timestamp | YES | NULL | |
| inspection_completed | tinyint(1) | NO | 0 | |
| inspection_date_completed | timestamp | YES | NULL | |
| agreement_signed | tinyint(1) | NO | 0 | |
| agreement_signed_date | timestamp | YES | NULL | |
| agreement_file | varchar(255) | YES | NULL | |
| created_at | timestamp | NO | current_timestamp() | |
| updated_at | timestamp | NO | current_timestamp() | |
| total_rent | decimal(10,2) | NO | 0.00 | |
| security_deposit | decimal(10,2) | NO | 0.00 | |
| booking_fee | decimal(10,2) | NO | 0.00 | |
| total_amount | decimal(10,2) | NO | 0.00 | |
| amount_paid | decimal(10,2) | NO | 0.00 | |
| balance | decimal(10,2) | NO | 0.00 | |
| currency | varchar(3) | NO | GHS | |
| inspection_status | enum('pending','scheduled','completed','cancelled') | YES | MUL | pending |
| inspection_type | enum('virtual','onsite') | YES | NULL | |
| inspection_feedback | text | YES | NULL | |
| inspection_satisfied | tinyint(1) | YES | NULL | |
| refund_requested | tinyint(1) | NO | 0 | |
| refund_amount | decimal(10,2) | YES | NULL | |
| refund_status | enum('pending','processing','completed','failed') | YES | MUL | NULL |
| refund_date | timestamp | YES | NULL | |
| full_payment_deadline | timestamp | YES | NULL | |
| auto_refund_triggered | tinyint(1) | NO | 0 | |
| payment_gateway_id | int(11) | YES | MUL | NULL |
| hostel_option_id | int(11) | YES | NULL | |
| selected_occupancy | int(11) | YES | NULL | |
| notes | text | YES | NULL | |
| tenant_inspection_confirmed | tinyint(1) | YES | 0 | |
| landlord_inspection_confirmed | tinyint(1) | YES | 0 | |
| inspection_confirmed_at | datetime | YES | NULL | |
| payment_deadline | datetime | YES | MUL | NULL |
| cancellation_reason | text | YES | NULL | |
| cancelled_by | int(11) | YES | NULL | |
| cancelled_at | datetime | YES | MUL | NULL |
| refund_fee | decimal(10,2) | YES | NULL | |
| refund_processed | tinyint(1) | YES | 0 | |
| refund_processed_at | datetime | YES | NULL |
All required columns exist in the bookings table.
Your database is properly configured for bookings.
These columns are not required but may be used by other features.