GithubHelp home page GithubHelp logo

natali-zaitseva / mod-circulation-storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from folio-org/mod-circulation-storage

0.0 0.0 0.0 1.03 MB

FOLIO mod-circulation-storage

License: Apache License 2.0

Dockerfile 0.06% Shell 2.62% TSQL 0.11% Python 0.53% RAML 4.80% Java 91.75% PLpgSQL 0.14%

mod-circulation-storage's Introduction

mod-circulation-storage

Copyright (C) 2017-2019 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.

Goal

FOLIO compatible persistent storage of loans, loan policies, circulation rules, requests, and fixed due date schedules

API

Where the API code lives

The implementation java files live in the /src/main/java/org/folio/rest/impl package. These implement the actual java interfaces, to be found in the /src/main/java/org/folio/rest/jaxrs/resource package, which are automatically generated from the raml files in /ramls/.

Corresponding API tests can be found in the /src/test/java/org/folio/rest/api package.

API documentation

The API documentation generated from the *.raml files can be found online at https://dev.folio.org/reference/api/#mod-circulation-storage

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.

HTTP Requests (either POST or PUT) which could result in two loans with the same itemId and the status of Open should be rejected with a error (422) response

Unique Position in per-item Request Queue

This implementation introduces the constraint that only one open (e.g. Open - Not yet filled) request for a given item can be at a particular position in the request queue for that item.

HTTP Requests (either POST or PUT) which could result two open requests with the same itemId and position should be rejected with a error (422) response

Known Limitations

Anonymization SQL

At the moment, this is constructed with string concatenation (it will hopefully soon be replaced by prepared statements).

The userId parameter is checked to take the form of a UUID to try to reduce the exposure of this.

Prerequisites

Required

  • 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
    • pgcrypto
    • unaccent
    • pg_trgm

Optional

  • Python 3.6.0 (for un-registering module during managed deployment scripts, and the lint-raml tools)

Preparation

Git Submodules

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.

PostgreSQL

Run the 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.

Common activities

Checking the RAML and JSON.Schema definitions

Follow the guide to use raml-cop to assess RAML, schema, and examples.

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).

Additional Information

Other modules.

Other FOLIO Developer documentation is at dev.folio.org

Issue tracker

See project CIRCSTORE at the FOLIO issue tracker.

ModuleDescriptor

See the built target/ModuleDescriptor.json for the interfaces that this module requires and provides, the permissions, and the additional module metadata.

API documentation

This module's API documentation.

Code analysis

SonarQube analysis.

Download and configuration

The built artifacts for this module are available. See configuration for repository access, and the Docker image.

Design notes

Request status transition

There is database trigger for request update. It works in the following way:

Given a request with status 'Open - Awaiting pickup'
When the request is updated and new status is 'Closed - Pickup expired' or 'Closed - Cancelled'
Then an update trigger adds the property 'awaitingPickupRequestClosedDate' to the request JSONB

Such behavior is required by Expired Holds Report CSV functionality in mod-circulation
See CIRC-320

mod-circulation-storage's People

Contributors

marcjohnson-kint avatar dcrossleyau avatar julianladisch avatar jeremythuff avatar shale99 avatar kostyantyn-kh avatar kurtnordstrom avatar funkymalc avatar opochernin avatar mtraneis avatar mrdpopov avatar wafschneider avatar marc-johnson avatar hjiebsco avatar adamdickmeiss avatar anatolii-starkov avatar mreno-ebsco avatar rladdusaw avatar vrohach avatar oleksiimaksymov avatar wwelling avatar doytch avatar aclseelen avatar demiankatz avatar dmytrotur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.