Copyright (C) 2017-2018 The Open Library Foundation
This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.
FOLIO compatible persistent storage of loans, loan policies, loan rules, requests, and fixed due date schedules
Where the API code lives
The implementation java files live in the
package. These implement the actual
java interfaces, to be found in the
package, which are automatically generated from the
raml files in
Corresponding API tests can be found in the
The API documentation generated from the
*.raml files can be found online at
Implementation Specific Behaviours
As a FOLIO interface is limited to describing the protocol (HTTP endpoints and the structure of expected requests and responses) between the client and server there are behaviors which go beyond this definition and are implementation specific, some of which are noted below.
Only one Open Loan per Item
This implementation introduces the constraint that only one loan can be open for a
given item. Requests (either POST or PUT) which could result in two loans with the
itemId and the
Open should be rejected with a error (422) response
- Java 8 JDK
- Maven 3.3.9
- PostgreSQL 9.6.1 (running and listening on the default port, logged in user must have admin rights), with the following extensions
- Python 3.6.0 (for un-registering module during managed deployment scripts)
There are some common RAML definitions that are shared between FOLIO projects via Git submodules.
To initialise these please run
git submodule init && git submodule update in the root directory.
If these are not initialised, the inventory-storage module will fail to build correctly, and other operations may also fail.
More information is available on the developer site.
setup-test-db.sh script in the inventory-storage directory to setup Postgres with a database to be used in tests.
This is only required to run tests against an external Postgres instance, the default is to use an embedded Postgres instance.
Checking the RAML and JSON.Schema definitions
./scripts/lint-raml-cop.sh to validate the RAML and JSON.Schema descriptions of the API.
Frequently Asked Questions
Dates and times
A loan has the date and time when and item was leant to a user and when it was returned. The module expects them to be represented in RFC3339 format.
At the moment, the JSON.schema for loan does provide validation for these (it will eventually use the date-time format included in the standard when this is supported by the RAML module builder).
Other FOLIO Developer documentation is at dev.folio.org