Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Claims

A claim records what one line holds or takes from a resource and its scope. Each line of a hold starts as a claim of kind hold. Its status changes as the hold resolves.

Consumption

POST /consume takes supply in one write. It takes all the lines or takes none. A take from a running balance creates a consumption claim with status committed. When a resource keeps its supply entries apart, the claim’s pegs record how much it took from each entry.

Estimates and settlement

A consume with estimate: true takes the estimated quantity immediately. The amount is an estimate on the claim until it is settled. A settle sets the final quantity once. It takes the difference if the final quantity is greater and gives back the difference if it is smaller. If a resource’s shortage rule refuses a line, the settle changes none of the lines. Estimates apply to consumptions of counted units without time buckets.

Bookings

A line on a resource that counts time names a finite span. The span starts and ends at bucket boundaries. It takes the same quantity in every bucket, including the start and excluding the end. A consume creates a booking claim directly. Committing a hold over the span also makes its claim a booking.

A room or court tracked as an individual unit has one calendar. Its resource sets scope.places and scope.holders to false. At the ResourceShark API root, GET /resources/:id/free-instances takes from and to to find units free for the whole span. Your app chooses one and sends scope.instanceId with quantity 1. If the unit is unavailable for that span, the write answers assignment_infeasible and takes nothing.

A booking made by committing a hold can be given back by canceling the hold’s line. The claim then reads cancelled.

A reschedule moves a hold’s line to another span, to another resource that counts in the same unit, with the same code and precision, or to another scope of its resource. The claim keeps its ID and its status. A line that changes resource or scope sends resourceId and its full scope there, including scope.instanceId for a named unit. A booking made by committing a hold can move, and a booking taken by a consume stays where it is. Book time slots moves and swaps bookings, and Reschedule a hold has the request.

Limits

  • A consume or settle takes 1 to 50 lines.
  • A settle takes claims from different resources. A consume can repeat a resource if it counts time in buckets or tracks individual units. On a bucketed resource, the spans of lines in the same scope cannot overlap.

Where to act on it