FIELD NOTES · ACCEPTANCE EXERCISES

Test hire availability with return and turnaround time

A date shown as free in a calendar may be unavailable once return inspection or preparation is included. Before buying a hire-booking website, define the resource identity, interval boundaries and turnaround rule. This brief covers one named physical asset, not a fleet forecast or a live booking integration.

Technical fact, business assumption

PostgreSQL 17 documents range boundaries and exclusion constraints for non-overlapping reservations. Checked 16 October 2026. That establishes one possible enforcement mechanism, not a deployed database or a universal hire policy. The business’s turnaround duration remains an explicit input.

Filled interval matrix

Synthetic same-day example, AEDT: asset A is hired from 09:00 until 12:00. Intervals are half-open: the end is excluded. The business separately requires 60 minutes after return, making A unavailable until 13:00. There is no travel time in this fixture.

On narrow screens, scroll sideways to read the full table.

RequestWithout bufferWith 60-minute bufferDecision
A, 11:30–12:30OverlapOverlapDo not confirm
A, 12:00–13:00Adjacent, no overlapConflicts until 13:00Do not confirm under buffer rule
A, 13:00–14:00No overlapAdjacent, no overlapMay proceed to other checks
B, 10:00–11:00Different assetDifferent assetCheck B’s own records
A, missing return timeUnknownUnknownManual review

Choose an honest booking mode

If asset identity or turnaround is unknown, a request-to-book form can collect preferred times without confirming availability. Instant confirmation needs an authoritative allocation mechanism. A front-end calendar alone is insufficient. A pooled fleet needs a capacity model and cannot use this single-asset constraint unchanged.

Acceptance sequence

  1. Give the supplier the exact asset ID and the business-approved buffer.
  2. Replay all matrix rows, including the exact 12:00 and 13:00 boundaries.
  3. In an isolated system test, make two concurrent requests for the same interval; require one authoritative outcome rather than two green calendar screens.
  4. Test cancellation, delayed return and preparation overrun separately before enabling automatic confirmation.

Required output

Keep resource ID, timezone, start, return, preparation end, overlap IDs and allocation status. A rejected request should show a useful alternative or an enquiry path without revealing another customer’s details. “May proceed” means other checks remain; it is not proof of payment or a confirmed hire.

Limits

The download compares numeric teaching intervals serially. It does not execute SQL, lock stock, handle timezones or test a production race. Confirm timezone conversion, staff availability, maintenance, delivery, deposits and legal terms separately. The Melbourne booking timezone resource handles clock interpretation, a separate problem from resource overlap.

Replay the teaching example

These files run locally without network access. They model only the stated cases, not a live vendor integration. Filled inputs and expected results · Inspectable teaching functions

Save both files in one folder. With Node 22.13 or newer, run:

node decision-check.mjs hire-availability-overlap-test.json