{"id":23122859,"url":"https://github.com/folio-org/mod-inventory","last_synced_at":"2025-08-13T21:44:33.976Z","repository":{"id":37773850,"uuid":"89595067","full_name":"folio-org/mod-inventory","owner":"folio-org","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-13T13:13:22.000Z","size":4648,"stargazers_count":3,"open_issues_count":1,"forks_count":15,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-04-14T07:57:49.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/folio-org.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-27T12:30:04.000Z","updated_at":"2024-04-15T09:37:31.920Z","dependencies_parsed_at":"2023-12-14T13:50:07.647Z","dependency_job_id":"e40a2b82-20db-4cc3-b29e-e626a99a2f9c","html_url":"https://github.com/folio-org/mod-inventory","commit_stats":null,"previous_names":[],"tags_count":116,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-inventory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-inventory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-inventory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-inventory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/folio-org","download_url":"https://codeload.github.com/folio-org/mod-inventory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230080775,"owners_count":18169619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T07:31:05.046Z","updated_at":"2025-08-13T21:44:33.942Z","avatar_url":"https://github.com/folio-org.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mod-inventory\n\nCopyright (C) 2016-2025 The Open Library Foundation\n\nThis software is distributed under the terms of the Apache License,\nVersion 2.0. See the file \"[LICENSE](LICENSE)\" for more information.\n\n# Goal\n\nFOLIO compatible inventory module.\n\nProvides basic physical item inventory management, currently limited to basic representations of local instances and items, which can only be created via a MODS import.\n\nWritten in Java and uses Maven as its build system.\n\n# Further Documentation\n\nThis readme is intended to get these modules up and running. For further information on what they do, see the [guide](doc/guide.md).\n\n# Prerequisites\n\n## Required\n\n- Java 21 JDK\n- Maven 3.8.0 or later\n\n## Optional\n\n- Node 6.4.0 (for API linting and documentation generation)\n- NPM 3.10.3 (for API linting and documentation generation)\n- Python 3.6.0 (for deployment scripts and tests via okapi setup)\n\n# Preparation\n\n## Git Submodules\n\nThere are some common RAML definitions that are shared between FOLIO projects via Git submodules.\n\nTo initialise these please run `git submodule init \u0026\u0026 git submodule update` in the root directory.\n\nIf these are not initialised, document generation and API linting operations may fail.\n\nMore information is available on the [developer site](https://dev.folio.org/guides/developer-setup#update-git-submodules).\n\n## Groovy and Gradle\n\nIf sdkman is installed, run `source ./setup-environment.sh` to setup the shell with the appropriate versions of Gradle and Groovy.\n\n# Building\n\nrun `mvn compile` from the root directory.\n\nIn order to build an executable Jar (e.g. for Okapi to deploy), run `mvn package`.\n\n# Running\n\n## Port\n\nWhen running the jar file the module looks for the `http.port` and `port`\nsystem property variables in this order, and uses the default 9403 as fallback. Example:\n\n`java -Dhttp.port=8008 -jar target/mod-inventory.jar`\n\nThe Docker container exposes port 9403.\n\n## Preparation\n\n### Running Okapi\n\nMake sure that [Okapi](https://github.com/folio-org/okapi) is running on its default port of 9130 (see the [guide](https://github.com/folio-org/okapi/blob/master/doc/guide.md) for instructions).\n\nA script for building and running Okapi is provided. Run this module's `start-okapi.sh` from the root of the Okapi source.\n\nAs this runs Okapi using Postgres storage, some database preparation is required. This can be achieved by running `./create-okapi-database.sh` from the root of this repository.\n\n### Dependencies\n\nIn order to activate the inventory module for a tenant, the dependencies described in the [Module Descriptor](ModuleDescriptor.json]) need to be fulfilled.\n\nThe simplest way to fulfil these is to use the [inventory storage module](http://https://github.com/folio-org/mod-inventory-storage).\n\n## Registration\n\nTo register the module with deployment instructions and activate it for a demo tenant, run `./start-managed-demo.sh` from the root directory.\n\nTo deactivate and unregister the module, run `./stop-managed-demo.sh` from the root directory.\n\n## Interaction with Kafka\n\n\nThere are several properties that should be set for modules that interact with Kafka: **KAFKA_HOST, KAFKA_PORT, OKAPI_URL, ENV**(unique env ID).\nAfter setup, it is good to check logs in all related modules for errors.\n\n**Environment variables** that can be adjusted for this module and default values:\n * These variables are relevant from the **Iris** release. Module version from 16.3.0:\n    * \"_inventory.kafka.DataImportConsumerVerticle.instancesNumber_\": 5\n    * \"_inventory.kafka.MarcBibInstanceHridSetConsumerVerticle.instancesNumber_\": 5\n    * \"_inventory.kafka.DataImportConsumer.loadLimit_\": 5\n    * \"_inventory.kafka.DataImportConsumerVerticle.maxDistributionNumber_\": 100\n    * \"_inventory.kafka.MarcBibInstanceHridSetConsumer.loadLimit_\": 5\n * These variables are relevant from the **Iris** release (module version from 16.3.0) to **Kiwi** release (module version from 18.0.0):\n    * \"_kafkacache.topic.number.partitions_\": 1\n    * \"_kafkacache.topic.replication.factor_\": 1\n    * \"_kafkacache.log.retention.ms_\": 18000000\n    * \"_kafkacache.topic_\": events_cache\n* These variables are relevant from the **XXXXX** release. Module version from X.X.X:\n    * \"_inventory.kafka.MarcBibUpdateConsumerVerticle.instancesNumber_\": 3\n    * \"_inventory.kafka.MarcBibUpdateConsumer.loadLimit_\": 5\n    * \"_inventory.kafka.MarcBibUpdateConsumer.maxDistributionNumber_\": 100\n* Variables for setting number of partitions of topics:\n  * DI_INVENTORY_INSTANCE_CREATED_PARTITIONS\n  * DI_INVENTORY_HOLDING_CREATED_PARTITIONS\n  * DI_INVENTORY_ITEM_CREATED_PARTITIONS\n  * DI_INVENTORY_INSTANCE_MATCHED_PARTITIONS\n  * DI_INVENTORY_HOLDING_MATCHED_PARTITIONS\n  * DI_INVENTORY_ITEM_MATCHED_PARTITIONS\n  * DI_SRS_MARC_BIB_RECORD_MATCHED_PARTITIONS\n  * DI_INVENTORY_INSTANCE_UPDATED_PARTITIONS\n  * DI_INVENTORY_HOLDING_UPDATED_PARTITIONS\n  * DI_INVENTORY_ITEM_UPDATED_PARTITIONS\n  * DI_INVENTORY_INSTANCE_NOT_MATCHED_PARTITIONS\n  * DI_INVENTORY_HOLDING_NOT_MATCHED_PARTITIONS\n  * DI_INVENTORY_ITEM_NOT_MATCHED_PARTITIONS\n  * DI_SRS_MARC_BIB_RECORD_NOT_MATCHED_PARTITIONS\n  * DI_INVENTORY_AUTHORITY_UPDATED_PARTITIONS\n  * DI_INVENTORY_HOLDINGS_CREATED_READY_FOR_POST_PROCESSING_PARTITIONS\n  * DI_INVENTORY_AUTHORITY_CREATED_READY_FOR_POST_PROCESSING_PARTITIONS\n  * DI_INVENTORY_AUTHORITY_UPDATED_READY_FOR_POST_PROCESSING_PARTITIONS\n  * DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS\n  * INVENTORY_INSTANCE_INGRESS_PARTITIONS\n\nDefault value for all partitions is 1\n\n## Properties\n\n`AUTHORITY_EXTENDED` environment variable enables extended mapping for Authority to support advanced references classification in 5xx fields:\n* broader terms (`$wg` tag)\n* narrower terms (`$wh` tag)\n* earlier headings (`$wa` tag)\n* later headings (`$wb` tag)\n\nDefault value for `AUTHORITY_EXTENDED` is `false`.\nThe mapping itself is implemented in [data-import-processing-core](https://github.com/folio-org/data-import-processing-core).\n\nIf `AUTHORITY_EXTENDED`=true then data import process and quickmarc edit start to use extended version of authority record mapping which can produce additional elements `saftBroaderTerm`, `saftNarrowerTerm`, `saftEarlierHeading`, `saftLaterHeading`, `saftPersonalNameTrunc`, `saftPersonalNameTitleTrunc`, `saftGenreTermTrunc`, `saftGeographicNameTrunc`, `saftCorporateNameTrunc`, `saftCorporateNameTitleTrunc`, `saftMeetingNameTrunc`, `saftMeetingNameTitleTrunc`, `saftUniformTitleTrunc`, `saftTopicalTermTrunc` in json for mapped records and kafka messages, module mod-entitied-links starts to convert extended `AuthorityDto` to db entity and adds `\"relationshipType\"` and truncated versions of saft headings to the entry in `\"authority\"` and `\"authority_archive\"` tables in `\"saft_headings\"` column.\n\n# Making Requests\n\nThese modules provide HTTP based APIs rather than any UI themselves.\n\nAs FOLIO is a multi-tenant system, many of the requests made to these modules are tenant aware (via the X-Okapi-Tenant header), which means most requests need to be made via a system which understands these headers (e.g. another module or UI built using [Stripes](https://github.com/folio-org/stripes-core)).\n\nTherefore, it is suggested that requests to the API are made via tools such as curl or [postman](https://www.getpostman.com/), or via a browser plugin for adding headers, such as [Requestly](https://chrome.google.com/webstore/detail/requestly/mdnleldcmiljblolnjhpnblkcekpdkpa).\n\n## Okapi Root Address\n\nIt is recommended that the modules are located via Okapi. Access via Okapi requires passing the X-Okapi-Tenant header (see the Okapi guide above for details).\n\nhttp://localhost:9130/inventory\n\n# Operating System Support\n\nMost of the development for these modules, thus far, has been performed on OS X, with some on Ubuntu. Feedback for these, and particularly other operating systems is very welcome.\n\nThe GitHub Actions file [.github/workflows/macos.yml](.github/workflows/macos.yml) for macOS demonstrates how to use Homebrew to setup the infrastructure, run the module, enable it for the `diku` tenant and run a request.\n\n## Permissions\n\nThe inventory.all permission set currently represents all of the permissions needed to use the inventory related parts of the system (e.g. the scan application and its configuration). This means that it contains additional permissions than those directly needed by the inventory module itself.\n\n# Additional Information\n\nThe guide and other [documentation](doc) for this module.\n\nOther [modules](https://dev.folio.org/source-code/#server-side).\n\nOther FOLIO Developer documentation is at [dev.folio.org](https://dev.folio.org/)\n\n### Issue tracker\n\nSee project [MODINV](https://issues.folio.org/browse/MODINV)\nat the [FOLIO issue tracker](https://dev.folio.org/guidelines/issue-tracker/).\n\n### ModuleDescriptor\n\nSee the built `target/ModuleDescriptor.json` for the interfaces that this module\nrequires and provides, the permissions, and the additional module metadata.\n\n### API documentation\n\nThis module's [API documentation](https://dev.folio.org/reference/api/#mod-inventory).\n\n### Code analysis\n\n[SonarQube analysis](https://sonarcloud.io/dashboard?id=org.folio%3Amod-inventory).\n\n### Download and configuration\n\nThe built artifacts for this module are available.\nSee [configuration](https://dev.folio.org/download/artifacts) for repository access,\nand the [Docker image](https://hub.docker.com/r/folioorg/mod-inventory/).\n\n# Appendix 1 - Docker Information\n\n## When Using the Modules as Docker Containers\n\nFor the modules to communicate via Okapi Proxy, when running in Docker containers, the address for Okapi Proxy needs to be routable from inside the container.\n\nThis can be achieved by passing a parameter to the script used to start Okapi, as follows `../mod-inventory/start-okapi.sh http://192.168.X.X:9130`\n\nWhere 192.168.X.X is a routable IP address for the host from container instances and both repository clones are at the same directory level on your machine.\n\n### Finding a Routable Address\n\nFinding the appropriate IP address can be OS and Docker implementation dependent, so this is a very early guide rather than thorough treatment of the topic.\n\nIf these methods don't work for you, please do get in touch, so this section can be improved.\n\nOn Linux, `ifconfig docker0 | grep 'inet addr:'` should give output similar to `inet addr:192.168.X.X  Bcast:0.0.0.0  Mask:255.255.0.0`, , the first IP address is usually routable from within containers.\n\nOn Mac OS X (using Docker Native), `ifconfig en0 | grep 'inet '` should give output similar to `inet 192.168.X.X netmask 0xffffff00 broadcast 192.168.X.X`, the first IP address is usually routable from within containers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Fmod-inventory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffolio-org%2Fmod-inventory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Fmod-inventory/lists"}