Skip to content

Domain Model ​

How AvailEngine thinks about the world.

Developer
  └── Business (tenant)
        ├── Resources (what gets booked — stylist, room, table)
        ├── Services (optional — haircut, consultation, dinner)
        ├── Customers (the end client making the booking)
        ├── Bookings (appointment — customer books resource at time)
        ├── Deposits (Stripe payment held for a booking)
        ├── Operating Hours (when the business is open)
        └── Waitlist (customers waiting for a slot)

Concepts ​

ConceptWhat it isKey fields
DeveloperYou — the API user. Owns businesses, gets billed monthly.user_id, Stripe customer, subscription
BusinessA tenant. All data is scoped to one business.business_id, slug, name, timezone
ResourceA bookable unit. Staff member, room, table, camera.resource_id, name, resource_type, capacity
ServiceOptional. What's being performed.service_id, name, duration_minutes, price_cents
CustomerThe end client making the booking.customer_id, first_name, last_name, phone, email
BookingThe core unit. Customer books resource at time.booking_id, status, booking_date, start_time, end_time
DepositStripe payment linked to a booking.deposit_id, amount_cents, status, stripe_payment_intent_id
WaitlistCustomer waiting for a slot to open.waitlist_id, preferred_date, service_id

Booking Statuses ​

pending    → confirmed → checked_in → completed
  ↓             ↓
cancelled    cancelled
               ↓
            no_show

(All states except completed and cancelled can transition to cancelled. confirmed can also transition to no_show.)

StatusMeaning
pendingCreated but needs deposit payment before confirmation
confirmedSlot is locked. Customer is expected
checked_inCustomer arrived
completedService done
cancelledBooking cancelled by customer or staff
no_showCustomer didn't show up

Deposits auto-capture on no_show. They release on cancelled (if within policy).

Resource Types ​

TypeExample
staffHairdresser, doctor, photographer
roomTreatment room, photo studio, private dining room
tableRestaurant table
equipmentCamera, medical device, rental item

Each resource has capacity_min and capacity_max. A staff member who can handle 1-3 customers sets capacity_min: 1, capacity_max: 3.

Released under the MIT License.