payments table
The payments table in the Hotel Booking Database Schema schema has 9 columns, keyed by id, with 1 foreign key to bookings.
Deposits, balances and refunds are all rows here, separated by type. Never net them into one figure.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| booking_id | uuid | not null, references bookings.id | |
| type | payment_type | not null | |
| status | payment_status | not null | |
| method | payment_method | not null | |
| amount_cents | integer | not null | |
| currency | char(3) | not null | |
| processor_reference | varchar(120) | unique | |
| processed_at | timestamptz |
Indexes (1)
(booking_id, status)
Relationships
payments.booking_idreferencesbookings.id