---
title: "Scheduling"
summary: "How LatticeKit models what can be booked, when it can be booked, and the lifecycle a booking moves through — including the five shapes of availability and what can block a confirmation."
---

# Scheduling

Scheduling is the centre of most LatticeKit businesses, and it is built to cover more
than appointments on a grid.

Three concepts carry it: an **offer** is what can be taken, an **availability** says when
it can be taken, and a **booking** is one instance of somebody taking it.

## Offer

An offer is the sellable unit and the terms attached to it — how long it lasts, what it
requires, whether it takes a deposit, and what happens if it is cancelled or changed.

An offer's duration is not always a fixed number. It may be fixed (a 60-minute court
booking), variable within bounds (a service that runs as long as it runs), open-ended, or
multi-day. The cancellation and modification policy travels with the offer, so the rules
are attached to the thing being sold rather than applied afterwards.

## Availability

Availability answers "when can this actually be taken", and it comes in five shapes
because businesses genuinely differ:

- **Grid** — discrete slots at regular times. Courts on the hour.
- **Range** — any start time within a window, for a duration the customer chooses.
- **Queue** — no fixed time; customers take a place and are served in order. Walk-ins.
- **Open capacity** — a number of places rather than a set of times. Sixteen seats in a
  class, whoever wants them.
- **External** — the truth lives in another system and LatticeKit reads it.

A single offer can have more than one availability. A class might be bookable in advance
on a grid and also walk-up on a queue.

Grid availability is generated from a **scheme** — a description of the recurring shape
of a week, plus exceptions for holidays and closures. Changing the scheme regenerates
the slots rather than requiring each one to be edited.

## Booking

A booking moves through a lifecycle. The important transition is from held to confirmed,
because that is where the rules apply.

```
PENDING ──► CONFIRMED ──► COMPLETED
   │             │
   └──► EXPIRED  └──► CANCELLED
```

A booking of an offer that takes no deposit and needs no approval is **confirmed** the
moment it is made. Any other booking starts **pending**: the place is held, but not yet
earned. A pending booking has an expiry — if nothing resolves it, the hold is released
and the place returns to the pool. This is what stops abandoned checkouts from silently
consuming inventory. The exception is a booking the customer has already paid a deposit for,
on an offer where the business approves each booking: once it is paid it no longer expires,
and it waits for the business to confirm or cancel it.

A pending booking becomes **confirmed** when everything it owes has been satisfied. Where
an offer takes a deposit, that means the deposit is paid. Where the business approves
each booking itself, that means it has approved this one. Where it requires a signed waiver
or a completed form, that means the form is in. These are tracked as obligations rather
than as booking fields, so a booking can be waiting on more than one thing and can say
which.

**Completed** is reached by the passage of time and, where the business records it,
attendance. **Cancelled** applies the offer's policy — which may mean a refund, a
partial refund, a credit, or nothing.

## What can block a confirmation

If a booking will not confirm, it is almost always one of:

- An unresolved obligation — an unpaid deposit, an unsigned waiver, an unanswered form.
- A resource that could not be committed. A booking that needs a court *and* a coach
  needs both; the platform allocates all-or-nothing rather than half-booking.
- An access rule the customer does not satisfy — a membership tier requirement, or a
  condition the business wrote.
- The slot being taken between the hold and the confirmation.

The failure will say which. See [errors](errors.md).

## Resources

Bookings that need physical things commit them through holds rather than by writing a
field. A hold is exclusive and expires, which is what makes concurrent booking safe: two
customers racing for the last court produce one booking and one clear failure, not two
bookings.

Resources come in kinds — a specific numbered thing, a quantity of interchangeable
stock, or something the business defines itself.

## Group bookings

A booking can cover a party rather than a person, and can carry a roster of who is
actually attending. Attendance is recorded per person, which is what makes class
registers, no-show policies and per-member entitlements work.
