LibraryInventory

Game library inventories are used to audit the games in the Library. You must have either the catalog or checkouts LibraryPrivilege to access a Library Inventory.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in LibraryInventoryProperties.

Related Objects

See "Related Objects" in Introduction for how to use them.

library

The Library that this inventory is for.

Relationships

See "Relationships" in Introduction for how to use them.

libraryinventoryitems

The LibraryInventoryItems associated with the inventory.

Services

The services used to fetch and manipulate library inventories.

Search Library Inventories

Note that there is no generalized, contextless library inventory search endpoint. There is currently no use for this within the app.

Read Library Inventory

 GET /api/libraryinventory/xxx

Returns:

 {
   "id" : "xxx",
   "date_created" : "2019-01-27 12:15:00",
   ...
 }

Create Library Inventory

 POST /api/libraryinventory
Optional Params
name

A name for the Inventory. To allow easier reference (than reading the date_created) if the user might have multiple Inventories existing at one time.

Returns the same as a normal read.

Update Library Inventory

 PUT /api/libraryinventory/xxx

Returns the same as a normal read.

Only used for updating an Inventory's name. See Services below for specific endpoints for updating an Inventory's status.

Delete Library Inventory

 DELETE /api/libraryinventory/xxx

Deletes all related LibraryInventoryItems in addition to the Inventory record.

Returns:

 {
   "success" : 1
 }

Activate Inventory

 PUT /api/libraryinventory/xxx/activate

Changes the Inventory's status to "active". Fails if there is already an active Inventory for the Library.

Returns the same as a normal read.

Close Inventory

 PUT /api/libraryinventory/xxx/close

Changes the Inventory's status to "closed". Games cannot be counted in the Inventory if it is closed.

Returns the same as a normal read.

Games Missing from Inventory

 GET /api/libraryinventory/xxx/missing_games

The LibraryGames which are not counted in the Inventory.

Returns:

 {
   "paging" : {...},
   "items" : [
       {
         "id" : "xxx",
         "name" : "Why Didn't You Count Me??",
         ...
       },
       ...
   ]
 }

Add Item to Inventory

 POST /api/libraryinventory/xxx/item
Required Params
game_id

The ID of the LibraryGame being counted for the Inventory.

Returns added LibraryInventoryItem:

 {
   "id" : "xxx",
   "libraryinventory_id" : "xxx",
   "librarygame_id" : "xxx",
   ...
 }

Remove Item from Inventory

 DELETE /api/libraryinventory/xxx/item/:item_id
Required Params
item_id

The ID of the LibraryInventoryItem to delete.

Returns:

 {
   "success" : 1
 }