{"id":23122717,"url":"https://github.com/folio-org/mod-orders-storage","last_synced_at":"2026-01-12T09:22:43.824Z","repository":{"id":30486994,"uuid":"110741131","full_name":"folio-org/mod-orders-storage","owner":"folio-org","description":"Storage (CRUD) module for Orders","archived":false,"fork":false,"pushed_at":"2024-10-29T12:21:16.000Z","size":2281,"stargazers_count":1,"open_issues_count":2,"forks_count":6,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-10-29T12:39:18.697Z","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":"NEWS.md","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,"publiccode":null,"codemeta":null}},"created_at":"2017-11-14T20:29:21.000Z","updated_at":"2024-10-25T10:55:45.000Z","dependencies_parsed_at":"2023-12-19T12:15:42.362Z","dependency_job_id":"1d756060-bf95-4729-b5ff-226097a9c41f","html_url":"https://github.com/folio-org/mod-orders-storage","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-orders-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-orders-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-orders-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-orders-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/folio-org","download_url":"https://codeload.github.com/folio-org/mod-orders-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230080758,"owners_count":18169617,"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:30:00.484Z","updated_at":"2026-01-12T09:22:43.793Z","avatar_url":"https://github.com/folio-org.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mod-orders-storage\n\nCopyright (C) 2018-2023 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## Introduction\n\nThis is the Orders storage module.\n\n*NOTE*: This module is intended for internal use only.  Please use the APIs provided by mod-orders instead.  There is a lot of business logic in mod-orders that will be bypassed if talking directly to the storage layer. While this is mainly important for create/update/delete operations, it also includes get operations as well. For instance, summary information is calculated in the business logic module (mod-orders).\n\n## Preparation\n\n### Sample Data Loading\n\nSample data can be optionally loaded during tenant initialization. By default, if no parameters are passed the sample data will not be loaded. \n\nThe module supports v1.2 of the Okapi _tenant interface. This version of the interface allows Okapi to pass tenant initialization parameters using the tenantParameters key. Currently, the only parameter supported is the loadSample key, which will cause the module to load sample data for the tenant if set to true. Here is an example of passing the parameter to the module via Okapi's /_/proxy/tenants/\u003ctenantId\u003e/install endpoint:\n\n* ENABLING VIA OKAPI:\ncurl -w '\\n' -X POST -d '[ { \"id\": \"mod-orders-storage-3.0.0\", \"action\": \"enable\" } ]' http://localhost:9130/_/proxy/tenants/test-tenant/install?tenantParameters=loadSample=true\nThis results in a post to the module's _tenant API with the following structure:\n```\n{\n  \"module_to\": \"mod-orders-storage-3.3.0\",\n  \"parameters\": [\n    {\n      \"key\": \"loadSample\",\n      \"value\": \"true\"\n    }\n  ]\n}\n```\n\n* STANDALONE:\nA post to http://localhost:8081/_/tenant\n```\n{\n\t\"module_to\": \"mod-orders-storage-3.0.0-SNAPSHOT\",\n\t\"parameters\": [\n    {\n      \"key\": \"loadSample\",\n      \"value\": \"true\"\n    }\n    ]\n}\n```\nDATA SOURCE\n\nThe sample data lives in /resources/data folder. Each folder is named identical to the endpoint the data has to be loaded to. The TenantReferenceAPI will then be able to load data into the corresponding table using a POST to the endpoint\n\n\n### Modifying default sample data loading behavior\nSample data load behavior can be modified by passing a command line argument loadSample\nUnlike the tenant parameters the command Line argument will be applicable for all the tenants.\n\n* COMMAND LINE: \njava -jar target/mod-orders-storage-fat.jar loadSample=true\n\n\nNote: The priority for the parameters in the order Tenant Parameters \u003e Command Line argument \u003e Default value\n\n### Search and Filtering on APIs\nIn order to support search and filtering for the APIs /orders-storage/purchase-orders and /orders-storage/po-lines was implemented [cross index approach](https://github.com/folio-org/raml-module-builder#cql2pgjson-foreign-key-cross-table-index-queries)\n\n\n## Additional information\n\n### Kafka domain event pattern\nThe pattern means that every time when a domain entity is created/updated/deleted a message is posted to kafka topic. \nCurrently, domain events are supported for orders, order lines and pieces The events are posted into the following topics:\n\n- `ACQ_ORDER_CHANGED` - for orders\n- `ACQ_ORDER_LINE_CHANGED` - for order lines\n- `ACQ_PIECE_CHANGED` - for pieces\n\nThe event payload has the following structure:\n```json5\n{\n  \"id\": \"12bb13f6-d0fa-41b5-b0ad-d6561975121b\",\n  \"action\": \"CREATED|UPDATED|DELETED\",\n  \"userId\": \"1d4f3f6-d0fa-41b5-b0ad-d6561975121b\",\n  \"eventDate\": \"2024-11-14T10:00:00.000+0000\",\n  \"actionDate\": \"2024-11-14T10:00:00.000+0000\",\n  \"entitySnapshot\": { } // entity being either: order, orderLine, piece\n}\n```\n\nDefault value for all partitions is 1.\nKafka partition key for all the events is entity id.\n\n### Issue tracker\n\nSee project [MODORDSTOR](https://issues.folio.org/browse/MODORDSTOR)\nat the [FOLIO issue tracker](https://dev.folio.org/guidelines/issue-tracker).\n\n### Other documentation\n\nOther [modules](https://dev.folio.org/source-code/#server-side) are described,\nwith further FOLIO Developer documentation at\n[dev.folio.org](https://dev.folio.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Fmod-orders-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffolio-org%2Fmod-orders-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Fmod-orders-storage/lists"}