From cb993d1c9be2803c6bcbcc2afeba5fb38ada1908 Mon Sep 17 00:00:00 2001 From: Kateryna Senchenko Date: Wed, 14 Nov 2018 13:43:31 +0200 Subject: [PATCH] Added schemas and examples from mod-data-import, mod-source-record-manager and mod-source-record-storage --- .editorconfig | 14 + .gitmodules | 3 + CONTRIBUTING.md | 4 + LICENSE | 201 +++++++++++ README.md | 17 + .../mod-data-import/uploadDefinition.sample | 5 + .../uploadDefinitionCollection.sample | 15 + .../jobExecution.sample | 16 + .../jobExecutionCollection.sample | 39 +++ .../jobExecutionCollectionDto.sample | 39 +++ .../jobExecutionDto.sample | 18 + examples/mod-source-record-manager/log.sample | 12 + .../logCollection.sample | 329 ++++++++++++++++++ .../mod-source-record-storage/record.sample | 16 + .../recordCollection.sample | 21 ++ .../mod-source-record-storage/result.sample | 9 + .../resultCollection.sample | 14 + .../mod-source-record-storage/snapshot.sample | 4 + .../snapshotCollection.sample | 17 + raml-util | 1 + schemas/dto/jobExecutionCollectionDto.json | 23 ++ schemas/dto/jobExecutionDto.json | 69 ++++ schemas/dto/record.json | 58 +++ schemas/dto/recordCollection.json | 24 ++ schemas/dto/result.json | 37 ++ schemas/dto/resultCollection.json | 24 ++ schemas/mod-data-import/file.json | 46 +++ schemas/mod-data-import/uploadDefinition.json | 40 +++ .../uploadDefinitionCollection.json | 23 ++ .../jobExecution.json | 66 ++++ .../jobExecutionCollection.json | 23 ++ schemas/mod-source-record-manager/log.json | 52 +++ .../logCollection.json | 23 ++ .../errorRecord.json | 29 ++ .../parsedRecord.json | 24 ++ .../recordModel.json | 55 +++ .../mod-source-record-storage/recordType.json | 6 + .../mod-source-record-storage/snapshot.json | 26 ++ .../snapshotCollection.json | 24 ++ .../sourceRecord.json | 24 ++ 40 files changed, 1490 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitmodules create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 examples/mod-data-import/uploadDefinition.sample create mode 100644 examples/mod-data-import/uploadDefinitionCollection.sample create mode 100644 examples/mod-source-record-manager/jobExecution.sample create mode 100644 examples/mod-source-record-manager/jobExecutionCollection.sample create mode 100644 examples/mod-source-record-manager/jobExecutionCollectionDto.sample create mode 100644 examples/mod-source-record-manager/jobExecutionDto.sample create mode 100644 examples/mod-source-record-manager/log.sample create mode 100644 examples/mod-source-record-manager/logCollection.sample create mode 100644 examples/mod-source-record-storage/record.sample create mode 100644 examples/mod-source-record-storage/recordCollection.sample create mode 100644 examples/mod-source-record-storage/result.sample create mode 100644 examples/mod-source-record-storage/resultCollection.sample create mode 100644 examples/mod-source-record-storage/snapshot.sample create mode 100644 examples/mod-source-record-storage/snapshotCollection.sample create mode 160000 raml-util create mode 100644 schemas/dto/jobExecutionCollectionDto.json create mode 100644 schemas/dto/jobExecutionDto.json create mode 100644 schemas/dto/record.json create mode 100644 schemas/dto/recordCollection.json create mode 100644 schemas/dto/result.json create mode 100644 schemas/dto/resultCollection.json create mode 100644 schemas/mod-data-import/file.json create mode 100644 schemas/mod-data-import/uploadDefinition.json create mode 100644 schemas/mod-data-import/uploadDefinitionCollection.json create mode 100644 schemas/mod-source-record-manager/jobExecution.json create mode 100644 schemas/mod-source-record-manager/jobExecutionCollection.json create mode 100644 schemas/mod-source-record-manager/log.json create mode 100644 schemas/mod-source-record-manager/logCollection.json create mode 100644 schemas/mod-source-record-storage/errorRecord.json create mode 100644 schemas/mod-source-record-storage/parsedRecord.json create mode 100644 schemas/mod-source-record-storage/recordModel.json create mode 100644 schemas/mod-source-record-storage/recordType.json create mode 100644 schemas/mod-source-record-storage/snapshot.json create mode 100644 schemas/mod-source-record-storage/snapshotCollection.json create mode 100644 schemas/mod-source-record-storage/sourceRecord.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0049e29 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d9635ad --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "raml-util"] + path = raml-util + url = https://github.com/folio-org/raml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c6e1e05 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,4 @@ +# Contribution guidelines + +Guidelines for Contributing Code: +[dev.folio.org/guidelines/contributing](https://dev.folio.org/guidelines/contributing) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f79acbf --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# data-import-raml-storage + +Copyright (C) 2018 The Open Library Foundation + +This software is distributed under the terms of the Apache License, Version 2.0. +See the file "[LICENSE](LICENSE)" for more information. + +## Introduction + +This repository contains json schemas and examples from mod-data-import, +mod-source-record-manager and mod-source-record-storage. +It is utilized as a git submodule in each of mentioned repository as its "raml-storage" directory. + +### Issue tracker + +See projects [MODDATAIMP](https://issues.folio.org/browse/MODDATAIMP), [MODSOURMAN](https://issues.folio.org/browse/MODSOURMAN), [MODSOURCE](https://issues.folio.org/browse/MODSOURCE) +at the [FOLIO issue tracker](https://dev.folio.org/guidelines/issue-tracker/). diff --git a/examples/mod-data-import/uploadDefinition.sample b/examples/mod-data-import/uploadDefinition.sample new file mode 100644 index 0000000..7c6c441 --- /dev/null +++ b/examples/mod-data-import/uploadDefinition.sample @@ -0,0 +1,5 @@ +{ + "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "metaJobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360asd", + "status": "NEW" +} diff --git a/examples/mod-data-import/uploadDefinitionCollection.sample b/examples/mod-data-import/uploadDefinitionCollection.sample new file mode 100644 index 0000000..9076a6b --- /dev/null +++ b/examples/mod-data-import/uploadDefinitionCollection.sample @@ -0,0 +1,15 @@ +{ + "uploadDefinitions":[ + { + "id":"17dfac11-1caf-4470-9ad1-d533f6360bdd", + "metaJobExecutionId":"37dfac11-1caf-4470-9ad1-d533f6360asd", + "status":"NEW" + }, + { + "id":"27dfac11-1caf-4470-9ad1-d533f6360bdd", + "metaJobExecutionId":"47dfac11-1caf-4470-9ad1-d533f6360asd", + "status":"NEW" + } + ], + "totalRecords":2 +} diff --git a/examples/mod-source-record-manager/jobExecution.sample b/examples/mod-source-record-manager/jobExecution.sample new file mode 100644 index 0000000..29fa32c --- /dev/null +++ b/examples/mod-source-record-manager/jobExecution.sample @@ -0,0 +1,16 @@ +{ + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "10000", + "jobProfileId": "1", + "parentJobId": "0", + "subordinationType": "CHILD", + "sourcePath": "C:\import\files\import_1.csv", + "runBy": { + "firstName": "DIKU", + "lastName": "ADMINISTRATOR" + }, + "startedDate": "2018-10-30T12:36:55.000", + "completedDate": "2018-10-30T12:40:01.000", + "status": "COMMITED" + } +} diff --git a/examples/mod-source-record-manager/jobExecutionCollection.sample b/examples/mod-source-record-manager/jobExecutionCollection.sample new file mode 100644 index 0000000..0b07354 --- /dev/null +++ b/examples/mod-source-record-manager/jobExecutionCollection.sample @@ -0,0 +1,39 @@ +{ + "jobExecutions": [ + { + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "13414", + "jobProfileName": "Marc jobs profile", + "fileName": "import_1.csv", + "runBy": { + "firstName": "Paolo", + "lastName": "Schiller" + }, + "progress": { + "current": 7, + "total": 19 + }, + "startedDate": "", + "completedDate": "", + "status": "IMPORT_FINISHED" + }, + { + "jobExecutionId": "981oklm8-lkmn-mnds-za98-d533f6360bdd", + "jobExecutionHrId": "11844", + "jobProfileName": "Marc jobs profile", + "fileName": "import_11.csv", + "runBy": { + "firstName": "Brad", + "lastName": "Goodwin" + }, + "progress": { + "current": 45, + "total": 45 + }, + "startedDate": "2018-10-30T13:20:10.000", + "completedDate": "2018-10-30T13:23:25.000", + "status": "COMMITED" + } + ], + "totalRecords": 2 +} diff --git a/examples/mod-source-record-manager/jobExecutionCollectionDto.sample b/examples/mod-source-record-manager/jobExecutionCollectionDto.sample new file mode 100644 index 0000000..da1ccaf --- /dev/null +++ b/examples/mod-source-record-manager/jobExecutionCollectionDto.sample @@ -0,0 +1,39 @@ +{ + "jobExecutions": [ + { + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "13414", + "jobProfileName": "Marc jobs profile", + "fileName": "import_1.csv", + "runBy": { + "firstName": "Paolo", + "lastName": "Schiller" + }, + "progress": { + "current": 7, + "total": 19 + }, + "startedDate": "2018-10-30T13:21:05.000", + "completedDate": "", + "status": "IMPORT_FINISHED" + } + { + "jobExecutionId": "981oklm8-lkmn-mnds-za98-d533f6360bdd", + "jobExecutionHrId": "11844", + "jobProfileName": "Marc jobs profile", + "fileName": "import_11.csv", + "runBy": { + "firstName": "Brad", + "lastName": "Goodwin" + }, + "progress": { + "current": 45, + "total": 45 + }, + "startedDate": "2018-10-30T13:20:10.000", + "completedDate": "2018-10-30T13:23:25.000", + "status": "COMMITED" + } + ], + "totalRecords": 2 +} diff --git a/examples/mod-source-record-manager/jobExecutionDto.sample b/examples/mod-source-record-manager/jobExecutionDto.sample new file mode 100644 index 0000000..bae9bc0 --- /dev/null +++ b/examples/mod-source-record-manager/jobExecutionDto.sample @@ -0,0 +1,18 @@ +{ + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "10000", + "jobProfileName": "Marc jobs profile", + "fileName": "import_1.csv", + "runBy": { + "firstName": "DIKU", + "lastName": "ADMINISTRATOR" + }, + "progress": { + "current": 50, + "total": 50 + }, + "startedDate": "2018-10-30T12:36:55.000", + "completedDate": "2018-10-30T12:40:01.000", + "status": "COMMITED" + } +} diff --git a/examples/mod-source-record-manager/log.sample b/examples/mod-source-record-manager/log.sample new file mode 100644 index 0000000..4de9273 --- /dev/null +++ b/examples/mod-source-record-manager/log.sample @@ -0,0 +1,12 @@ +{ + "id": "dc653de8-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "10000", + "jobProfileName": "Marc jobs profile", + "fileName": "import_1.csv" + "runBy": { + "firstName": "DIKU", + "lastName": "ADMINISTRATOR" + }, + "completedDate": "2018-10-30T12:40:01.000" +} diff --git a/examples/mod-source-record-manager/logCollection.sample b/examples/mod-source-record-manager/logCollection.sample new file mode 100644 index 0000000..db513b9 --- /dev/null +++ b/examples/mod-source-record-manager/logCollection.sample @@ -0,0 +1,329 @@ +{ + "logs": [ + { + "id": "dc653de8-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "13414", + "jobProfileName": "Marc bib jobs", + "fileName": "import_1.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-30T12:40:01.000" + }, + { + "id": "ff567j9l-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "klo09bvc-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "23112", + "jobProfileName": "Marc bib jobs", + "fileName": "import_1.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-30T12:40:01.000" + }, + { + "id": "ffgny678-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "zx334gbn-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "33112", + "jobProfileName": "Marc bib jobs", + "fileName": "import_1.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-30T12:40:01.000" + }, + { + "id": "jkl04579-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "qwsxcv44-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "48906", + "jobProfileName": "Marc bib jobs", + "fileName": "import_1.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T10:00:51.000" + }, + { + "id": "xcffgnh7-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "jj890npz-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "48906", + "jobProfileName": "Marc bib jobs", + "fileName": "import_2.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T10:00:51.000" + }, + { + "id": "jmssxc34-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "ccvg6fgh-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "58906", + "jobProfileName": "Marc bib jobs", + "fileName": "import_2.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-02T10:00:51.000" + }, + { + "id": "sdhhnmkl-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "erxdx46m-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "68551", + "jobProfileName": "Marc bib jobs", + "fileName": "import_3.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-02T10:00:51.000" + }, + { + "id": "554gh1xco-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "77iklzd5-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "75671", + "jobProfileName": "Marc bib jobs", + "fileName": "import_3.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T10:09:51.000" + }, + { + "id": "66784gnm-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "eefgbn89-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "81123", + "jobProfileName": "Marc bib jobs", + "fileName": "import_4.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T10:09:51.000" + }, + { + "id": "ggh090fg-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "ggh890fg-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "91124", + "jobProfileName": "Marc bib jobs", + "fileName": "import_4.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T10:09:51.000" + }, + { + "id": "12ddvb69-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "yty49kml-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "10556", + "jobProfileName": "Marc bib jobs", + "fileName": "import_4.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-02T12:09:51.000" + }, + { + "id": "tthjuv67-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "qqwedfv5-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "11250", + "jobProfileName": "Marc bib jobs", + "fileName": "import_4.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-03T10:01:30.000" + }, + { + "id": "ffbnj890-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "aazxc45f-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "12250", + "jobProfileName": "Marc bib jobs", + "fileName": "import_4.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-03T10:01:30.000" + }, + { + "id": "zxc66hn7-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "12ffvb67-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "13250", + "jobProfileName": "Marc bib jobs", + "fileName": "import_4.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-02T09:05:30.000" + }, + { + "id": "11fgb78c-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "hkdorl60-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "14250", + "jobProfileName": "Marc bib jobs", + "fileName": "import_5.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-03T11:45:21.000" + }, + { + "id": "sdvbnht6-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "asdcvbnm-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "15150", + "jobProfileName": "Marc bib jobs", + "fileName": "import_5.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-02T10:45:21.000" + }, + { + "id": "ascvr542-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "ghnm781a-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "16150", + "jobProfileName": "Marc bib jobs", + "fileName": "import_6.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-03T11:40:21.000" + }, + { + "id": "sdrtyhbn-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "rthn88mp-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "17091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_6.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-03T14:20:21.000" + }, + { + "id": "zxasdcvb-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "sdgbny65-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "18091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_6.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T14:20:21.000" + }, + { + "id": "fg667jmk-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "qwcvbn67-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "18091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_6.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-05T14:20:21.000" + }, + { + "id": "sdghnmkl-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "34thjn77-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "19091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_6.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-01T19:01:41.000" + }, + { + "id": "thnmjk5c-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "ascc56nm-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "20091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_6.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-05T14:20:21.000" + }, + { + "id": "zxssrgb6-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "hjmkll87-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "21091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_7.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-11-05T11:20:21.000" + }, + { + "id": "ghtynnm6-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "aaxcvf56-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "22091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_7.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-31T10:20:21.000" + }, + { + "id": "erfgbnhj-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "g6nnmklo-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "23091", + "jobProfileName": "Marc bib jobs", + "fileName": "import_8.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-31T10:20:21.000" + }, + { + "id": "erfgbnh6-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "dd9mlloy-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "24101", + "jobProfileName": "Marc bib jobs", + "fileName": "import_9.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-31T11:20:21.000" + }, + { + "id": "yyhj78fc-f0df-48ab-9630-13aacfe8e8f4", + "jobExecutionId": "zxc44ghn-1caf-4470-9ad1-d533f6360bdd", + "jobExecutionHrId": "25101", + "jobProfileName": "Marc bib jobs", + "fileName": "import_10.csv", + "runBy": { + "firstName": "John", + "lastName": "Doe" + }, + "completedDate": "2018-10-31T14:20:21.000" + } + ], + "totalRecords": 25 +} diff --git a/examples/mod-source-record-storage/record.sample b/examples/mod-source-record-storage/record.sample new file mode 100644 index 0000000..2309f66 --- /dev/null +++ b/examples/mod-source-record-storage/record.sample @@ -0,0 +1,16 @@ +{ + "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "snapshotId": "11dfac11-1caf-4470-9ad1-d533f6360bdd", + "matchedProfileId": "c9db56f4-e1d4-11e8-9f32-f2801f1b9fd1", + "matchedId": "c9db5b04-e1d4-11e8-9f32-f2801f1b9fd1", + "generation": "1", + "recordType": "MARC", + "sourceRecord": { + "id": "2f390fa6-a2f8-4027-abaf-ee61952668bc", + "source": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + }, + "parsedRecord": { + "id": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1", + "content": "Parsed content" + } +} diff --git a/examples/mod-source-record-storage/recordCollection.sample b/examples/mod-source-record-storage/recordCollection.sample new file mode 100644 index 0000000..271f7fd --- /dev/null +++ b/examples/mod-source-record-storage/recordCollection.sample @@ -0,0 +1,21 @@ +{ + "records": { + { + "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "snapshotId": "11dfac11-1caf-4470-9ad1-d533f6360bdd", + "matchedProfileId": "c9db56f4-e1d4-11e8-9f32-f2801f1b9fd1", + "matchedId": "c9db5b04-e1d4-11e8-9f32-f2801f1b9fd1", + "generation": "1", + "recordType": "MARC", + "sourceRecord": { + "id": "2f390fa6-a2f8-4027-abaf-ee61952668bc", + "source": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + }, + "parsedRecord": { + "id": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1", + "content": "Parsed content" + } + } + }, + "totalRecords": 1 +} diff --git a/examples/mod-source-record-storage/result.sample b/examples/mod-source-record-storage/result.sample new file mode 100644 index 0000000..21b5865 --- /dev/null +++ b/examples/mod-source-record-storage/result.sample @@ -0,0 +1,9 @@ +{ + "recordId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "snapshotId": "11dfac11-1caf-4470-9ad1-d533f6360bdd", + "recordType": "MARC", + "parsedRecord": { + "id": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1", + "content": "Parsed content" + } +} diff --git a/examples/mod-source-record-storage/resultCollection.sample b/examples/mod-source-record-storage/resultCollection.sample new file mode 100644 index 0000000..03d1677 --- /dev/null +++ b/examples/mod-source-record-storage/resultCollection.sample @@ -0,0 +1,14 @@ +{ + "results": { + { + "recordId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "snapshotId": "11dfac11-1caf-4470-9ad1-d533f6360bdd", + "recordType": "MARC", + "parsedRecord": { + "id": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1", + "content": "Parsed content" + } + } + }, + "totalRecords": 1 +} diff --git a/examples/mod-source-record-storage/snapshot.sample b/examples/mod-source-record-storage/snapshot.sample new file mode 100644 index 0000000..3cf1860 --- /dev/null +++ b/examples/mod-source-record-storage/snapshot.sample @@ -0,0 +1,4 @@ +{ + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "status": "NEW" +} diff --git a/examples/mod-source-record-storage/snapshotCollection.sample b/examples/mod-source-record-storage/snapshotCollection.sample new file mode 100644 index 0000000..2d90012 --- /dev/null +++ b/examples/mod-source-record-storage/snapshotCollection.sample @@ -0,0 +1,17 @@ +{ + "snapshots": { + { + "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd", + "status": "NEW" + }, + { + "jobExecutionId": "17dfac11-1caf-4470-9ad1-d533f6360bdd", + "status": "IMPORT_IN_PROGRESS" + }, + { + "jobExecutionId": "27dfac11-1caf-4470-9ad1-d533f6360bdd", + "status": "PARSING_IN_PROGRESS" + } + }, + "totalRecords": 3 +} diff --git a/raml-util b/raml-util new file mode 160000 index 0000000..5f350c1 --- /dev/null +++ b/raml-util @@ -0,0 +1 @@ +Subproject commit 5f350c1f257d1bcf15cb54639ec452ac0e70300b diff --git a/schemas/dto/jobExecutionCollectionDto.json b/schemas/dto/jobExecutionCollectionDto.json new file mode 100644 index 0000000..8eac015 --- /dev/null +++ b/schemas/dto/jobExecutionCollectionDto.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Collection of data transfer objects for JobExecution entities", + "type": "object", + "properties": { + "jobExecutionDtos": { + "description": "List of DTOs for execution jobs", + "type": "array", + "id": "jobExecutionDtoList", + "items": { + "type": "object", + "$ref": "jobExecutionDto.json" + } + }, + "totalRecords": { + "type": "integer" + } + }, + "required": [ + "jobExecutionDtos", + "totalRecords" + ] +} diff --git a/schemas/dto/jobExecutionDto.json b/schemas/dto/jobExecutionDto.json new file mode 100644 index 0000000..105bf9d --- /dev/null +++ b/schemas/dto/jobExecutionDto.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Job Execution data transfer object Schema", + "type": "object", + "properties": { + "jobExecutionId": { + "description": "Unique identifier", + "type": "string" + }, + "jobExecutionHrId": { + "description": "Human readable id", + "type": "string" + }, + "jobProfileName": { + "description": "Name of applied job profile", + "type": "string" + }, + "fileName": { + "description": "File name with extension", + "type": "string" + }, + "runBy": { + "description": "First and last name of the user that triggered the job execution", + "type": "object", + "properties": { + "firstName": { + "description": "First name", + "type": "string" + }, + "lastName": { + "description": "Last name", + "type": "string" + } + } + }, + "progress": { + "description": "Execution progress of the job", + "type": "object", + "properties": { + "current": { + "description": "Currently processing record", + "type": "integer" + }, + "total": { + "description": "Total number of records to be processed", + "type": "integer" + } + } + }, + "startedDate": { + "description": "Date and time when the job execution started", + "type": "string" + }, + "completedDate": { + "description": "Date and time when the job execution completed", + "type": "string" + }, + "status": { + "description": "Current status of the job execution", + "type": "string", + "enum": ["NEW", "IMPORT_IN_PROGRESS", "IMPORT_FINISHED", "PARSING_IN_PROGRESS", "PARSING_FINISHED", "PROCESSING_IN_PROGRESS", "PROCESSING_FINISHED", "COMMITED"] + } + }, + "required": [ + "jobProfileName", + "fileName", + "status" + ] +} diff --git a/schemas/dto/record.json b/schemas/dto/record.json new file mode 100644 index 0000000..06b7060 --- /dev/null +++ b/schemas/dto/record.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Record DTO Schema", + "type": "object", + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "snapshotId": { + "description": "Corresponding snapshot id, which is the same as jobExecutionId", + "type": "string" + }, + "matchedProfileId": { + "description": "Id of the matcher profile which is applied for the record", + "type": "string" + }, + "matchedId": { + "description": "Represents relations with another matched records, necessary for saving the history of applying changes for inventory/holding/etc records", + "type": "string" + }, + "generation": { + "description": "Generation from the last record with the same matchedId incremented by 1", + "type": "string" + }, + "recordType": { + "description": "Type of record, e.g. MARC", + "type": "string", + "$ref": "../mod-source-record-storage/recordType.json" + }, + "sourceRecord": { + "description": "Source record", + "type": "object", + "$ref": "../mod-source-record-storage/sourceRecord.json" + }, + "parsedRecord": { + "description": "Parsed record", + "type": "object", + "$ref": "../mod-source-record-storage/parsedRecord.json" + }, + "errorRecord": { + "description": "Error record", + "type": "object", + "$ref": "../mod-source-record-storage/errorRecord.json" + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "snapshotId", + "recordType", + "sourceRecord" + ] +} diff --git a/schemas/dto/recordCollection.json b/schemas/dto/recordCollection.json new file mode 100644 index 0000000..255a828 --- /dev/null +++ b/schemas/dto/recordCollection.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Collection of record DTO", + "type": "object", + "properties": { + "records": { + "description": "List of records", + "type": "array", + "id": "recordList", + "items": { + "type": "object", + "$ref": "record.json" + } + }, + "totalRecords": { + "description": "Number of records in the list", + "type": "integer" + } + }, + "required": [ + "records", + "totalRecords" + ] +} diff --git a/schemas/dto/result.json b/schemas/dto/result.json new file mode 100644 index 0000000..eef480d --- /dev/null +++ b/schemas/dto/result.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Result DTO Schema", + "type": "object", + "properties": { + "recordId": { + "description": "UUID", + "type": "string" + }, + "snapshotId": { + "description": "Corresponding snapshot id, which is the same as jobExecutionId", + "type": "string" + }, + "recordType": { + "description": "Type of record, e.g. MARC", + "type": "string", + "$ref": "../mod-source-record-storage/recordType.json" + }, + "parsedRecord": { + "description": "Parsed record", + "type": "object", + "$ref": "../mod-source-record-storage/parsedRecord.json" + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "recordId", + "snapshotId", + "recordType", + "parsedRecord" + ] +} diff --git a/schemas/dto/resultCollection.json b/schemas/dto/resultCollection.json new file mode 100644 index 0000000..bf3f2f8 --- /dev/null +++ b/schemas/dto/resultCollection.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Collection of result DTO", + "type": "object", + "properties": { + "results": { + "description": "List of results", + "type": "array", + "id": "resultList", + "items": { + "type": "object", + "$ref": "result.json" + } + }, + "totalRecords": { + "description": "Number of results in the list", + "type": "integer" + } + }, + "required": [ + "results", + "totalRecords" + ] +} diff --git a/schemas/mod-data-import/file.json b/schemas/mod-data-import/file.json new file mode 100644 index 0000000..979ab32 --- /dev/null +++ b/schemas/mod-data-import/file.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "Uploaded file metadata entity", + "additionalProperties": false, + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "sourcePath": { + "description": "The path to the file location", + "type": "string" + }, + "name": { + "description": "Name of the file with extension", + "type": "string" + }, + "jobExecutionId": { + "description": "Link to JobExecution entity", + "type": "string" + }, + "uploadDefinitionId": { + "description": "Link to UploadDefinition entity", + "type": "string" + }, + "loaded": { + "description": "Flag that indicates whether the file is loaded", + "type": "boolean" + }, + "createDate": { + "description": "Date and time when the file definition was created", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "Metadata about creation and changes, provided by the server (client should not provide)", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "name" + ] +} diff --git a/schemas/mod-data-import/uploadDefinition.json b/schemas/mod-data-import/uploadDefinition.json new file mode 100644 index 0000000..6a3259c --- /dev/null +++ b/schemas/mod-data-import/uploadDefinition.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "Upload process definition", + "additionalProperties": false, + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "metaJobExecutionId": { + "description": "Link to the metajob execution", + "type": "string" + }, + "status": { + "description": "Status of upload", + "type": "string", + "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"] + }, + "createDate": { + "description": "Date and time when the upload definition was created", + "type": "string", + "format": "date-time" + }, + "files": { + "description": "Array of file entities", + "type": "array", + "items": { + "type": "object", + "$ref": "file.json" + } + }, + "metadata": { + "description": "Metadata about creation and changes, provided by the server (client should not provide)", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + } +} diff --git a/schemas/mod-data-import/uploadDefinitionCollection.json b/schemas/mod-data-import/uploadDefinitionCollection.json new file mode 100644 index 0000000..7274853 --- /dev/null +++ b/schemas/mod-data-import/uploadDefinitionCollection.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "Collection of upload definitions", + "properties": { + "uploadDefinitions": { + "description": "Array of upload definitions", + "type": "array", + "items": { + "type": "object", + "$ref": "uploadDefinition.json" + } + }, + "totalRecords": { + "description": "Total records in collection", + "type": "integer" + } + }, + "required": [ + "uploadDefinitions", + "totalRecords" + ] +} diff --git a/schemas/mod-source-record-manager/jobExecution.json b/schemas/mod-source-record-manager/jobExecution.json new file mode 100644 index 0000000..4acb8ad --- /dev/null +++ b/schemas/mod-source-record-manager/jobExecution.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Job Execution Schema", + "type": "object", + "properties": { + "jobExecutionId": { + "description": "Unique identifier", + "type": "string" + }, + "jobExecutionHrId": { + "description": "Human readable id", + "type": "string" + }, + "parentJobId": { + "description": "", + "type": "string" + }, + "subordinationType": { + "description": "Type of subordination to another JobExecution entities", + "type": "string", + "enum": ["CHILD", "PARENT_SINGLE", "PARENT_MULTIPLE"] + }, + "jobProfileId": { + "description": "Unique identifier of the JobProfile entity", + "type": "string" + }, + "sourcePath": { + "description": "Path to the file", + "type": "string" + }, + "runBy": { + "description": "First and last name of the user that triggered the job execution", + "type": "object", + "properties": { + "firstName": { + "description": "First name", + "type": "string" + }, + "lastName": { + "description": "Last name", + "type": "string" + } + } + }, + "startedDate": { + "description": "Date and time when the job execution started", + "type": "string" + }, + "completedDate": { + "description": "Date and time when the job execution completed", + "type": "string" + }, + "status": { + "description": "Current status of the job execution", + "type": "string", + "enum": ["NEW", "IMPORT_IN_PROGRESS", "IMPORT_FINISHED", "PARSING_IN_PROGRESS", "PARSING_FINISHED", "PROCESSING_IN_PROGRESS", "PROCESSING_FINISHED", "COMMITED"] + } + }, + "required": [ + "jobExecutionId", + "jobExecutionHrId", + "jobProfileId", + "sourcePath", + "status" + ] +} diff --git a/schemas/mod-source-record-manager/jobExecutionCollection.json b/schemas/mod-source-record-manager/jobExecutionCollection.json new file mode 100644 index 0000000..b92c0e5 --- /dev/null +++ b/schemas/mod-source-record-manager/jobExecutionCollection.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Collection of execution jobs", + "type": "object", + "properties": { + "jobExecutions": { + "description": "List of execution jobs", + "type": "array", + "id": "jobExecutionList", + "items": { + "type": "object", + "$ref": "jobExecution.json" + } + }, + "totalRecords": { + "type": "integer" + } + }, + "required": [ + "jobExecutions", + "totalRecords" + ] +} diff --git a/schemas/mod-source-record-manager/log.json b/schemas/mod-source-record-manager/log.json new file mode 100644 index 0000000..c6323af --- /dev/null +++ b/schemas/mod-source-record-manager/log.json @@ -0,0 +1,52 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Log Schema", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "jobExecutionId": { + "description": "Unique identifier of the executed job", + "type": "string" + }, + "jobExecutionHdId": { + "description": "Human readable id of the executed job", + "type": "string" + }, + "jobProfileName": { + "description": "Name of applied job profile", + "type": "string" + }, + "fileName": { + "description": "File name with extension", + "type": "string" + }, + "runBy": { + "description": "First and last name of the user that triggered the job execution", + "type": "object", + "properties": { + "firstName": { + "description": "First name", + "type": "string" + }, + "lastName": { + "description": "Last name", + "type": "string" + } + } + }, + "completedDate": { + "description": "Date and time when completed the job execution", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "jobExecutionId", + "jobExecutionHrId", + "jobProfileName", + "runBy", + "completedDate" + ] +} diff --git a/schemas/mod-source-record-manager/logCollection.json b/schemas/mod-source-record-manager/logCollection.json new file mode 100644 index 0000000..367ef99 --- /dev/null +++ b/schemas/mod-source-record-manager/logCollection.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Collection of log records", + "type": "object", + "properties": { + "logs": { + "description": "List of log records", + "type": "array", + "id": "logList", + "items": { + "type": "object", + "$ref": "log.json" + } + }, + "totalRecords": { + "type": "integer" + } + }, + "required": [ + "logs", + "totalRecords" + ] +} diff --git a/schemas/mod-source-record-storage/errorRecord.json b/schemas/mod-source-record-storage/errorRecord.json new file mode 100644 index 0000000..eb86a72 --- /dev/null +++ b/schemas/mod-source-record-storage/errorRecord.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Error Record data model", + "type": "object", + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "description" : { + "description": "Error description", + "type": "string" + }, + "content": { + "description": "Record content", + "type": "string" + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "description", + "content" + ] +} diff --git a/schemas/mod-source-record-storage/parsedRecord.json b/schemas/mod-source-record-storage/parsedRecord.json new file mode 100644 index 0000000..ea5c3d6 --- /dev/null +++ b/schemas/mod-source-record-storage/parsedRecord.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Parsed Record Schema", + "type": "object", + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "content": { + "description": "Parsed record content, e.g. MARC record", + "type": "string" + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "content" + ] +} diff --git a/schemas/mod-source-record-storage/recordModel.json b/schemas/mod-source-record-storage/recordModel.json new file mode 100644 index 0000000..5731463 --- /dev/null +++ b/schemas/mod-source-record-storage/recordModel.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Record Data Model", + "type": "object", + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "snapshotId": { + "description": "Corresponding snapshot id, which is the same as jobExecutionId", + "type": "string" + }, + "matchedProfileId": { + "description": "Id of the matcher profile which is applied for the record", + "type": "string" + }, + "matchedId": { + "description": "Represents relations with another matched records, necessary for saving the history of applying changes for inventory/holding/etc records", + "type": "string" + }, + "generation": { + "description": "Generation from the last record with the same matchedId incremented by 1", + "type": "string" + }, + "recordType": { + "description": "Type of record, e.g. MARC", + "type": "string", + "$ref": "recordType.json" + }, + "sourceRecordId": { + "description": "Reference to the corresponding source record", + "type": "string" + }, + "parsedRecordId": { + "description": "Reference to the corresponding parsed record", + "type": "string" + }, + "errorRecordId": { + "description": "Reference to the corresponding error record", + "type": "string" + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "snapshotId", + "recordType", + "sourceRecordId" + ] +} diff --git a/schemas/mod-source-record-storage/recordType.json b/schemas/mod-source-record-storage/recordType.json new file mode 100644 index 0000000..c15661a --- /dev/null +++ b/schemas/mod-source-record-storage/recordType.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Record Type Enum", + "type": "string", + "enum": [ "MARC" ] +} diff --git a/schemas/mod-source-record-storage/snapshot.json b/schemas/mod-source-record-storage/snapshot.json new file mode 100644 index 0000000..ae8d21a --- /dev/null +++ b/schemas/mod-source-record-storage/snapshot.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Snapshot Schema", + "type": "object", + "properties": { + "jobExecutionId": { + "description": "Corresponding jobExecution id", + "type": "string" + }, + "status": { + "description": "Current status", + "type": "string", + "enum": ["NEW", "IMPORT_IN_PROGRESS", "IMPORT_FINISHED", "PARSING_IN_PROGRESS", "PARSING_FINISHED", "PROCESSING_IN_PROGRESS", "PROCESSING_FINISHED", "COMMITTED"] + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "jobExecutionId", + "status" + ] +} diff --git a/schemas/mod-source-record-storage/snapshotCollection.json b/schemas/mod-source-record-storage/snapshotCollection.json new file mode 100644 index 0000000..b6814fa --- /dev/null +++ b/schemas/mod-source-record-storage/snapshotCollection.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Snapshot collection", + "type": "object", + "properties": { + "snapshots": { + "description": "List of snapshots", + "type": "array", + "id": "snapshotList", + "items": { + "type": "object", + "$ref": "snapshot.json" + } + }, + "totalRecords": { + "description": "Number of snapshots in the list", + "type": "integer" + } + }, + "required": [ + "snapshots", + "totalRecords" + ] +} diff --git a/schemas/mod-source-record-storage/sourceRecord.json b/schemas/mod-source-record-storage/sourceRecord.json new file mode 100644 index 0000000..154d737 --- /dev/null +++ b/schemas/mod-source-record-storage/sourceRecord.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Source Record data model", + "type": "object", + "properties": { + "id": { + "description": "UUID", + "type": "string" + }, + "source": { + "description": "Raw data", + "type": "string" + }, + "metadata": { + "description": "Metadata provided by the server", + "type": "object", + "$ref": "../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "required": [ + "source" + ] +}