Hosts and availability

The people who can be booked, and when.

A host is someone who can be booked, usually one of your users. Give each your own id as uid, and use it wherever an id goes.

await ...({
  : "doctor_482",
  : "Dr. Ana Reyes",
  : "America/New_York",
  : { : ["NY", "NJ"], : "es" },
});

An email is where their notifications go, not an identity: two hosts can share one, and a host needs none. attributes are what pools choose hosts by.

Schedules

A schedule is weekly hours in local time, with Sunday as day 0. A host's first schedule is their default.

await ...("doctor_482", {
  : [
    { : [1, 2, 3, 4], : "09:00", : "17:00" },
    { : [5], : "09:00", : "12:00" },
  ],
  : [
    { : "2027-12-24", : [] },
    { : "2027-12-31", : [{ : "09:00", : "11:00" }] },
  ],
});

An override replaces that whole day: no ranges means unavailable. Hours stay put across daylight saving, so 09:00 is 09:00 on both sides of a clock change. A range can't cross midnight: use two, and 24:00 for the end of a day.

Changing a schedule only changes what's offered next. Existing bookings stay.

Hosts leaving

A disabled host keeps their bookings but isn't offered. A host with bookings still to come can't be deleted (host_has_live_bookings): cancel them or disable the host.