DCB Integration
Submitted | Jun 15, 2023 |
|---|---|
Approved | |
Status | DONE |
Impact | high |
Arch Ticket | |
Prod ticket |
Glossary
Term | Description |
|---|---|
DCB | Direct Consortia Borrowing System |
DCB Search UI | Consolidated search for items across a consortium |
Item | Physical or virtual item |
Patron | Patron registered in borrowing institution |
Executive Summary
Integration with DCB allows support for cross-ILS circulation of items. FOLIO can participate in cross-ILS circulation in the role of requester institution, owning institution, and pickup location. DCB will act as an orchestrator for coordinating multi-system circulation transactions. The main goal from the perspective of internal integration implementation for FOLIO is to provide circulation for external items without affecting the existing local circulation flow. FOLIO is implemented as an application with microservice architecture and should reuse the same approach for integration with DCB. The current direction of FOLIO's technological stack suggests that the approach should include integration with third-party systems through edge modules and implementation of microservices should be based on a spring-way approach.
One of the main obstacles to the implementation is that FOLIO's inventory contains information regarding items and circulation of items that are out of inventory context boundaries and overlap with circulation context. This is the reason that it is a challenge to create a virtual item for the FOLIO installation so that it wouldn't leak the properties of virtual items in search results of local items. The target solution for this requires the migration of information related to circulation from inventory and moving it to the context of the circulation module.
The circulation flow inside FOLIO is implemented in a "manager/storage" approach as a RAML module and provides additional limitations because of the complexity of introducing new changes to the circulation module. Because of time constraints, the target solution might be difficult to implement. so it is proposed to create an interim solution that can be used as a basis for migration of the circulation module to spring-way in the future. The solution requires the introduction of a circulation item that would abstract the circulation information from the inventory context. The new module will be implemented as a separate circulation-item module that should serve as a proxy/adapter between the circulation module and the inventory module.
Requirements
Functional Requirements
Supported use cases described in https://folio-org.atlassian.net/browse/UXPROD-4325
Business Flow Diagram: https://miro.com/app/board/uXjVP9HDWqw=/?moveToWidget=3458764545695411304&cot=14
Scenario 1: Circulation from Lending library to Pickup Library
Scenario 1: Circulation from Lending library to Borrowing Library
Non-Functional Requirements
Modifiability: The solution should be loose-coupled and support the existing circulation flow
Performance: FOLIO edge modules should answer under <X> ms
Security: FOLIO edge modules should authorize DCB requests through the API keys mechanism
Scalability: new microservices should support a microservice architecture approach and be stateless
Constraints
API communication from DCB to FOLIO should follow a polling approach. FOLIO should provide a set of related REST APIs
Status check requests can happen with high frequency because of the polling mechanism
The integration implementation should be finished inside ECS initial release.
Risks
Possible additional UI work for different modules related to Umbrella approach.
Assumptions
DCB uses a polling approach to communicate with FOLIO. Hence FOLIO should provide REST API endpoints
DCB is able to authenticate patron. Patron identity is supplied by DCB and known to the FOLIO borrowing library.
DCB is able to provide information on the requested item to the lending library. Item information is known through RTAC and reflects up-to-date information from the inventory of FOLIO
The pickup location can be separate from the borrowing library.
In case the lending or pickup institution was changed DCB should create a new transaction
Request canceling can happen at any point in the lifetime of the borrowing/lending request
FOLIO should support borrowing, lending, and pickup role. Implementation should support the following action for requests:
Creation of virtual patrons in lending and pickup libraries
Creation of virtual items in borrowing and pickup libraries
Creation/update/cancel/status for the lending request
Creation/update/cancel/status for borrowing request
Creation/update/cancel/status for pickup request
Solution Options
Solution | Description | Pros | Cons | HLE | Decision | |
|---|---|---|---|---|---|---|
| 1 | Migration of all of mod-circulation to new spring module | Introduction of new circulationItem that would abstract the actual item from the circulation process. Implementation requires moving properties related to the process of circulation from |
|
| ||
| 2 | Introduction of virtual item/patron in a separate module | Introduction of new circulationItem that would abstract the actual item from the circulation process. Implementation requires moving properties related to the process of circulation from |
|
| XXL | Declined. Introduction of virtual item requires additional virtualizing of inventory entities like instance/holding etc. |
| 3 | Supporting existing API for the creation of temporary items/patrons | The implementation should use existing API and approach with the creation of temporary patrons/items. |
|
| M-L | Declined. Usage of suppression from discovery mechanism involves side-effects in different FOLIO applications like OAI-PMH, mod-search, data-export |
| 4 | Implementation of the creation of virtual patrons and items inside of existing |
|
| |||
| 5 | Implemenation of virtual item with single instance/holding object | Only item is virtualized. Single Instance and holding is created in inventory and used for all DCB Items in lending and pickup libraries. |
|
| In Discussion. Aligned with strategic vision |
Target Architecture (Solution Option 2)
The solution consists of the following components:
edge-dcb- microservice responsible for providing REST API for DCB and API key authorization.mod-dcb- microservice responsible for persisting state of DCB transactions and coordination of internal calls inside FOLIO. Should listen for updates frommod-circulationto reflect the state of DCB transactions to external consumers.mod-circulation-item- should implement an adapter/proxy approach for the virtual item or patron for circulation. The adapter/proxy approach should allow the breaking of dependency between circulation and actual/virtual items. The module should be able to:Create/Get/Update virtual item (circulationItem)
Substitute calls to
mod-inventoryfor items and when the request is related to DCB return Virtual Item
Mod-circulation - should not require significant changes
Diagram Source: Volaris-DCB.drawio (2).xml
API Contracts
Open API Description: API Contract
Entity Relationship Diagram
The target solution introduces a new abstraction for an item in circulation context: CirculationItem. This serves as a proxy for items that are present in mod-inventory and, in case of borrowing and pickup libraries, they represent an item that exists in other institutions. DCB Transaction represents a facade object for the synchronization of different entities in FOLIO.
Interaction Sequence Diagram
Coordination of transactions in different libraries is the responsibility of DCB. The communication mechanism is polling from DCB.
State-Transition Diagram
Scenario: Lending Library to Pickup Library
Scenario: Lending Library to Borrowing Library
Work Breakdown Structure
edge-dcb:
Create a module based on edge-common-spring
implement API contracts and proxy calls to
mod-dcb
mod-dcb:
Create a module based on mod-spring-template
Create liquibase scripts for database structure for DCBTransaction, DCBItem, and DCBPatron entities
Create circulation items in
mod-circulation-itemCreate temporary patron in
mod-patronListen for updates on the circulation process in
mod-circulation
mod-circulation-item:
Create a module based on mod-spring-template
Create a proxy method for fetching items from
mod-inventorysupporting Item contract schemaCreate liquibase scripts for database structure for CirculationItem
mod-circulation:
Adjust calls for item fetching from
mod-inventorytomod-circulation-itemusing multiple interfaces
Impact Analysis
Module | Impact | Modification Size Estimation | Risk of Regression | |
|---|---|---|---|---|
| 1 |
| Change calls for items to proxy | S | High |
| 2 |
| Might require changes from | S | High |
| 3 |
| Might require changes from | M | High |
Concerns related to virtual items
Problem statement 1 - Creation of Virtual Item without its related data
If the idea is to create only virtual item record with limited columns as mentioned in the design then that will not be sufficient to perform the check-in/checkout process with the existing code of mod-circualtion .
Explanation:
In the existing mod-circulation code the checkin/checkout code fetches the item and then fetches the item's related entities (the entire schemas) based on its holdingsRecordId, materialTypeID, permanentLoanTypeId, and effectiveLocationId. These are required attributes in the inventory-storage item's table.
The related data of an item plays a key role. It has to be present or simulated for further steps of the check-in/checkout process otherwise the process will break.
Concerns:
If the circulation_item table does not contain the related data then how to handle the virtual item's related data? What would be the source for this related data of a virtual item?
Tight coupling of item interface with the new module API's. Will we duplicate the schemas for the items related data in our new module?
If the related item data is simulated then it will lead to hardcoding the data for holding, instance, loan etc. That means these entities would be fake and will be needed to satisfy the checkin/checkout flow.
As of now we have anlayzed use cases like checkin/checkout. But, this will impact other use cases like Renew, Cancellation, Fee/Fines.
The mod-circulation code will need more changes than expected to handle the virtual item's related data for example:
The new get circulation item by barcode API to get the item.
To get the item's related data either more API's have to be put in place in the new module mod-circulation-item, or, has to be managed in circulation module maybe by hardcoding the values.
The new put circulation item API will be called to update the item status and other attributes.
After the check-in/check-out, if we click end patron action session, we can see the following error: Failed to send notice for patron action session: referenced item was not found.
For the loan section in the UI, there are empty columns because UI calls
circulation/loansand it requires a change in the related API.
Problem statement 2 - Virtual Item/Temporary Patron on-screen behavior