Giter Site home page Giter Site logo

digital-blueprint / relay-sublibrary-bundle Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 1.01 MB

Symfony bundle provides API endpoints communication with ALMA

Home Page: https://packagist.org/packages/dbp/relay-sublibrary-bundle

PHP 100.00%
alma dbp digital-blueprint symfony symfony-bundle sublibrary

relay-sublibrary-bundle's Introduction

Dbp Relay SubLibrary Bundle

GitHub | Packagist | Frontend Application

Test

DISCLAIMER: This bundle needs a specific ALMA configuration to work. Please contact [email protected] for more information.

This Symfony 4.4 bundle provides API endpoints for

  • assigning a call number to a book
  • borrowing a book from the sublibrary
  • returning a book to the sublibrary
  • extending a loan period for a book
  • showing sublibrary's book list
  • showing sublibrary's current loans
  • showing sublibrary's current book orders

for the API-Gateway.

There is a corresponding frontend application that uses this API at Sublibrary Frontend Application.

Prerequisites

  • API Gateway with openAPI/Swagger
  • Alma backend access with special configuration (for analytics)

Bundle installation

You can install the bundle directly from packagist.org.

composer require dbp/relay-sublibrary-bundle

Integration into the API Server

  • Add the necessary bundles to your config/bundles.php:
...
Dbp\Relay\SublibraryBundle\DbpRelaySublibraryBundle::class => ['all' => true],
Dbp\Relay\CoreBundle\DbpRelayCoreBundle::class => ['all' => true],
];
  • Run composer install to clear caches

Configuration

The bundle has configuration values that you can specify in your app, either by hardcoding it, or by referencing an environment variable.

For this create config/packages/dbp_relay_sublibrary.yaml in the app with the following content:

dbp_relay_sublibrary:
  api_url: '%env(ALMA_API_URL)%'
  api_key: '%env(ALMA_API_KEY)%'
  analytics_api_key: '%env(ALMA_ANALYTICS_API_KEY)%'
  readonly: '%env(bool:ALMA_READONLY)%'

Your .env file should then contain the following environment variables you need to configure the bundle:

###> dbp/relay-sublibrary-bundle ###
ALMA_API_URL=https://api-eu.hosted.exlibrisgroup.com/almaws/v1
ALMA_API_KEY=
ALMA_ANALYTICS_API_KEY=
ALMA_READONLY=
###< dbp/relay-sublibrary-bundle ###

If you were using the DBP API Server Template as template for your Symfony application, then the configuration files should have already been generated for you.

For more info on bundle configuration see https://symfony.com/doc/current/bundles/configuration.html.

relay-sublibrary-bundle's People

Contributors

euneuber avatar lazka avatar manuelkocher avatar pbek avatar renovate[bot] avatar tobiasgv avatar toegl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

relay-sublibrary-bundle's Issues

Race condition for aborted or interleaving report caching

In case the report is fetched and some parts of it are cached, but not everything, then future requests will work with an outdated cache, failing on some later paginated request.

Potential fix: Use custom caching after everything is done instead of the guzzle cache.

Handle (other) users that exist in Alma but don't in LDAP

In case there exist users in Alma that doesn't in LDAP (because the user got removed) we should communicate that to the frontend and don't fail for operations where they are optional:

Assume there is a user NONEXIST that is missing in LDAP:

  • Borrow book: If NONEXIST has already borrowed it we shouldn't fail with an alma-id error, instead with "Existing loan was found!".

  • Return book: If it gets returned for NONEXIST then maybe we can ignore the error? And just show "Borrower: Unknown"

  • Show current loan list: Show the loans by NONEXIST with "Unknown" instead of the email button.

In case we return a "Person" from the API things get tricky. Not sure what to do there.. maybe just return null and let the frontend handle it..

Trigger cache warmup on specific library actions

Every time a user does a specific action for a library we could start a background job warming up the cache for everything related to that library.

In the common case this means that after the first action is done there is a good chance everything else will be faster.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Detected dependencies

composer
composer.json
  • php >=8.1
  • api-platform/core ^2.7.11 || ^3.2
  • dbp/relay-base-person-bundle ^0.2.26
  • dbp/relay-core-bundle ^0.1.150
  • doctrine/collections ^1.6 || ^2
  • doctrine/common ^3.1
  • guzzlehttp/guzzle ^7.0
  • kevinrob/guzzle-cache-middleware ^3.3 || ^4.0 || ^5.0
  • league/uri ^6.4 || ^7.4
  • symfony/framework-bundle ^6.4
  • symfony/security-core ^6.4
  • symfony/security-bundle ^6.4
  • symfony/yaml ^6.4
  • psr/http-message ^1.0 || ^2.0
  • psr/log ^1.1.4 || ^2.0 || ^3.0
  • symfony/cache ^6.4
  • symfony/config ^6.4
  • symfony/http-foundation ^6.4
  • symfony/http-kernel ^6.4
  • symfony/dependency-injection ^6.4
  • friendsofphp/php-cs-fixer ^3.50
  • mockery/mockery ^1.6.7
  • nelmio/cors-bundle ^2.4.0
  • phpstan/phpstan ^1.10.59
  • phpstan/phpstan-phpunit ^1.3.16
  • phpunit/phpunit ^9.6.17
  • symfony/browser-kit ^6.4
  • symfony/http-client ^6.4
  • symfony/monolog-bundle ^3.10
  • symfony/phpunit-bridge ^6.4
  • symfony/twig-bundle ^6.4
  • vimeo/psalm ^5.22.2
  • symfony/error-handler ^6.4
  • symfony/monolog-bridge ^6.4
github-actions
.github/workflows/test.yml
  • shivammathur/setup-php v2
  • actions/checkout v4
  • actions/cache v4
  • shivammathur/setup-php v2
  • actions/checkout v4
  • actions/cache v4

  • Check this box to trigger a request for Renovate to run again on this repository

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.