Besides the entity types covered elsewhere in this documentation there are several other data types the API returns and takes as arguments.
The types defined below are tied to the way Common Lisp, the language of the core, deals with data. In many cases multiple data types will manifest the same in JSON. This is another area likely to change somewhat in comming releases of the API.
allocationItems are a complex type that does not map to a specific framework entity. Though they are complex, they do not map directly to an entity stored in the database, but rather are context sensitive and derived from the state of an allocation and its related resource schedules.
Each allocationItem represents a single resource on an allocation (or instance of a type by RRT). They are added and edited within the context of a session, and will not persist until the allocation being edited is stored.
Following are the fields on an allocation item serialized from the api.
The nature of these slots is a bit of a moving target which we are working to formalize as we integrate the new scheduler
The id string of this allocationItem. While the id is intended to be globally unique, its identity is only sensable in the context of a session interacting with an allocation
The current stored state of this item or, in the case of an unstored allocation, the state that will be stored.
The new state of this item when and if the allocation is stored.
Was the scheduler able to satisy this item the last time the scheduler was run.
Does this item provide a building pass.
Does this item permit overnight access to a facility.
Can this item be taken off-site
Is this an RRT item?
The resourceType of this item
The resource assigned to this item. May be null in the event of an RRT item.
If we have an assigned resource, is that resource unserialized.
Is the user authorized to use this resource. True for yes, false for no, and null for no authorization needed.
The scheduled pickup time of this item.
The scehduled return time of this item.
For returned items, the actual time the item was returned.
For returned items, the person who noted its return.
Can this item be picked up immediatly or are there intervening allocations that would prevent it.
A circulation period is used in rules determining how long an allocation may last or to determine default pickup and return times. Circulation Periods are serialized as a JSON object with three values; type, duration, and period.
{ "type": "duration", "duration": 8467200, "period": { "quantity": 14, "unit": "weeks" } }
{ "prefix": "The ", "suffix": "Wind in the Willows" }
A duration is an amount of time. The API serializes durations as an integer representing whole seconds.
Timestamps in the API are formatted as ISO 8601 timestrings.
The API always assumes timezones are meaningful. The consumer of this data is strongly encouraged to use a proper time library (Moment.JS with timezones springs to mind) to deal with these dates rather than try to go it alone or *shudder* use the JavaScript Date library
{ "amount": "$2.00", "period": { "quantity": 1, "unit": "hours" }, "perSec": 0.000555555556 }
A sequence of UTF-8 characters. Interchangeable with JSON strings.