Hotel bookings

Room types carry what a guest chooses (a double, a suite); rooms are the physical inventory assigned at check-in. Rates set a nightly price for a room type over a date range, so a booking records the price it was actually quoted. A booking has a primary guest and may list others, and payments accumulate against it until it is settled.

Start a project from this schema
$ npx vela create my-app --schema hotel-bookings
users auth
  • id* text
  • password* password
  • tokenKey* text
  • email* email
  • emailVisibility bool
  • verified bool
  • name text
  • avatar file
  • created autodate
  • updated autodate
room_types
  • id* text
  • name* text
  • description text
  • max_guests* number
  • base_rate* number
  • photos file[]
  • amenities json
  • created autodate
  • updated autodate
rooms
  • id* text
  • number* text
  • room_type* room_types
  • floor number
  • status* select
  • notes text
  • created autodate
  • updated autodate
rates
  • id* text
  • room_type* room_types
  • name* text
  • from* date
  • to* date
  • nightly* number
  • min_nights number
  • created autodate
  • updated autodate
guests
  • id* text
  • first_name* text
  • last_name* text
  • email email
  • phone text
  • nationality text
  • document_number text
  • notes text
  • user users
  • created autodate
  • updated autodate
bookings
  • id* text
  • reference* text
  • guest* guests
  • additional_guests guests[]
  • room_type* room_types
  • room rooms
  • check_in* date
  • check_out* date
  • adults* number
  • children number
  • nightly_rate* number
  • total* number
  • status* select
  • source select
  • special_requests text
  • created autodate
  • updated autodate
payments
  • id* text
  • booking* bookings
  • amount* number
  • method* select
  • paid_at* date
  • reference text
  • created autodate
  • updated autodate

Every collection, field and relation above becomes a PocketBase migration in the new project. Change any of it afterwards with vela generate migration --ai, which opens this same diagram as an editor.