From f9b9bc77b2b7a5a3d3e41a1c2b7f58f56dec2cbe Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 8 Sep 2025 08:27:48 +0000 Subject: [PATCH] Bug 37762: ISO18626 REST API specs Reference: https: //illtransactions.org/schemas/ISO-18626-2021-2.xsd Signed-off-by: Jason Robb Signed-off-by: Lisette Scheer Signed-off-by: Lucas Gass --- Koha/REST/V1/ILL/ISO18626.pm | 102 ++++++++++++++++++ .../confirmation/confirmationHeader.yaml | 28 +++++ .../ISO18626/confirmation/errorData.yaml | 12 +++ .../swagger/definitions/ISO18626/request.yaml | 35 ++++++ .../ISO18626/request/bibliographicInfo.yaml | 87 +++++++++++++++ .../bibliographicItemId.yaml | 20 ++++ .../bibliographicRecordId.yaml | 24 +++++ .../ISO18626/request/billingInfo.yaml | 21 ++++ .../ISO18626/request/patronInfo.yaml | 42 ++++++++ .../ISO18626/request/publicationInfo.yaml | 48 +++++++++ .../request/requestedDeliveryInfo.yaml | 16 +++ .../request/requestingAgencyInfo.yaml | 19 ++++ .../ISO18626/request/serviceInfo.yaml | 63 +++++++++++ .../ISO18626/request/supplierInfo.yaml | 35 ++++++ .../ISO18626/requestConfirmation.yaml | 19 ++++ .../requestingAgencyAuthentication.yaml | 12 +++ .../ISO18626/requestingAgencyMessage.yaml | 21 ++++ .../requestingAgencyMessageConfirmation.yaml | 20 ++++ .../ISO18626/supplyingAgencyMessage.yaml | 27 +++++ .../supplyingAgencyMessage/deliveryInfo.yaml | 47 ++++++++ .../supplyingAgencyMessage/messageInfo.yaml | 40 +++++++ .../supplyingAgencyMessage/retryInfo.yaml | 61 +++++++++++ .../supplyingAgencyMessage/returnInfo.yaml | 12 +++ .../supplyingAgencyMessage/shippingInfo.yaml | 25 +++++ .../supplyingAgencyMessage/statusInfo.yaml | 19 ++++ .../supplyingAgencyMessageConfirmation.yaml | 19 ++++ .../definitions/ISO18626/types/action.yaml | 13 +++ .../definitions/ISO18626/types/address.yaml | 11 ++ .../types/address/electronicAddress.yaml | 11 ++ .../types/address/physicalAddress.yaml | 24 +++++ .../definitions/ISO18626/types/agencyId.yaml | 15 +++ .../definitions/ISO18626/types/costs.yaml | 13 +++ .../definitions/ISO18626/types/errorType.yaml | 22 ++++ .../ISO18626/types/messageStatus.yaml | 6 ++ .../ISO18626/types/reasonForMessage.yaml | 10 ++ .../ISO18626/types/requestHeader.yaml | 32 ++++++ .../ISO18626/types/requestSubType.yaml | 8 ++ .../ISO18626/types/requestType.yaml | 6 ++ .../types/requestingAgencyMessageHeader.yaml | 32 ++++++ .../ISO18626/types/schemeValuePair.yaml | 4 + .../ISO18626/types/serviceType.yaml | 6 ++ .../definitions/ISO18626/types/status.yaml | 18 ++++ .../types/supplyingAgencyMessageHeader.yaml | 26 +++++ .../definitions/ISO18626/types/yesNo.yaml | 5 + .../ISO18626/valuePairs/courierName.yaml | 9 ++ .../ISO18626/valuePairs/deliveryMethod.yaml | 11 ++ .../ISO18626/valuePairs/itemFormat.yaml | 25 +++++ .../ISO18626/valuePairs/loanCondition.yaml | 9 ++ .../ISO18626/valuePairs/paymentMethod.yaml | 14 +++ .../ISO18626/valuePairs/serviceLevel.yaml | 10 ++ api/v1/swagger/paths/ill_iso18626.yaml | 53 +++++++++ api/v1/swagger/swagger.yaml | 20 ++++ 52 files changed, 1287 insertions(+) create mode 100644 Koha/REST/V1/ILL/ISO18626.pm create mode 100644 api/v1/swagger/definitions/ISO18626/confirmation/confirmationHeader.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/confirmation/errorData.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/bibliographicInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicItemId.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicRecordId.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/billingInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/patronInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/publicationInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/requestedDeliveryInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/requestingAgencyInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/serviceInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/request/supplierInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/requestConfirmation.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/requestHeader/requestingAgencyAuthentication.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/requestingAgencyMessage.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/requestingAgencyMessageConfirmation.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/deliveryInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/messageInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/retryInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/returnInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/shippingInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/statusInfo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/supplyingAgencyMessageConfirmation.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/action.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/address.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/address/electronicAddress.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/address/physicalAddress.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/agencyId.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/costs.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/errorType.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/messageStatus.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/reasonForMessage.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/requestHeader.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/requestSubType.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/requestType.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/requestingAgencyMessageHeader.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/schemeValuePair.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/serviceType.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/status.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/supplyingAgencyMessageHeader.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/types/yesNo.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/valuePairs/courierName.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/valuePairs/deliveryMethod.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/valuePairs/itemFormat.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/valuePairs/loanCondition.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/valuePairs/paymentMethod.yaml create mode 100644 api/v1/swagger/definitions/ISO18626/valuePairs/serviceLevel.yaml create mode 100644 api/v1/swagger/paths/ill_iso18626.yaml diff --git a/Koha/REST/V1/ILL/ISO18626.pm b/Koha/REST/V1/ILL/ISO18626.pm new file mode 100644 index 0000000000..cc8d9c00ed --- /dev/null +++ b/Koha/REST/V1/ILL/ISO18626.pm @@ -0,0 +1,102 @@ +package Koha::REST::V1::ILL::ISO18626; + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Mojo::Base 'Mojolicious::Controller'; + +use Koha::ILL::ISO18626; +use Koha::ILL::ISO18626::Request; +use Koha::ILL::ISO18626::Requests; + +use Try::Tiny qw( catch try ); + +=head1 API + +=head2 Methods + +=head3 message + + XSD schema used: + https://illtransactions.org/schemas/ISO-18626-v1_1.xsd + +=cut + +sub message { + my $c = shift->openapi->valid_input or return; + my $body = $c->req->body; + my $json = JSON::decode_json($body); + my $response; + + return $c->render( + status => 403, + openapi => { error => 'Server unavailable' } + ) unless C4::Context->preference('ILLModule'); + + # 1) Identify the ISO18626 message + my ($messageType) = keys %$json; + my $message_types = Koha::ILL::ISO18626::message_types; + unless ( grep { $_ eq $messageType } @$message_types ) { + return $c->render( status => 400, text => 'Invalid message type ' . $messageType ); + } + + # 2) Check for validation errors + my $validation_errors = Koha::ILL::ISO18626::is_invalid( $messageType, $json ); + if ($validation_errors) { + $response = Koha::ILL::ISO18626::error_response( + $messageType . 'Confirmation', + $validation_errors + ); + $c->res->headers->add( 'Content-Type', 'application/xml' ); + return $c->render( status => 400, openapi => $response ); + } + + # 3) Handle authentication + my $requesting_agency = Koha::ILL::ISO18626::is_auth_ok( $messageType, $json ); + if ( !$requesting_agency ) { + $response = Koha::ILL::ISO18626::error_response( + $messageType . 'Confirmation', + { errorValue => 'AuthenticationFailed', errorMessage => 'Invalid accountId or securityCode provided.' } + ); + $c->res->headers->add( 'Content-Type', 'application/xml' ); + return $c->render( status => 400, openapi => $response ); + } + + # 4) Handle confirmation response + return try { + Koha::Database->new->schema->txn_do( + sub { + my $response = Koha::ILL::ISO18626::confirmation_response( $messageType, $body, $requesting_agency ); + $c->res->headers->add( 'Content-Type', 'application/xml' ); + return $c->render( status => $response->{status}, openapi => $response->{openapi} ); + } + ); + } catch { + if ($_) { + if ( $_->isa('Koha::Exceptions::Object::DuplicateID') ) { + return $c->render( + status => 409, + openapi => { error => $_->error, conflict => $_->duplicate_id } + ); + } + } + + $c->unhandled_exception($_); + }; +} + +1; diff --git a/api/v1/swagger/definitions/ISO18626/confirmation/confirmationHeader.yaml b/api/v1/swagger/definitions/ISO18626/confirmation/confirmationHeader.yaml new file mode 100644 index 0000000000..fc0fa8a294 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/confirmation/confirmationHeader.yaml @@ -0,0 +1,28 @@ +--- +type: object +properties: + supplyingAgencyId: + $ref: '../types/agencyId.yaml' + description: Identification of the supplying library + requestingAgencyId: + $ref: '../types/agencyId.yaml' + description: Identification of the requesting library + timestamp: + type: string + format: date-time + description: Date and time of the confirmation transaction See ISO 8601-1 YYYY-MM-DDThh:mm:ssZ + requestingAgencyRequestId: + type: string + description: Requesting library’s request identification + timestampReceived: + type: string + format: date-time + description: Date and time of the confirmed request transaction See ISO 8601-1 YYYY-MM-DDThh:mm:ssZ + messageStatus: + $ref: '../types/messageStatus.yaml' + description: Value “OK” or “ERROR” +required: + - timestamp + - timestampReceived + - messageStatus +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/confirmation/errorData.yaml b/api/v1/swagger/definitions/ISO18626/confirmation/errorData.yaml new file mode 100644 index 0000000000..0858428c73 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/confirmation/errorData.yaml @@ -0,0 +1,12 @@ +--- +type: object +properties: + errorType: + $ref: '../types/errorType.yaml' + errorValue: + type: + - string + - "null" +required: + - errorType +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request.yaml b/api/v1/swagger/definitions/ISO18626/request.yaml new file mode 100644 index 0000000000..59d0973c25 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request.yaml @@ -0,0 +1,35 @@ +--- +type: object +properties: + request: + type: object + properties: + header: + $ref: './types/requestHeader.yaml' + bibliographicInfo: + $ref: './request/bibliographicInfo.yaml' + publicationInfo: + $ref: './request/publicationInfo.yaml' + serviceInfo: + $ref: './request/serviceInfo.yaml' + supplierInfo: + type: array + items: + $ref: './request/supplierInfo.yaml' + requestedDeliveryInfo: + type: array + items: + $ref: './request/requestedDeliveryInfo.yaml' + requestingAgencyInfo: + $ref: './request/requestingAgencyInfo.yaml' + patronInfo: + $ref: './request/patronInfo.yaml' + billingInfo: + $ref: './request/billingInfo.yaml' + required: + - header + - bibliographicInfo + - serviceInfo +required: + - request +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo.yaml new file mode 100644 index 0000000000..48a2b88136 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo.yaml @@ -0,0 +1,87 @@ +--- +type: object +properties: + supplierUniqueRecordId: + type: + - string + - "null" + description: SupplierUniqueRecordId should be used for the supplying librarys internal unique identifier for the requested item, acquired from a preceding automatic holdings request. If this identifier is used, there should be no other identifiers in BibliographicInfo + title: + type: + - string + - "null" + description: Title of the requested item + author: + type: + - string + - "null" + description: Author of the requested item + authorId: + type: + - string + - "null" + description: ISNI name identifier of the author. See ISO 27729 + subtitle: + type: + - string + - "null" + description: Subtitle of the requested item + seriesTitle: + type: + - string + - "null" + description: Title of the series + edition: + type: + - string + - "null" + description: Number or name of the edition + titleOfComponent: + type: + - string + - "null" + description: Title of the component part (e.g. article) + authorOfComponent: + type: + - string + - "null" + description: Author of the component part + volume: + type: array + description: Volume number + issue: + type: + - string + - "null" + description: Issue number + pagesRequested: + type: + - string + - "null" + description: Page from and page to + estimatedNoPages: + type: + - string + - "null" + description: Expected number of pages + bibliographicItemId: + type: array + items: + $ref: './bibliographicInfo/bibliographicItemId.yaml' + description: Identification of a physical or electronic object + sponsor: + type: + - string + - "null" + description: Person or organization sponsoring the publication + informationSource: + type: + - string + - "null" + description: Description of where bibliographic information was found + bibliographicRecordId: + type: array + items: + $ref: './bibliographicInfo/bibliographicRecordId.yaml' + description: Identification of a bibliographic record +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicItemId.yaml b/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicItemId.yaml new file mode 100644 index 0000000000..00f9e52fd5 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicItemId.yaml @@ -0,0 +1,20 @@ +--- +type: object +properties: + bibliographicItemIdentifier: + type: string + bibliographicItemIdentifierCode: + type: string + enum: + - DOI # ISO 26324 + - Handle # RFC 3650 + - ISBN # ISO 2108 + - ILII # ISO 20247 + - ISSN # ISO 3297 + - ISMN # ISO 10957 + - NBN # RFC 8458 + - URN # RFC 8141 +required: + - bibliographicItemIdentifier + - bibliographicItemIdentifierCode +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicRecordId.yaml b/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicRecordId.yaml new file mode 100644 index 0000000000..fc35d1655e --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/bibliographicInfo/bibliographicRecordId.yaml @@ -0,0 +1,24 @@ +--- +type: object +properties: + bibliographicRecordIdentifier: + type: string + bibliographicRecordIdentifierCode: + type: string + enum: + - AMICUS # Canadian National Catalogue code + - BL # British Library + - FAUST # FAUST number (Denmark) + - JNB # Japanese National Bibliography + - LA # Libraries Australia + - LCCN # Library of Congress. Cataloging Number (US) + - Medline # Medline + - NCID # NACSIS-CAT bibliographic record identifier (Japan) + - OCLC # OCLC + - PID # Danish National Union Catalogue Record Identifier + - PMID # PubMed Id + - TP # Te Puna (New Zealand) +required: + - bibliographicRecordIdentifier + - bibliographicRecordIdentifierCode +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/billingInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/billingInfo.yaml new file mode 100644 index 0000000000..452cbe2618 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/billingInfo.yaml @@ -0,0 +1,21 @@ +--- +type: object +properties: + paymentMethod: + $ref: '../valuePairs/paymentMethod.yaml' + description: The preferred payment method If the requesting library is willing and is able to accept any payment method, then the requesting library shall not include this element in the message + maximumCosts: + $ref: '../types/costs.yaml' + description: The highest amount the requesting agency is prepared to pay for the service. If the requesting library has no maximum costs, then the requesting library shall not include this element in the message. + billingMethod: + $ref: '../types/schemeValuePair.yaml' + description: Preferred billing method + billingName: + type: + - string + - "null" + description: Name of the contact person in finance department, etc. + address: + $ref: '../types/address.yaml' + description: Name of the contact person in finance department, etc. +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/patronInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/patronInfo.yaml new file mode 100644 index 0000000000..3bbf6ddedf --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/patronInfo.yaml @@ -0,0 +1,42 @@ +--- +type: object +properties: + patronId: + type: + - string + - "null" + description: Details of the patron for whom the request is being made + surname: + type: + - string + - "null" + description: Details of the patron for whom the request is being made + givenName: + type: + - string + - "null" + description: First name of the patron + patronType: + type: string + enum: + - Adult + - Child + - DoctoralStudent + - Faculty + - GraduateStudent + - PostdoctoralResearcher + - PostgraduateStudent + - Researcher + - Staff + - Student + - UnderGraduateStudent + description: Type of patron + sendToPatron: + $ref: '../types/yesNo.yaml' + description: Only used with value “Y” if requesting library asks the supplying library to send the requested resource directly to the patron + address: + type: array + items: + $ref: '../types/address.yaml' + description: Description of how to contact the patron. +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/publicationInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/publicationInfo.yaml new file mode 100644 index 0000000000..79de2f6222 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/publicationInfo.yaml @@ -0,0 +1,48 @@ +--- +type: object +properties: + publisher: + type: + - string + - "null" + description: Name of the publisher + publisherId: + type: + - string + - "null" + description: ISNI name identifier of the publisher. See ISO 27729 + publicationType: + type: string + enum: + - ArchiveMaterial + - Article + - AudioBook + - Book + - Chapter + - ConferenceProc + - Game + - GovernmentPubl + - Image + - Journal + - Manuscript + - Map + - Movie + - MusicRecording + - MusicScore + - Newspaper + - Patent + - Report + - SoundRecording + - Thesis + description: Type of publication + publicationDate: + type: + - string + - "null" + description: Date of publication. For serials and serial articles, this should be the publication date of the component part such as issue, not the date when the serial was first issued + placeOfPublication: + type: + - string + - "null" + description: Place of publication, e.g. a city +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/requestedDeliveryInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/requestedDeliveryInfo.yaml new file mode 100644 index 0000000000..8c114c0af3 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/requestedDeliveryInfo.yaml @@ -0,0 +1,16 @@ +--- +type: object +properties: + sortOrder: + type: + - integer + - "null" + description: Value from 1 to 99 according to the order + address: + $ref: '../types/address.yaml' + description: Description of the delivery address + deliveryMethod: + $ref: '../valuePairs/deliveryMethod.yaml' + courierName: + $ref: '../valuePairs/courierName.yaml' +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/requestingAgencyInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/requestingAgencyInfo.yaml new file mode 100644 index 0000000000..7b63c57d6c --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/requestingAgencyInfo.yaml @@ -0,0 +1,19 @@ +--- +type: object +properties: + name: + type: + - string + - "null" + description: Name of the requesting agency + contactName: + type: + - string + - "null" + description: Name of the requesting agency + address: + type: array + items: + $ref: '../types/address.yaml' + description: Description of how to contact the requesting agency +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/serviceInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/serviceInfo.yaml new file mode 100644 index 0000000000..e64ed0ddcb --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/serviceInfo.yaml @@ -0,0 +1,63 @@ +--- +type: object +properties: + requestType: + $ref: '../types/requestType.yaml' + description: If no request type is specified, the default is “New” + requestSubType: + type: array + items: + $ref: '../types/requestSubType.yaml' + description: Sub type to qualify the request + requestingAgencyPreviousRequestId: + type: + - string + - "null" + description: Requesting agencys previous request number when a retry is sent. The Retry request may include updated data based on ReasonRetry + serviceType: + $ref: '../types/serviceType.yaml' + description: If Copy is requested, then the requesting library is interested only in a copy. If Loan is requested, then the requesting library is interested only in a loan. If CopyOrLoan is requested, then the requesting library is willing to accept either a copy or a loan + serviceLevel: + type: array + items: + $ref: '../valuePairs/serviceLevel.yaml' + itemFormat: + type: array + items: + $ref: '../valuePairs/itemFormat.yaml' + needBeforeDate: + type: + - string + - "null" + format: date-time + description: The request is not relevant after the stated date/time Ref. ISO 8601-1 YYYY-MM-DDThh:mm:ssZ. If the requesting library is willing and is able to accept the requested item at any time, then the requesting library shall not include this element in the message + copyrightCompliance: + $ref: '../types/schemeValuePair.yaml' + description: The requesting librarys copyright compliance + anyEdition: + $ref: '../types/yesNo.yaml' + description: Yes for yes to any edition. No if only the specified edition is acceptable + loanCondition: + type: array + items: + $ref: '../valuePairs/loanCondition.yaml' + startDate: + type: + - string + - "null" + format: date-time + description: Start date for a Booking (RequestSubType) See ISO 8601-1 YYYY-MM-DDThh:mm:ssZ + endDate: + type: + - string + - "null" + format: date-time + description: End date for a Booking (RequestSubType) See ISO 8601-1 YYYY-MM-DDThh:mm:ssZ + note: + type: + - string + - "null" + description: Human readable note +required: + - serviceType +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/request/supplierInfo.yaml b/api/v1/swagger/definitions/ISO18626/request/supplierInfo.yaml new file mode 100644 index 0000000000..a46f82a180 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/request/supplierInfo.yaml @@ -0,0 +1,35 @@ +--- +type: object +properties: + sortOrder: + type: + - integer + - "null" + description: Value from 1 to 99 defining the order of preference of use + supplierCode: + $ref: '../types/agencyId.yaml' + description: Code defining a potential supplier + supplierDescription: + type: + - string + - "null" + description: Textual information about supplier + bibliographicRecordId: + $ref: './bibliographicInfo/bibliographicRecordId.yaml' + description: Identification of a bibliographic record used + callNumber: + type: + - string + - "null" + description: Indication of the shelf position of the resource + summaryHoldings: + type: + - string + - "null" + description: Textual description of summary level holdings + availabilityNote: + type: + - string + - "null" + description: Information about availability +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/requestConfirmation.yaml b/api/v1/swagger/definitions/ISO18626/requestConfirmation.yaml new file mode 100644 index 0000000000..4ae59bc12f --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/requestConfirmation.yaml @@ -0,0 +1,19 @@ + +--- +type: object +properties: + requestConfirmation: + type: object + properties: + confirmationHeader: + $ref: './confirmation/confirmationHeader.yaml' + errorData: + type: array + items: + $ref: './confirmation/errorData.yaml' + required: + - confirmationHeader + additionalProperties: false +required: + - requestConfirmation +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/requestHeader/requestingAgencyAuthentication.yaml b/api/v1/swagger/definitions/ISO18626/requestHeader/requestingAgencyAuthentication.yaml new file mode 100644 index 0000000000..23f1d13e34 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/requestHeader/requestingAgencyAuthentication.yaml @@ -0,0 +1,12 @@ +--- +type: object +properties: + accountId: + type: + - string + - "null" + securityCode: + type: + - string + - "null" +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/requestingAgencyMessage.yaml b/api/v1/swagger/definitions/ISO18626/requestingAgencyMessage.yaml new file mode 100644 index 0000000000..a6cd41bb80 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/requestingAgencyMessage.yaml @@ -0,0 +1,21 @@ +--- +type: object +properties: + requestingAgencyMessage: + type: object + properties: + header: + $ref: './types/requestingAgencyMessageHeader.yaml' + action: + $ref: './types/action.yaml' + note: + type: + - string + - "null" + required: + - header + - action + additionalProperties: false +required: + - requestingAgencyMessage +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/requestingAgencyMessageConfirmation.yaml b/api/v1/swagger/definitions/ISO18626/requestingAgencyMessageConfirmation.yaml new file mode 100644 index 0000000000..8889b4ee85 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/requestingAgencyMessageConfirmation.yaml @@ -0,0 +1,20 @@ +--- +type: object +properties: + requestingAgencyMessageConfirmation: + type: object + properties: + confirmationHeader: + $ref: './confirmation/confirmationHeader.yaml' + action: + $ref: './types/action.yaml' + errorData: + type: array + items: + $ref: './confirmation/errorData.yaml' + required: + - confirmationHeader + additionalProperties: false +required: + - requestingAgencyMessageConfirmation +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage.yaml new file mode 100644 index 0000000000..77ceafc1f7 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage.yaml @@ -0,0 +1,27 @@ +--- +type: object +properties: + supplyingAgencyMessage: + type: object + properties: + header: + $ref: './types/supplyingAgencyMessageHeader.yaml' + messageInfo: + $ref: './supplyingAgencyMessage/messageInfo.yaml' + statusInfo: + $ref: './supplyingAgencyMessage/statusInfo.yaml' + retryInfo: + $ref: './supplyingAgencyMessage/retryInfo.yaml' + deliveryInfo: + $ref: './supplyingAgencyMessage/deliveryInfo.yaml' + shippingInfo: + $ref: './supplyingAgencyMessage/shippingInfo.yaml' + returnInfo: + $ref: './supplyingAgencyMessage/returnInfo.yaml' + required: + - header + - messageInfo + - statusInfo +required: + - supplyingAgencyMessage +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/deliveryInfo.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/deliveryInfo.yaml new file mode 100644 index 0000000000..13e08b7e87 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/deliveryInfo.yaml @@ -0,0 +1,47 @@ +--- +type: object +properties: + dateSent: + type: string + format: date-time + description: Start date for a Booking (RequestSubType) See ISO 8601-1 YYYY-MM-DDThh:mm:ssZ + itemId: + type: + - string + - "null" + description: Value of Barcode(s) or RFID-tag Id of the item(s) being delivered + URL: + type: + - string + - "null" + description: URL from which to download or access the requested item + deliveryMethod: + $ref: '../valuePairs/deliveryMethod.yaml' + description: The service via which the requested item was sent + address: + $ref: '../types/address.yaml' + sentToPatron: + type: + - boolean + - "null" + loanCondition: + type: array + items: + $ref: '../valuePairs/loanCondition.yaml' + itemFormat: + type: array + items: + $ref: '../valuePairs/itemFormat.yaml' + serviceType: + $ref: '../types/serviceType.yaml' + description: If Copy is requested, then the requesting library is interested only in a copy. If Loan is requested, then the requesting library is interested only in a loan. If CopyOrLoan is requested, then the requesting library is willing to accept either a copy or a loan + deliveryCosts: + type: array + items: + $ref: '../types/costs.yaml' + paymentMethod: + $ref: '../valuePairs/paymentMethod.yaml' + description: The payment method preferred by the supplying library +required: + - dateSent +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/messageInfo.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/messageInfo.yaml new file mode 100644 index 0000000000..9e984d4a96 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/messageInfo.yaml @@ -0,0 +1,40 @@ +--- +type: object +properties: + reasonForMessage: + $ref: '../types/reasonForMessage.yaml' + answerYesNo: + $ref: '../types/yesNo.yaml' + note: + type: + - string + - "null" + reasonUnfilled: + type: string + enum: + - NonCirculating + - NotAvailableForILL + - NotHeld + - NotOnShelf + - PolicyProblem + - PoorCondition + reasonRetry: + type: string + enum: + - AtBindery + - CostExceedsMaxCost + - CourierNotSupp + - MultiVolAvail + - MustMeetLoanCondition + - NotCurrentAvailableForILL + - NotFoundAsCited + - OnLoan + - OnOrder + - ReqDelDateNotPossible + - ReqDelMethodNotSupp + - ReqEditionNotPossible + - ReqFormatNotPossible + - ReqPayMethodNotSupported + - ReqServLevelNotSupp + - ReqServTypeNotPossible +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/retryInfo.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/retryInfo.yaml new file mode 100644 index 0000000000..70ceee8ad0 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/retryInfo.yaml @@ -0,0 +1,61 @@ +--- +type: object +properties: + loanCondition: + type: array + items: + $ref: '../valuePairs/loanCondition.yaml' + description: Applied when ReasonRetry, MustMeetLoanCondition is used because the supplying library requires that conditions of use be met once the requested item is delivered + edition: + type: array + items: + type: + - string + - "null" + itemFormat: + type: array + items: + $ref: '../valuePairs/itemFormat.yaml' + volume: + type: array + items: + type: + - string + - "null" + serviceType: + $ref: '../types/serviceType.yaml' + description: If Copy is requested, then the requesting library is interested only in a copy. If Loan is requested, then the requesting library is interested only in a loan. If CopyOrLoan is requested, then the requesting library is willing to accept either a copy or a loan + serviceLevel: + type: array + items: + $ref: '../valuePairs/serviceLevel.yaml' + deliveryMethod: + type: array + items: + $ref: '../valuePairs/deliveryMethod.yaml' + description: Applied when ReasonRetry, ReqDelMethodNotSupp is used, because the requested delivery method(s) are not supported. The supplying library indicates which delivery methods are supported + courierName: + type: array + items: + $ref: '../valuePairs/courierName.yaml' + offeredCosts: + type: array + items: + $ref: '../types/costs.yaml' + description: Applied when ReasonRetry, MaximumCosts, is used because actual costs exceed those specified by the requesting library. The supplying library indicates what the actual cost shall be (consists of Complex Type Costs) + paymentMethod: + type: array + items: + $ref: '../valuePairs/paymentMethod.yaml' + description: Applied when ReasonRetry, ReqPayMethodNotSupp is used, because the requested payment method is not supported. The supplying library indicates which payment method(s) are supported + retryBefore: + type: + - string + - "null" + format: date-time + retryAfter: + type: + - string + - "null" + format: date-time +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/returnInfo.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/returnInfo.yaml new file mode 100644 index 0000000000..3d67d21202 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/returnInfo.yaml @@ -0,0 +1,12 @@ +--- +type: object +properties: + returnAgencyId: + $ref: '../types/agencyId.yaml' + name: + type: + - string + - "null" + physicalAddress: + $ref: '../types/address/physicalAddress.yaml' +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/shippingInfo.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/shippingInfo.yaml new file mode 100644 index 0000000000..14243e8815 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/shippingInfo.yaml @@ -0,0 +1,25 @@ +--- +type: object +properties: + courierName: + $ref: '../valuePairs/courierName.yaml' + trackingId: + type: array + items: + type: + - string + - "null" + description: The tracking number(s) assigned by the courier to the package(s) containing the item(s) to be shipped + insurance: + $ref: '../types/yesNo.yaml' + insuranceThirdParty: + $ref: '../types/yesNo.yaml' + thirdPartyName: + type: + - string + - "null" + insuranceCosts: + type: array + items: + $ref: '../types/costs.yaml' +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/statusInfo.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/statusInfo.yaml new file mode 100644 index 0000000000..075222936d --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessage/statusInfo.yaml @@ -0,0 +1,19 @@ +--- +type: object +properties: + status: + $ref: '../types/status.yaml' + expectedDeliveryDate: + type: + - string + - "null" + format: date-time + dueDate: + type: + - string + - "null" + format: date-time + lastChange: + type: string + format: date-time +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessageConfirmation.yaml b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessageConfirmation.yaml new file mode 100644 index 0000000000..608e9db96b --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/supplyingAgencyMessageConfirmation.yaml @@ -0,0 +1,19 @@ +--- +type: object +properties: + supplyingAgencyMessageConfirmation: + type: object + properties: + confirmationHeader: + $ref: './confirmation/confirmationHeader.yaml' + reasonForMessage: + $ref: './types/reasonForMessage.yaml' + errorData: + type: array + items: + $ref: './confirmation/errorData.yaml' + required: + - confirmationHeader +required: + - supplyingAgencyMessageConfirmation +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/action.yaml b/api/v1/swagger/definitions/ISO18626/types/action.yaml new file mode 100644 index 0000000000..b892823856 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/action.yaml @@ -0,0 +1,13 @@ +--- +type: string +enum: + - StatusRequest # The requesting library asks the supplying library to provide the current status for the request + - Received # The requesting library notifies the supplying library the requested item has been received + - Cancel # The requesting library asks the supplying library if the request may be cancelled. The supplying library returns a SupplyingAgencyMessage with ReasonForMessage = CancelResponse Yes or No. + - Renew # The requesting library asks the supplying library if the item currently on loan may be renewed. The supplying library returns a SupplyingAgencyMessage with ReasonForMessage = RenewResponse Yes or No (and DueDate if applicable) + - HoldReturn # The requesting library notifies the supplying library that an item currently on loan cannot be returned for the time being (due to temporary issues that prevent processing of returns at the requesting library) + - ShippedReturn # The requesting library notifies the supplying library that the borrowed item has been sent back + - ShippedForward # The requesting library notifies the supplying library that the borrowed item has been returned and sent to the library specified in ReturnInfo + - Notification # The requesting library sends a message to the supplying library + - Lost # The requesting library notifies the supplying library the item has been lost +description: Action in confirmed Receiving Agency Message diff --git a/api/v1/swagger/definitions/ISO18626/types/address.yaml b/api/v1/swagger/definitions/ISO18626/types/address.yaml new file mode 100644 index 0000000000..d604a2d52c --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/address.yaml @@ -0,0 +1,11 @@ +--- +type: object +properties: + address: + $ref: './address/physicalAddress.yaml' + # FIXME: Allow both, but oneOf and anyOf are swagger v3 only + # anyOf: + # - $ref: 'definitions/ISO18626/request/address/electronicAddress.yaml' + # - $ref: 'definitions/ISO18626/request/address/physicalAddress.yaml' + +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/address/electronicAddress.yaml b/api/v1/swagger/definitions/ISO18626/types/address/electronicAddress.yaml new file mode 100644 index 0000000000..3cc57b7e00 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/address/electronicAddress.yaml @@ -0,0 +1,11 @@ +--- +type: object +properties: + electronicAddressType: + $ref: '../../types/schemeValuePair.yaml' + electronicAddressData: + type: string +required: + - electronicAddressType + - electronicAddressData +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/address/physicalAddress.yaml b/api/v1/swagger/definitions/ISO18626/types/address/physicalAddress.yaml new file mode 100644 index 0000000000..658b8fe106 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/address/physicalAddress.yaml @@ -0,0 +1,24 @@ +--- +type: object +properties: + line1: + type: + - string + - "null" + line2: + type: + - string + - "null" + locality: + type: + - string + - "null" + postalCode: + type: + - string + - "null" + region: + $ref: '../../types/schemeValuePair.yaml' + country: + $ref: '../../types/schemeValuePair.yaml' +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/agencyId.yaml b/api/v1/swagger/definitions/ISO18626/types/agencyId.yaml new file mode 100644 index 0000000000..1e535e5f37 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/agencyId.yaml @@ -0,0 +1,15 @@ +--- +type: object +properties: + agencyIdType: + type: string + enum: + - DNUCNI # Danish National Union Catalogue Non-ISIL Identifier + - ICOLC # https://icolc.net/consortia + - ISIL # ISO 15511 + agencyIdValue: + type: string +required: + - agencyIdType + - agencyIdValue +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/costs.yaml b/api/v1/swagger/definitions/ISO18626/types/costs.yaml new file mode 100644 index 0000000000..29e89c6d10 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/costs.yaml @@ -0,0 +1,13 @@ +--- +type: object +properties: + currencyCode: + type: string + description: Currency symbol as specified in ISO 4217 e.g. 'USD', 'EUR', 'GBP', 'AUD' + monetaryValue: + type: number + format: float +required: + - currencyCode + - monetaryValue +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/errorType.yaml b/api/v1/swagger/definitions/ISO18626/types/errorType.yaml new file mode 100644 index 0000000000..0b02977eab --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/errorType.yaml @@ -0,0 +1,22 @@ +--- +type: object +properties: + errorType: + type: string + enum: + - UnsupportedActionType + - UnsupportedReasonForMessageType + - UnrecognisedDataElement + - UnrecognisedDataValue + - BadlyFormedMessage + description: | + The type of error that occurred. + + * `UnsupportedActionType`: The supplying library cannot handle the received message because the Action in Requesting Agency Message is not supported Value: Action type which is not supported by the application + * `UnsupportedReasonForMessageType`: The requesting library cannot handle the received message because the ReasonforMessage in the Supplying Agency Message is not supported Value: ReasonforMessage type which is not supported by the application + * `UnrecognisedDataElement`: The supplying library or requesting library has received a data element it does not recognize Values: data element which is not recognized by the application + * `UnrecognisedDataValue`: The receiving system may respond with an error message if the content of a data element is not understandable or if the code or combination of codes is not recognized Value: The combination of the name of the data element and the element values or combination of elements values which is not recognized by the application + * `BadlyFormedMessage`: The structure of the incoming message did not conform to the protocol schema definition and could not be interpreted by the receiving system No value +required: + - errorType +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/messageStatus.yaml b/api/v1/swagger/definitions/ISO18626/types/messageStatus.yaml new file mode 100644 index 0000000000..6f3e70a667 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/messageStatus.yaml @@ -0,0 +1,6 @@ +--- +type: string +enum: + - OK + - ERROR +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/reasonForMessage.yaml b/api/v1/swagger/definitions/ISO18626/types/reasonForMessage.yaml new file mode 100644 index 0000000000..5f44438d80 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/reasonForMessage.yaml @@ -0,0 +1,10 @@ +--- +type: string +enum: + - RequestResponse + - StatusRequestResponse + - RenewResponse + - CancelResponse + - StatusChange + - Notification +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/requestHeader.yaml b/api/v1/swagger/definitions/ISO18626/types/requestHeader.yaml new file mode 100644 index 0000000000..527c917ea8 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/requestHeader.yaml @@ -0,0 +1,32 @@ +--- +type: object +properties: + supplyingAgencyId: + $ref: '../types/agencyId.yaml' + description: Identification of supplying library. Shall be provided except for RequestSubType = PatronRequest and TransferRequest + requestingAgencyId: + $ref: '../types/agencyId.yaml' + description: Identification of requesting library + consortialId: + $ref: '../types/agencyId.yaml' + description: Identification of the consortium with which the request is associated + multipleItemRequestId: + type: + - string + - "null" + description: Identification of MultipleItemRequest + timestamp: + type: string + format: date-time + description: Date and time of the transaction + requestingAgencyRequestId: + type: string + description: Requesting librarys request identification or number + requestingAgencyAuthentication: + $ref: '../requestHeader/requestingAgencyAuthentication.yaml' + description: Authentication in supplying library system of the requesting library +required: + - requestingAgencyId + - timestamp + - requestingAgencyRequestId +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/requestSubType.yaml b/api/v1/swagger/definitions/ISO18626/types/requestSubType.yaml new file mode 100644 index 0000000000..eaf62de5a3 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/requestSubType.yaml @@ -0,0 +1,8 @@ +--- +type: string +enum: + - BookingRequest + - MultipleItemRequest + - PatronRequest + - TransferRequest + - SupplyingLibrarysChoice diff --git a/api/v1/swagger/definitions/ISO18626/types/requestType.yaml b/api/v1/swagger/definitions/ISO18626/types/requestType.yaml new file mode 100644 index 0000000000..88275b3f46 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/requestType.yaml @@ -0,0 +1,6 @@ +--- +type: string +enum: + - New + - Retry + - Reminder diff --git a/api/v1/swagger/definitions/ISO18626/types/requestingAgencyMessageHeader.yaml b/api/v1/swagger/definitions/ISO18626/types/requestingAgencyMessageHeader.yaml new file mode 100644 index 0000000000..9ddf4609b5 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/requestingAgencyMessageHeader.yaml @@ -0,0 +1,32 @@ +--- +type: object +properties: + supplyingAgencyId: + $ref: '../types/agencyId.yaml' + description: Identification of supplying library. Shall be provided except for RequestSub-Type = PatronRequest and TransferRequest + requestingAgencyId: + $ref: '../types/agencyId.yaml' + consortialId: + $ref: '../types/agencyId.yaml' + description: Identification of the consortium with which the request is associated + timestamp: + type: string + format: date-time + description: Date and time of the transaction + requestingAgencyRequestId: + type: string + description: Requesting librarys request identification or number + supplyingAgencyRequestId: + type: + - string + - "null" + description: Supplying librarys request identification or number + requestingAgencyAuthentication: + $ref: '../requestHeader/requestingAgencyAuthentication.yaml' + description: Authentication in supplying library system of the requesting library +required: +- supplyingAgencyId +- requestingAgencyId +- timestamp +- requestingAgencyRequestId +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/schemeValuePair.yaml b/api/v1/swagger/definitions/ISO18626/types/schemeValuePair.yaml new file mode 100644 index 0000000000..e5059c4e05 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/schemeValuePair.yaml @@ -0,0 +1,4 @@ +--- +type: string +xml: + attribute: true diff --git a/api/v1/swagger/definitions/ISO18626/types/serviceType.yaml b/api/v1/swagger/definitions/ISO18626/types/serviceType.yaml new file mode 100644 index 0000000000..cbaf5219a5 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/serviceType.yaml @@ -0,0 +1,6 @@ +--- +type: string +enum: + - Copy + - Loan + - CopyOrLoan diff --git a/api/v1/swagger/definitions/ISO18626/types/status.yaml b/api/v1/swagger/definitions/ISO18626/types/status.yaml new file mode 100644 index 0000000000..a87222a05a --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/status.yaml @@ -0,0 +1,18 @@ +--- +type: string +enum: + - RequestReceived + - ExpectToSupply + - WillSupply + - Loaned + - Overdue + - Recalled + - RetryPossible + - Unfilled + - HoldReturn + - ReleaseHoldReturn + - CopyCompleted + - LoanCompleted + - CompletedWithoutReturn + - Cancelled +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/supplyingAgencyMessageHeader.yaml b/api/v1/swagger/definitions/ISO18626/types/supplyingAgencyMessageHeader.yaml new file mode 100644 index 0000000000..1dccffa716 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/supplyingAgencyMessageHeader.yaml @@ -0,0 +1,26 @@ +--- +type: object +properties: + supplyingAgencyId: + $ref: '../types/agencyId.yaml' + description: Identification of supplying library. Shall be provided except for RequestSub-Type = PatronRequest and TransferRequest + requestingAgencyId: + $ref: '../types/agencyId.yaml' + timestamp: + type: string + format: date-time + description: Date and time of the transaction + requestingAgencyRequestId: + type: string + description: Requesting librarys request identification or number + supplyingAgencyRequestId: + type: + - string + - "null" + description: Requesting librarys request identification or number +required: +- supplyingAgencyId +- requestingAgencyId +- timestamp +- requestingAgencyRequestId +additionalProperties: false diff --git a/api/v1/swagger/definitions/ISO18626/types/yesNo.yaml b/api/v1/swagger/definitions/ISO18626/types/yesNo.yaml new file mode 100644 index 0000000000..1739e8b65d --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/types/yesNo.yaml @@ -0,0 +1,5 @@ +--- +type: string +enum: + - Y + - N diff --git a/api/v1/swagger/definitions/ISO18626/valuePairs/courierName.yaml b/api/v1/swagger/definitions/ISO18626/valuePairs/courierName.yaml new file mode 100644 index 0000000000..da084bbf0e --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/valuePairs/courierName.yaml @@ -0,0 +1,9 @@ +--- +type: string +enum: + - DB Schenker + - DHL + - Fedex + - PostNord AB + - UPS +description: An identified courier to be used if DeliveryMethod value = “Courier”. If the requesting library is willing and is able to accept any courier, then the requesting library shall not include this element in the message diff --git a/api/v1/swagger/definitions/ISO18626/valuePairs/deliveryMethod.yaml b/api/v1/swagger/definitions/ISO18626/valuePairs/deliveryMethod.yaml new file mode 100644 index 0000000000..ee4bc60d08 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/valuePairs/deliveryMethod.yaml @@ -0,0 +1,11 @@ +--- +type: string +enum: + - ArticleExchange + - Courier + - Email + - FTP + - Mail + - Odyssey + - URL +description: The service via which the requested item should be sent. If the requesting library is willing and is able to accept any delivery method, then the requesting library shall not include this element in the message diff --git a/api/v1/swagger/definitions/ISO18626/valuePairs/itemFormat.yaml b/api/v1/swagger/definitions/ISO18626/valuePairs/itemFormat.yaml new file mode 100644 index 0000000000..2b952583c8 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/valuePairs/itemFormat.yaml @@ -0,0 +1,25 @@ +--- +type: string +enum: + - CassetteTape + - CD + - CD-ROM + - Daisy-ROM + - DVD + - EPUB + - EPUB2 + - EPUB3 + - JPEG + - LargePrint + - LP + - Microform + - MP3 + - Multimedia + - PaperCopy + - PDF + - Printed + - Tape + - TIFF + - UltraHD + - VHS +description: If the requesting library is willing and is able to accept any format, then the requesting library shall not include this element in the message diff --git a/api/v1/swagger/definitions/ISO18626/valuePairs/loanCondition.yaml b/api/v1/swagger/definitions/ISO18626/valuePairs/loanCondition.yaml new file mode 100644 index 0000000000..7299c15f1d --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/valuePairs/loanCondition.yaml @@ -0,0 +1,9 @@ +--- +type: string +enum: + - LibraryUseOnly # Use in library only + - WatchLibraryUseOnly # Supervised use in library only + - NoReproduction # No reproduction + - SignatureRequired # Signature required + - SpecCollSupervReq # Special collections supervision required +description: Conditions for use of the item. Used when submitting a Request Retry, after the supplying library indicates there is a loan condition that shall be met diff --git a/api/v1/swagger/definitions/ISO18626/valuePairs/paymentMethod.yaml b/api/v1/swagger/definitions/ISO18626/valuePairs/paymentMethod.yaml new file mode 100644 index 0000000000..aaf5ae6204 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/valuePairs/paymentMethod.yaml @@ -0,0 +1,14 @@ +--- +type: string +enum: + - BankTransfer + - CreditCard + - DebitCard + - EFTS + - IBS + - IIBS + - IFLAVoucher + - IFM + - LAPS + - Paypal +description: If the requesting library is willing and is able to accept any format, then the requesting library shall not include this element in the message diff --git a/api/v1/swagger/definitions/ISO18626/valuePairs/serviceLevel.yaml b/api/v1/swagger/definitions/ISO18626/valuePairs/serviceLevel.yaml new file mode 100644 index 0000000000..292674cfe4 --- /dev/null +++ b/api/v1/swagger/definitions/ISO18626/valuePairs/serviceLevel.yaml @@ -0,0 +1,10 @@ +--- +type: string +enum: + - Express + - Normal + - Rush + - SecondaryMail + - Standard + - Urgent +description: If the requesting library is willing and is able to accept any service level, then the requesting library shall not include this element in the message diff --git a/api/v1/swagger/paths/ill_iso18626.yaml b/api/v1/swagger/paths/ill_iso18626.yaml new file mode 100644 index 0000000000..a237c95927 --- /dev/null +++ b/api/v1/swagger/paths/ill_iso18626.yaml @@ -0,0 +1,53 @@ +--- +/public/ill/iso18626: + post: + x-mojo-to: ILL::ISO18626#message + operationId: ISO18626message + tags: + - iso18626 + summary: ISO18626 message + parameters: + - name: message + in: body + description: The XML object containing information about the new request + required: true + schema: + type: object + # $ref: "../swagger.yaml#/definitions/ISO18626request" + # $ref: "../swagger.yaml#/definitions/ISO18626requestingAgencyMessage" + produces: + - application/xml + consumes: + - application/xml + responses: + "201": + description: An ISO18626 confirmation message + # schema: + # $ref: "../swagger.yaml#/definitions/ISO18626requestConfirmation" + # $ref: "../swagger.yaml#/definitions/ISO18626requestingAgencyMessageConfirmation" + "400": + description: | + Bad request. Possible `error_code` attribute values: + + * `invalid_query` + schema: + $ref: "../swagger.yaml#/definitions/error" + "403": + description: Access forbidden + schema: + $ref: "../swagger.yaml#/definitions/error" + "404": + description: Patron not found + schema: + $ref: "../swagger.yaml#/definitions/error" + "500": + description: | + Internal server error. Possible `error_code` attribute values: + + * `internal_server_error` + schema: + $ref: "../swagger.yaml#/definitions/error" + "503": + description: Under maintenance + schema: + $ref: "../swagger.yaml#/definitions/error" diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index 0341d40dac..0001e0744a 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -120,6 +120,18 @@ definitions: $ref: ./definitions/ill_batchstatus.yaml ill_batchstatuses: $ref: ./definitions/ill_batchstatuses.yaml + ISO18626request: + $ref: ./definitions/ISO18626/request.yaml + ISO18626requestingAgencyMessage: + $ref: ./definitions/ISO18626/requestingAgencyMessage.yaml + ISO18626supplyingAgencyMessage: + $ref: ./definitions/ISO18626/supplyingAgencyMessage.yaml + ISO18626requestConfirmation: + $ref: ./definitions/ISO18626/requestConfirmation.yaml + ISO18626requestingAgencyMessageConfirmation: + $ref: ./definitions/ISO18626/requestingAgencyMessageConfirmation.yaml + ISO18626supplyingAgencyMessageConfirmation: + $ref: ./definitions/ISO18626/supplyingAgencyMessageConfirmation.yaml import_batch_profile: $ref: ./definitions/import_batch_profile.yaml import_batch_profiles: @@ -575,6 +587,8 @@ paths: $ref: "./paths/biblios.yaml#/~1public~1biblios~1{biblio_id}" "/public/checkouts/availability": $ref: ./paths/checkouts.yaml#/~1public~1checkouts~1availability + "/public/ill/iso18626": + $ref: ./paths/ill_iso18626.yaml#/~1public~1ill~1iso18626 "/public/items": $ref: "./paths/items.yaml#/~1public~1items" "/public/biblios/{biblio_id}/items": @@ -867,6 +881,12 @@ parameters: name: ill_batchstatus_code required: true type: string + iso18626_request_id_pp: + description: ISO18626 ILL request internal identifier + in: path + name: iso18626_request_id + required: true + type: integer import_batch_profile_id_pp: description: Internal profile identifier in: path