invenio-app-ils 1.0.0a54__py2.py3-none-any.whl → 6.1.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- invenio_app_ils/__init__.py +2 -2
- invenio_app_ils/acquisition/api.py +3 -1
- invenio_app_ils/acquisition/config.py +10 -21
- invenio_app_ils/acquisition/jsonresolvers/order_order_lines.py +1 -0
- invenio_app_ils/acquisition/mappings/os-v1/acq_orders/order-v1.0.0.json +364 -0
- invenio_app_ils/acquisition/mappings/os-v2/__init__.py +0 -0
- invenio_app_ils/acquisition/mappings/os-v2/acq_orders/order-v1.0.0.json +364 -0
- invenio_app_ils/acquisition/mappings/v7/acq_orders/order-v1.0.0.json +14 -0
- invenio_app_ils/acquisition/search.py +5 -15
- invenio_app_ils/assets/semantic-ui/less/theme.config +103 -0
- invenio_app_ils/assets/semantic-ui/templates/.gitkeep +0 -0
- invenio_app_ils/circulation/api.py +153 -67
- invenio_app_ils/circulation/config.py +29 -25
- invenio_app_ils/circulation/indexer.py +14 -19
- invenio_app_ils/circulation/loaders/__init__.py +2 -0
- invenio_app_ils/circulation/loaders/schemas/json/loan_checkout.py +2 -3
- invenio_app_ils/circulation/loaders/schemas/json/loan_request.py +82 -16
- invenio_app_ils/circulation/loaders/schemas/json/loan_self_checkout.py +19 -0
- invenio_app_ils/circulation/notifications/api.py +23 -19
- invenio_app_ils/circulation/notifications/messages.py +6 -6
- invenio_app_ils/circulation/notifications/tasks.py +1 -2
- invenio_app_ils/circulation/receivers.py +2 -5
- invenio_app_ils/circulation/search.py +23 -22
- invenio_app_ils/circulation/serializers/__init__.py +2 -2
- invenio_app_ils/circulation/serializers/csv.py +1 -3
- invenio_app_ils/circulation/serializers/custom_fields.py +5 -9
- invenio_app_ils/circulation/serializers/json.py +2 -6
- invenio_app_ils/circulation/serializers/response.py +12 -12
- invenio_app_ils/circulation/stats/views.py +5 -15
- invenio_app_ils/circulation/tasks.py +2 -6
- invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/self_checkout.html +19 -0
- invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/update_dates.html +19 -0
- invenio_app_ils/circulation/utils.py +23 -17
- invenio_app_ils/circulation/views.py +103 -39
- invenio_app_ils/cli.py +220 -260
- invenio_app_ils/closures/api.py +72 -7
- invenio_app_ils/closures/serializers/__init__.py +16 -0
- invenio_app_ils/closures/serializers/response.py +35 -0
- invenio_app_ils/closures/serializers/schema.py +28 -0
- invenio_app_ils/closures/tasks.py +4 -11
- invenio_app_ils/closures/views.py +66 -0
- invenio_app_ils/config.py +207 -150
- invenio_app_ils/document_requests/api.py +6 -21
- invenio_app_ils/document_requests/loaders/__init__.py +4 -12
- invenio_app_ils/document_requests/mappings/{v6 → os-v1}/__init__.py +2 -2
- invenio_app_ils/document_requests/mappings/os-v1/document_requests/document_request-v1.0.0.json +196 -0
- invenio_app_ils/document_requests/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/document_requests/mappings/os-v2/document_requests/document_request-v1.0.0.json +196 -0
- invenio_app_ils/document_requests/notifications/api.py +2 -7
- invenio_app_ils/document_requests/notifications/messages.py +3 -7
- invenio_app_ils/document_requests/search.py +2 -6
- invenio_app_ils/document_requests/views.py +4 -10
- invenio_app_ils/documents/api.py +19 -25
- invenio_app_ils/documents/indexer.py +13 -20
- invenio_app_ils/documents/jsonresolvers/document_circulation.py +11 -33
- invenio_app_ils/documents/jsonresolvers/document_eitem.py +1 -0
- invenio_app_ils/documents/jsonresolvers/document_item.py +8 -9
- invenio_app_ils/documents/jsonresolvers/document_stock.py +7 -7
- invenio_app_ils/documents/loaders/jsonschemas/document.py +3 -14
- invenio_app_ils/documents/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/documents/mappings/os-v1/documents/document-v1.0.0.json +932 -0
- invenio_app_ils/documents/mappings/os-v1/documents/document-v2.0.0.json +1066 -0
- invenio_app_ils/documents/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/documents/mappings/os-v2/documents/document-v1.0.0.json +932 -0
- invenio_app_ils/documents/mappings/os-v2/documents/document-v2.0.0.json +1066 -0
- invenio_app_ils/documents/mappings/v7/documents/document-v1.0.0.json +102 -11
- invenio_app_ils/documents/mappings/v7/documents/document-v2.0.0.json +1066 -0
- invenio_app_ils/documents/schemas/documents/document-v2.0.0.json +732 -0
- invenio_app_ils/eitems/api.py +41 -7
- invenio_app_ils/eitems/loaders/jsonschemas/eitems.py +6 -6
- invenio_app_ils/eitems/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v1.0.0.json +139 -0
- invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v2.0.0.json +142 -0
- invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v3.0.0.json +179 -0
- invenio_app_ils/{series/mappings/v6 → eitems/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v1.0.0.json +139 -0
- invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v2.0.0.json +142 -0
- invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v3.0.0.json +179 -0
- invenio_app_ils/eitems/mappings/v7/eitems/eitem-v1.0.0.json +12 -2
- invenio_app_ils/eitems/mappings/v7/eitems/eitem-v2.0.0.json +142 -0
- invenio_app_ils/eitems/mappings/v7/eitems/eitem-v3.0.0.json +179 -0
- invenio_app_ils/eitems/schemas/eitems/eitem-v2.0.0.json +120 -0
- invenio_app_ils/eitems/schemas/eitems/eitem-v3.0.0.json +120 -0
- invenio_app_ils/eitems/search.py +3 -9
- invenio_app_ils/errors.py +119 -6
- invenio_app_ils/ext.py +15 -18
- invenio_app_ils/facets.py +13 -15
- invenio_app_ils/files/receivers.py +1 -1
- invenio_app_ils/files/views.py +1 -2
- invenio_app_ils/ill/api.py +1 -2
- invenio_app_ils/ill/config.py +10 -16
- invenio_app_ils/ill/jsonresolvers/borrowing_request_document.py +2 -3
- invenio_app_ils/ill/jsonresolvers/borrowing_request_patron.py +1 -3
- invenio_app_ils/ill/jsonresolvers/borrowing_request_provider.py +1 -3
- invenio_app_ils/ill/loaders/__init__.py +3 -9
- invenio_app_ils/ill/loaders/jsonschemas/patron_loan_actions.py +1 -8
- invenio_app_ils/ill/loaders/jsonschemas/patron_loan_extension_actions.py +3 -8
- invenio_app_ils/ill/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/ill/mappings/os-v1/ill_borrowing_requests/borrowing_request-v1.0.0.json +254 -0
- invenio_app_ils/{acquisition/mappings/v6 → ill/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/ill/mappings/os-v2/ill_borrowing_requests/borrowing_request-v1.0.0.json +254 -0
- invenio_app_ils/ill/mappings/v7/ill_borrowing_requests/borrowing_request-v1.0.0.json +14 -0
- invenio_app_ils/ill/notifications/api.py +1 -4
- invenio_app_ils/ill/search.py +3 -9
- invenio_app_ils/ill/serializers/__init__.py +1 -3
- invenio_app_ils/ill/views.py +2 -4
- invenio_app_ils/internal_locations/api.py +1 -4
- invenio_app_ils/internal_locations/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/internal_locations/mappings/os-v1/internal_locations/internal_location-v1.0.0.json +108 -0
- invenio_app_ils/internal_locations/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/internal_locations/mappings/os-v2/internal_locations/internal_location-v1.0.0.json +108 -0
- invenio_app_ils/internal_locations/search.py +1 -3
- invenio_app_ils/items/api.py +18 -15
- invenio_app_ils/items/indexer.py +1 -3
- invenio_app_ils/items/jsonresolvers/item_document.py +1 -1
- invenio_app_ils/items/jsonresolvers/item_internal_location.py +2 -6
- invenio_app_ils/items/loaders/jsonschemas/items.py +2 -0
- {tests/api/circulation → invenio_app_ils/items/mappings/os-v1}/__init__.py +1 -1
- invenio_app_ils/items/mappings/os-v1/items/item-v1.0.0.json +285 -0
- invenio_app_ils/items/mappings/os-v1/items/item-v2.0.0.json +326 -0
- {tests/api/ill → invenio_app_ils/items/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/items/mappings/os-v2/items/item-v1.0.0.json +285 -0
- invenio_app_ils/items/mappings/os-v2/items/item-v2.0.0.json +326 -0
- invenio_app_ils/items/mappings/v7/items/item-v1.0.0.json +11 -0
- invenio_app_ils/items/mappings/v7/items/item-v2.0.0.json +326 -0
- invenio_app_ils/items/schemas/items/item-v1.0.0.json +22 -0
- invenio_app_ils/items/schemas/items/item-v2.0.0.json +172 -0
- invenio_app_ils/items/search.py +18 -11
- invenio_app_ils/items/serializers/item.py +7 -6
- invenio_app_ils/literature/api.py +1 -3
- invenio_app_ils/literature/search.py +3 -5
- invenio_app_ils/literature/serializers/csv.py +1 -3
- invenio_app_ils/literature/serializers/json.py +1 -3
- invenio_app_ils/locations/api.py +2 -4
- invenio_app_ils/locations/indexer.py +3 -9
- invenio_app_ils/locations/loaders/__init__.py +1 -3
- invenio_app_ils/locations/loaders/jsonschemas/location.py +4 -11
- invenio_app_ils/locations/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/locations/mappings/os-v1/locations/location-v1.0.0.json +90 -0
- invenio_app_ils/locations/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/locations/mappings/os-v2/locations/location-v1.0.0.json +90 -0
- invenio_app_ils/notifications/messages.py +4 -3
- invenio_app_ils/notifications/tasks.py +1 -3
- invenio_app_ils/notifications/views.py +2 -2
- invenio_app_ils/patrons/anonymization.py +53 -32
- invenio_app_ils/patrons/api.py +3 -5
- invenio_app_ils/patrons/cli.py +1 -2
- invenio_app_ils/patrons/indexer.py +4 -13
- invenio_app_ils/patrons/mappings/os-v1/__init__.py +8 -0
- invenio_app_ils/patrons/mappings/os-v1/patrons/patron-v1.0.0.json +42 -0
- invenio_app_ils/patrons/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/patrons/mappings/os-v2/patrons/patron-v1.0.0.json +42 -0
- invenio_app_ils/patrons/views.py +4 -14
- invenio_app_ils/permissions.py +93 -35
- invenio_app_ils/providers/api.py +2 -6
- invenio_app_ils/providers/config.py +11 -19
- invenio_app_ils/providers/indexer.py +2 -6
- invenio_app_ils/providers/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/providers/mappings/os-v1/providers/provider-v1.0.0.json +57 -0
- invenio_app_ils/providers/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/providers/mappings/os-v2/providers/provider-v1.0.0.json +57 -0
- invenio_app_ils/providers/mappings/v7/__init__.py +1 -1
- invenio_app_ils/providers/proxies.py +1 -3
- invenio_app_ils/records/api.py +3 -9
- invenio_app_ils/records/loaders/schemas/changed_by.py +1 -3
- invenio_app_ils/records/loaders/schemas/identifiers.py +23 -0
- invenio_app_ils/records/metadata_extensions.py +1 -4
- invenio_app_ils/records/permissions.py +8 -2
- invenio_app_ils/records/serializers/__init__.py +1 -4
- invenio_app_ils/records/views.py +4 -7
- invenio_app_ils/records_relations/api.py +11 -34
- invenio_app_ils/records_relations/indexer.py +1 -3
- invenio_app_ils/records_relations/retriever.py +14 -9
- invenio_app_ils/records_relations/views.py +16 -50
- invenio_app_ils/relations/api.py +17 -16
- invenio_app_ils/search_permissions.py +24 -24
- invenio_app_ils/series/api.py +10 -12
- invenio_app_ils/series/loaders/jsonschemas/series.py +3 -2
- invenio_app_ils/{items/mappings/v6 → series/mappings/os-v1}/__init__.py +1 -1
- invenio_app_ils/series/mappings/os-v1/series/series-v1.0.0.json +324 -0
- invenio_app_ils/series/mappings/os-v1/series/series-v2.0.0.json +396 -0
- {tests/api/acquisition → invenio_app_ils/series/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/series/mappings/os-v2/series/series-v1.0.0.json +324 -0
- invenio_app_ils/series/mappings/os-v2/series/series-v2.0.0.json +396 -0
- invenio_app_ils/series/mappings/v7/series/series-v1.0.0.json +35 -3
- invenio_app_ils/series/mappings/v7/series/series-v2.0.0.json +396 -0
- invenio_app_ils/series/schemas/series/series-v2.0.0.json +354 -0
- invenio_app_ils/stats/aggregations/aggr_file_download/os-v1/aggr-file-download-v1.json +60 -0
- invenio_app_ils/stats/aggregations/aggr_file_download/os-v2/__init__.py +9 -0
- invenio_app_ils/stats/aggregations/aggr_file_download/os-v2/aggr-file-download-v1.json +60 -0
- invenio_app_ils/stats/event_builders.py +73 -0
- invenio_app_ils/stats/file_download/os-v1/file-download-v1.json +72 -0
- invenio_app_ils/stats/file_download/os-v2/__init__.py +9 -0
- invenio_app_ils/stats/file_download/os-v2/file-download-v1.json +72 -0
- invenio_app_ils/stats/processors.py +30 -0
- invenio_app_ils/stats/templates/aggregations/__init__.py +8 -0
- invenio_app_ils/stats/templates/aggregations/ils_record_changes/__init__.py +8 -0
- invenio_app_ils/stats/templates/aggregations/ils_record_changes/os-v2/__init__.py +8 -0
- invenio_app_ils/stats/templates/aggregations/ils_record_changes/os-v2/aggr-ils-record-changes-v1.json +41 -0
- {tests → invenio_app_ils/stats/templates/events}/__init__.py +2 -2
- invenio_app_ils/stats/templates/events/ils_record_changes/__init__.py +8 -0
- invenio_app_ils/stats/templates/events/ils_record_changes/os-v2/__init__.py +8 -0
- invenio_app_ils/stats/templates/events/ils_record_changes/os-v2/ils-record-changes-v1.json +41 -0
- invenio_app_ils/templates/logged_out.html +12 -0
- invenio_app_ils/views.py +18 -4
- invenio_app_ils/vocabularies/api.py +1 -1
- invenio_app_ils/vocabularies/cli.py +6 -18
- invenio_app_ils/vocabularies/data/acq_order_line_payment_modes.json +5 -0
- invenio_app_ils/vocabularies/data/identifier_schemes.json +5 -0
- invenio_app_ils/vocabularies/indexer.py +1 -4
- invenio_app_ils/vocabularies/jsonresolvers/licenses.py +2 -11
- invenio_app_ils/vocabularies/mappings/os-v1/__init__.py +8 -0
- invenio_app_ils/vocabularies/mappings/os-v1/vocabularies/vocabulary-v1.0.0.json +23 -0
- invenio_app_ils/vocabularies/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/vocabularies/mappings/os-v2/vocabularies/vocabulary-v1.0.0.json +23 -0
- invenio_app_ils/vocabularies/sources/base.py +1 -3
- invenio_app_ils/webpack.py +27 -0
- invenio_app_ils-6.1.0.dist-info/METADATA +627 -0
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/RECORD +227 -249
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/WHEEL +1 -1
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/entry_points.txt +9 -5
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/top_level.txt +0 -1
- invenio_app_ils/acquisition/mappings/v6/acq_orders/order-v1.0.0.json +0 -352
- invenio_app_ils/document_requests/mappings/v6/document_requests/document_request-v1.0.0.json +0 -199
- invenio_app_ils/documents/mappings/v6/documents/document-v1.0.0.json +0 -843
- invenio_app_ils/eitems/mappings/v6/eitems/eitem-v1.0.0.json +0 -131
- invenio_app_ils/ill/mappings/v6/ill_borrowing_requests/borrowing_request-v1.0.0.json +0 -242
- invenio_app_ils/internal_locations/mappings/v6/internal_locations/internal_location-v1.0.0.json +0 -110
- invenio_app_ils/items/mappings/v6/items/item-v1.0.0.json +0 -276
- invenio_app_ils/locations/mappings/v6/locations/location-v1.0.0.json +0 -92
- invenio_app_ils/notifications/admin.py +0 -57
- invenio_app_ils/patrons/mappings/v6/__init__.py +0 -8
- invenio_app_ils/patrons/mappings/v6/patrons/patron-v1.0.0.json +0 -44
- invenio_app_ils/providers/mappings/v6/providers/provider-v1.0.0.json +0 -59
- invenio_app_ils/series/mappings/v6/series/series-v1.0.0.json +0 -298
- invenio_app_ils/stats/aggregations/aggr_file_download/v6/aggr-file-download-v1.json +0 -59
- invenio_app_ils/stats/file_download/v6/file-download-v1.json +0 -74
- invenio_app_ils/version.py +0 -14
- invenio_app_ils/vocabularies/mappings/v6/__init__.py +0 -8
- invenio_app_ils/vocabularies/mappings/v6/vocabularies/vocabulary-v1.0.0.json +0 -25
- invenio_app_ils-1.0.0a54.dist-info/METADATA +0 -95
- tests/api/__init__.py +0 -8
- tests/api/acquisition/test_acq_orders_crud.py +0 -102
- tests/api/acquisition/test_acq_orders_permissions.py +0 -104
- tests/api/acquisition/test_acq_providers_permissions.py +0 -83
- tests/api/circulation/test_expired_loans.py +0 -88
- tests/api/circulation/test_loan_checkout.py +0 -216
- tests/api/circulation/test_loan_default_durations.py +0 -57
- tests/api/circulation/test_loan_document_resolver.py +0 -18
- tests/api/circulation/test_loan_extend.py +0 -132
- tests/api/circulation/test_loan_item_permissions.py +0 -139
- tests/api/circulation/test_loan_item_resolver.py +0 -26
- tests/api/circulation/test_loan_list_permissions.py +0 -104
- tests/api/circulation/test_loan_patron_resolver.py +0 -38
- tests/api/circulation/test_loan_request.py +0 -234
- tests/api/circulation/test_loan_update.py +0 -150
- tests/api/circulation/test_notifications.py +0 -229
- tests/api/conftest.py +0 -236
- tests/api/document_requests/__init__.py +0 -8
- tests/api/document_requests/test_document_requests.py +0 -131
- tests/api/document_requests/test_document_requests_permissions.py +0 -177
- tests/api/document_requests/test_notifications_filter.py +0 -36
- tests/api/ill/test_ill_brw_crud.py +0 -84
- tests/api/ill/test_ill_brw_reqs_patron_loan_create_action.py +0 -207
- tests/api/ill/test_ill_brw_reqs_patron_loan_extension_actions.py +0 -298
- tests/api/ill/test_ill_brw_reqs_permissions.py +0 -169
- tests/api/ill/test_ill_providers_permissions.py +0 -82
- tests/api/ils/__init__.py +0 -8
- tests/api/ils/documents/__init__.py +0 -8
- tests/api/ils/documents/test_document_crud.py +0 -57
- tests/api/ils/documents/test_document_permissions.py +0 -106
- tests/api/ils/documents/test_document_resolvers.py +0 -35
- tests/api/ils/eitems/__init__.py +0 -8
- tests/api/ils/eitems/test_eitems_crud.py +0 -41
- tests/api/ils/eitems/test_eitems_permissions.py +0 -84
- tests/api/ils/eitems/test_files.py +0 -172
- tests/api/ils/items/__init__.py +0 -8
- tests/api/ils/items/test_apis.py +0 -43
- tests/api/ils/items/test_items_crud.py +0 -60
- tests/api/ils/items/test_items_permissions.py +0 -107
- tests/api/ils/items/test_items_update.py +0 -47
- tests/api/ils/records_relations/__init__.py +0 -8
- tests/api/ils/records_relations/helpers.py +0 -115
- tests/api/ils/records_relations/test_records_relations_parentchild.py +0 -560
- tests/api/ils/records_relations/test_records_relations_sequence.py +0 -302
- tests/api/ils/records_relations/test_records_relations_siblings.py +0 -678
- tests/api/ils/series/__init__.py +0 -8
- tests/api/ils/series/test_series_permissions.py +0 -95
- tests/api/ils/test_anonymization.py +0 -189
- tests/api/ils/test_apis.py +0 -76
- tests/api/ils/test_closures.py +0 -324
- tests/api/ils/test_errors.py +0 -126
- tests/api/ils/test_facets.py +0 -84
- tests/api/ils/test_internal_locations.py +0 -96
- tests/api/ils/test_loaders.py +0 -55
- tests/api/ils/test_metadata_extensions.py +0 -205
- tests/api/ils/test_notifications.py +0 -183
- tests/api/ils/test_notifications_mails.py +0 -39
- tests/api/ils/test_notifications_permissions.py +0 -55
- tests/api/ils/test_patrons.py +0 -106
- tests/api/ils/test_record_delete.py +0 -46
- tests/api/ils/test_record_permissions.py +0 -135
- tests/api/ils/test_resolvers.py +0 -207
- tests/api/ils/test_stats.py +0 -160
- tests/api/ils/test_tasks.py +0 -211
- tests/api/ils/test_vocabularies.py +0 -35
- tests/conftest.py +0 -123
- tests/data/acq_orders.json +0 -89
- tests/data/acq_providers.json +0 -12
- tests/data/document_requests.json +0 -77
- tests/data/documents.json +0 -237
- tests/data/eitems.json +0 -66
- tests/data/ill_borrowing_requests.json +0 -77
- tests/data/ill_providers.json +0 -12
- tests/data/internal_locations.json +0 -22
- tests/data/items.json +0 -271
- tests/data/loans.json +0 -133
- tests/data/loans_most_loaned.json +0 -128
- tests/data/locations.json +0 -20
- tests/data/series.json +0 -33
- tests/helpers.py +0 -104
- tests/templates/notifications/title_body.html +0 -8
- tests/templates/notifications/title_body_html.html +0 -13
- tests/templates/notifications/title_body_html_ctx.html +0 -13
- tests/templates/notifications/title_only.html +0 -3
- tests/test_version.py +0 -17
- /tests/templates/notifications/blank.html → /invenio_app_ils/acquisition/mappings/os-v1/__init__.py +0 -0
- /invenio_app_ils/stats/aggregations/aggr_file_download/{v6 → os-v1}/__init__.py +0 -0
- /invenio_app_ils/stats/file_download/{v6 → os-v1}/__init__.py +0 -0
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info/licenses}/AUTHORS.rst +0 -0
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings": {
|
|
3
|
+
"analysis": {
|
|
4
|
+
"normalizer": {
|
|
5
|
+
"custom_normalizer": {
|
|
6
|
+
"type": "custom",
|
|
7
|
+
"char_filter": ["strip_special_chars"],
|
|
8
|
+
"filter": ["lowercase", "asciifolding"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"analyzer": {
|
|
12
|
+
"custom_analyzer": {
|
|
13
|
+
"tokenizer": "standard",
|
|
14
|
+
"type": "custom",
|
|
15
|
+
"char_filter": ["strip_special_chars"],
|
|
16
|
+
"filter": ["lowercase", "asciifolding"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"filter": {
|
|
20
|
+
"asciifolding": {
|
|
21
|
+
"type": "asciifolding"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"char_filter": {
|
|
25
|
+
"strip_special_chars": {
|
|
26
|
+
"type": "pattern_replace",
|
|
27
|
+
"pattern": "[\\p{Punct}\\p{S}]",
|
|
28
|
+
"replacement": ""
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"mappings": {
|
|
34
|
+
"date_detection": false,
|
|
35
|
+
"numeric_detection": false,
|
|
36
|
+
"properties": {
|
|
37
|
+
"$schema": {
|
|
38
|
+
"type": "keyword"
|
|
39
|
+
},
|
|
40
|
+
"_created": {
|
|
41
|
+
"type": "date"
|
|
42
|
+
},
|
|
43
|
+
"_updated": {
|
|
44
|
+
"type": "date"
|
|
45
|
+
},
|
|
46
|
+
"bucket_id": {
|
|
47
|
+
"type": "keyword"
|
|
48
|
+
},
|
|
49
|
+
"created_by": {
|
|
50
|
+
"properties": {
|
|
51
|
+
"type": {
|
|
52
|
+
"type": "keyword"
|
|
53
|
+
},
|
|
54
|
+
"value": {
|
|
55
|
+
"type": "keyword"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"type": "object"
|
|
59
|
+
},
|
|
60
|
+
"description": {
|
|
61
|
+
"type": "text"
|
|
62
|
+
},
|
|
63
|
+
"document": {
|
|
64
|
+
"properties": {
|
|
65
|
+
"authors": {
|
|
66
|
+
"type": "text"
|
|
67
|
+
},
|
|
68
|
+
"cover_metadata": {
|
|
69
|
+
"properties": {},
|
|
70
|
+
"type": "object"
|
|
71
|
+
},
|
|
72
|
+
"edition": {
|
|
73
|
+
"type": "text"
|
|
74
|
+
},
|
|
75
|
+
"pid": {
|
|
76
|
+
"type": "keyword"
|
|
77
|
+
},
|
|
78
|
+
"publication_year": {
|
|
79
|
+
"type": "keyword"
|
|
80
|
+
},
|
|
81
|
+
"title": {
|
|
82
|
+
"type": "text",
|
|
83
|
+
"fields": {
|
|
84
|
+
"keyword": {
|
|
85
|
+
"type": "keyword"
|
|
86
|
+
},
|
|
87
|
+
"normalized_keyword": {
|
|
88
|
+
"type": "keyword",
|
|
89
|
+
"normalizer": "custom_normalizer"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"analyzer": "custom_analyzer",
|
|
93
|
+
"search_analyzer": "custom_analyzer"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"type": "object"
|
|
97
|
+
},
|
|
98
|
+
"document_pid": {
|
|
99
|
+
"type": "keyword"
|
|
100
|
+
},
|
|
101
|
+
"eitem_type": {
|
|
102
|
+
"type": "keyword"
|
|
103
|
+
},
|
|
104
|
+
"files": {
|
|
105
|
+
"properties": {
|
|
106
|
+
"bucket": {
|
|
107
|
+
"type": "keyword"
|
|
108
|
+
},
|
|
109
|
+
"checksum": {
|
|
110
|
+
"type": "keyword"
|
|
111
|
+
},
|
|
112
|
+
"file_id": {
|
|
113
|
+
"type": "keyword"
|
|
114
|
+
},
|
|
115
|
+
"key": {
|
|
116
|
+
"type": "keyword"
|
|
117
|
+
},
|
|
118
|
+
"size": {
|
|
119
|
+
"type": "keyword"
|
|
120
|
+
},
|
|
121
|
+
"version_id": {
|
|
122
|
+
"type": "keyword"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"type": "object"
|
|
126
|
+
},
|
|
127
|
+
"identifiers": {
|
|
128
|
+
"properties": {
|
|
129
|
+
"material": {
|
|
130
|
+
"type": "keyword"
|
|
131
|
+
},
|
|
132
|
+
"scheme": {
|
|
133
|
+
"type": "keyword"
|
|
134
|
+
},
|
|
135
|
+
"value": {
|
|
136
|
+
"type": "keyword",
|
|
137
|
+
"fields": {
|
|
138
|
+
"text": {
|
|
139
|
+
"type": "text"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"type": "object"
|
|
145
|
+
},
|
|
146
|
+
"internal_notes": {
|
|
147
|
+
"type": "text"
|
|
148
|
+
},
|
|
149
|
+
"open_access": {
|
|
150
|
+
"type": "boolean"
|
|
151
|
+
},
|
|
152
|
+
"pid": {
|
|
153
|
+
"type": "keyword"
|
|
154
|
+
},
|
|
155
|
+
"source": {
|
|
156
|
+
"type": "keyword",
|
|
157
|
+
"fields": {
|
|
158
|
+
"text": {
|
|
159
|
+
"type": "text"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"urls": {
|
|
164
|
+
"properties": {
|
|
165
|
+
"description": {
|
|
166
|
+
"type": "text"
|
|
167
|
+
},
|
|
168
|
+
"value": {
|
|
169
|
+
"type": "keyword"
|
|
170
|
+
},
|
|
171
|
+
"login_required": {
|
|
172
|
+
"type": "boolean"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"type": "object"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
3
|
+
"title": "Schema EItem",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["$schema", "pid", "document_pid", "created_by", "eitem_type"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
"bucket_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"title": "The bucket identifier for this EItem"
|
|
13
|
+
},
|
|
14
|
+
"created_by": {
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"type": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"value": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "object"
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"title": "Any extra description for this EItem"
|
|
29
|
+
},
|
|
30
|
+
"document_pid": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"title": "The persistent identifier of its Document"
|
|
33
|
+
},
|
|
34
|
+
"eitem_type": {
|
|
35
|
+
"title": "EItem type",
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"document": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"$ref": {
|
|
42
|
+
"type": "string"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"$ref": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"identifiers": {
|
|
55
|
+
"items": {
|
|
56
|
+
"properties": {
|
|
57
|
+
"material": {
|
|
58
|
+
"title": "Material to which the identifiers refers to.",
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"scheme": {
|
|
62
|
+
"title": "Scheme of the identifier (Vocabulary)",
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"value": {
|
|
66
|
+
"title": "Value of the identifier",
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["value", "scheme"]
|
|
71
|
+
},
|
|
72
|
+
"title": "List of Identifiers of the record",
|
|
73
|
+
"type": "array"
|
|
74
|
+
},
|
|
75
|
+
"internal_notes": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"title": "Any extra description for this EItem reserved for internal usage"
|
|
78
|
+
},
|
|
79
|
+
"open_access": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"title": "Indicate if the access to this EItem is open or not",
|
|
82
|
+
"default": true
|
|
83
|
+
},
|
|
84
|
+
"pid": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"title": "The persistent identifier of this EItem"
|
|
87
|
+
},
|
|
88
|
+
"source": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"title": "Source of the record."
|
|
91
|
+
},
|
|
92
|
+
"urls": {
|
|
93
|
+
"items": {
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"properties": {
|
|
96
|
+
"description": {
|
|
97
|
+
"minLength": 1,
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"value": {
|
|
101
|
+
"format": "uri",
|
|
102
|
+
"minLength": 1,
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"login_required": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"title": "Indicate if the access to this link requires login",
|
|
108
|
+
"default": false
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": ["value"],
|
|
112
|
+
"title": "URL of external resource",
|
|
113
|
+
"type": "object"
|
|
114
|
+
},
|
|
115
|
+
"minItems": 1,
|
|
116
|
+
"type": "array",
|
|
117
|
+
"uniqueItems": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
3
|
+
"title": "Schema EItem",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["$schema", "pid", "document_pid", "created_by", "eitem_type"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
"bucket_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"title": "The bucket identifier for this EItem"
|
|
13
|
+
},
|
|
14
|
+
"created_by": {
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"type": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"value": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "object"
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"title": "Any extra description for this EItem"
|
|
29
|
+
},
|
|
30
|
+
"document_pid": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"title": "The persistent identifier of its Document"
|
|
33
|
+
},
|
|
34
|
+
"eitem_type": {
|
|
35
|
+
"title": "EItem type",
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"document": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"$ref": {
|
|
42
|
+
"type": "string"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"$ref": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"identifiers": {
|
|
55
|
+
"items": {
|
|
56
|
+
"properties": {
|
|
57
|
+
"material": {
|
|
58
|
+
"title": "Material to which the identifiers refers to.",
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"scheme": {
|
|
62
|
+
"title": "Scheme of the identifier (Vocabulary)",
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"value": {
|
|
66
|
+
"title": "Value of the identifier",
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["value", "scheme"]
|
|
71
|
+
},
|
|
72
|
+
"title": "List of Identifiers of the record",
|
|
73
|
+
"type": "array"
|
|
74
|
+
},
|
|
75
|
+
"internal_notes": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"title": "Any extra description for this EItem reserved for internal usage"
|
|
78
|
+
},
|
|
79
|
+
"open_access": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"title": "Indicate if the access to this EItem is open or not",
|
|
82
|
+
"default": true
|
|
83
|
+
},
|
|
84
|
+
"pid": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"title": "The persistent identifier of this EItem"
|
|
87
|
+
},
|
|
88
|
+
"source": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"title": "Source of the record."
|
|
91
|
+
},
|
|
92
|
+
"urls": {
|
|
93
|
+
"items": {
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"properties": {
|
|
96
|
+
"description": {
|
|
97
|
+
"minLength": 1,
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"value": {
|
|
101
|
+
"format": "uri",
|
|
102
|
+
"minLength": 1,
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"login_required": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"title": "Indicate if the access to this link requires login",
|
|
108
|
+
"default": false
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": ["value"],
|
|
112
|
+
"title": "URL of external resource",
|
|
113
|
+
"type": "object"
|
|
114
|
+
},
|
|
115
|
+
"minItems": 1,
|
|
116
|
+
"type": "array",
|
|
117
|
+
"uniqueItems": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
invenio_app_ils/eitems/search.py
CHANGED
|
@@ -31,9 +31,7 @@ class EItemSearch(RecordsSearch):
|
|
|
31
31
|
if document_pid:
|
|
32
32
|
search = search.filter("term", document_pid=document_pid)
|
|
33
33
|
else:
|
|
34
|
-
raise MissingRequiredParameterError(
|
|
35
|
-
description="document_pid is required"
|
|
36
|
-
)
|
|
34
|
+
raise MissingRequiredParameterError(description="document_pid is required")
|
|
37
35
|
|
|
38
36
|
if filter_states:
|
|
39
37
|
search = search.filter("terms", status=filter_states)
|
|
@@ -49,16 +47,12 @@ class EItemSearch(RecordsSearch):
|
|
|
49
47
|
if bucket_id:
|
|
50
48
|
search = search.filter("term", bucket_id=bucket_id)
|
|
51
49
|
else:
|
|
52
|
-
raise MissingRequiredParameterError(
|
|
53
|
-
description="bucket_id is required"
|
|
54
|
-
)
|
|
50
|
+
raise MissingRequiredParameterError(description="bucket_id is required")
|
|
55
51
|
|
|
56
52
|
results = search.execute()
|
|
57
53
|
if len(results) != 1:
|
|
58
54
|
# There should always be one bucket associated with an eitem when
|
|
59
55
|
# downloading a file.
|
|
60
|
-
msg = "found 0 or multiple records with bucket {0}".format(
|
|
61
|
-
bucket_id
|
|
62
|
-
)
|
|
56
|
+
msg = "found 0 or multiple records with bucket {0}".format(bucket_id)
|
|
63
57
|
current_app.logger.warning(msg)
|
|
64
58
|
return results
|
invenio_app_ils/errors.py
CHANGED
|
@@ -27,7 +27,7 @@ class IlsException(RESTException):
|
|
|
27
27
|
"""The status name."""
|
|
28
28
|
return type(self).__name__
|
|
29
29
|
|
|
30
|
-
def get_body(self, environ=None):
|
|
30
|
+
def get_body(self, environ=None, scope=None):
|
|
31
31
|
"""Get the request body."""
|
|
32
32
|
body = dict(
|
|
33
33
|
status=self.code,
|
|
@@ -95,14 +95,20 @@ class RecordHasReferencesError(IlsException):
|
|
|
95
95
|
ref_type=ref_type,
|
|
96
96
|
ref_ids=ref_ids,
|
|
97
97
|
)
|
|
98
|
+
self.record_id = record_id
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class ItemCannotCirculateError(IlsException):
|
|
102
|
+
"""The item cannot circulate."""
|
|
103
|
+
|
|
104
|
+
description = "This item cannot circulate."
|
|
98
105
|
|
|
99
106
|
|
|
100
107
|
class ItemHasActiveLoanError(IlsException):
|
|
101
108
|
"""The item which we are trying to update has an active loan."""
|
|
102
109
|
|
|
103
110
|
description = (
|
|
104
|
-
"Could not update item because it has an active loan with "
|
|
105
|
-
"pid: {loan_pid}."
|
|
111
|
+
"Could not update item because it has an active loan with pid: {loan_pid}."
|
|
106
112
|
)
|
|
107
113
|
|
|
108
114
|
def __init__(self, loan_pid, **kwargs):
|
|
@@ -126,6 +132,7 @@ class PatronNotFoundError(IlsException):
|
|
|
126
132
|
class PatronHasLoanOnItemError(IlsException):
|
|
127
133
|
"""A patron already has an active loan or a loan request on an item."""
|
|
128
134
|
|
|
135
|
+
code = 400
|
|
129
136
|
description = "Patron '{0}' has already an active loan on item '{1}:{2}'"
|
|
130
137
|
|
|
131
138
|
def __init__(self, patron_pid, item_pid, **kwargs):
|
|
@@ -135,6 +142,8 @@ class PatronHasLoanOnItemError(IlsException):
|
|
|
135
142
|
:param prop: Missing property from loan request.
|
|
136
143
|
"""
|
|
137
144
|
super().__init__(**kwargs)
|
|
145
|
+
self.patron_pid = patron_pid
|
|
146
|
+
self.item_pid = item_pid
|
|
138
147
|
self.description = self.description.format(
|
|
139
148
|
patron_pid, item_pid["type"], item_pid["value"]
|
|
140
149
|
)
|
|
@@ -143,6 +152,7 @@ class PatronHasLoanOnItemError(IlsException):
|
|
|
143
152
|
class PatronHasRequestOnDocumentError(IlsException):
|
|
144
153
|
"""A patron already has a loan request on a document."""
|
|
145
154
|
|
|
155
|
+
code = 400
|
|
146
156
|
description = (
|
|
147
157
|
"Patron '{patron_pid}' has already a loan "
|
|
148
158
|
"request on document '{document_pid}'"
|
|
@@ -163,6 +173,7 @@ class PatronHasRequestOnDocumentError(IlsException):
|
|
|
163
173
|
class PatronHasLoanOnDocumentError(IlsException):
|
|
164
174
|
"""A patron already has an active loan on a document."""
|
|
165
175
|
|
|
176
|
+
code = 400
|
|
166
177
|
description = (
|
|
167
178
|
"Patron '{patron_pid}' has already an active loan "
|
|
168
179
|
"on document '{document_pid}'"
|
|
@@ -180,9 +191,68 @@ class PatronHasLoanOnDocumentError(IlsException):
|
|
|
180
191
|
)
|
|
181
192
|
|
|
182
193
|
|
|
194
|
+
class LoanCheckoutByPatronForbidden(IlsException):
|
|
195
|
+
"""A patron cannot checkout an item for another patron."""
|
|
196
|
+
|
|
197
|
+
code = 403
|
|
198
|
+
description = "Forbidden. Patron '{current_user_pid}' cannot checkout item for another Patron '{patron_pid}'."
|
|
199
|
+
|
|
200
|
+
def __init__(self, patron_pid, current_user_pid, **kwargs):
|
|
201
|
+
"""Initialize LoanCheckoutByPatronForbidden exception."""
|
|
202
|
+
super().__init__(**kwargs)
|
|
203
|
+
self.description = self.description.format(
|
|
204
|
+
patron_pid=patron_pid, current_user_pid=current_user_pid
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class LoanSelfCheckoutItemUnavailable(IlsException):
|
|
209
|
+
"""A patron cannot self-checkout an item."""
|
|
210
|
+
|
|
211
|
+
code = 400
|
|
212
|
+
description = "This literature is not available for self-checkout. Please contact the library for more information."
|
|
213
|
+
|
|
214
|
+
def get_body(self, environ=None, scope=None):
|
|
215
|
+
"""Get the request body."""
|
|
216
|
+
body = dict(
|
|
217
|
+
status=self.code,
|
|
218
|
+
message=self.get_description(environ),
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
if self.supportCode:
|
|
222
|
+
body["supportCode"] = self.supportCode
|
|
223
|
+
|
|
224
|
+
return json.dumps(body)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class LoanSelfCheckoutItemInvalidStatus(LoanSelfCheckoutItemUnavailable):
|
|
228
|
+
"""A patron cannot self-checkout an item that cannot circulate."""
|
|
229
|
+
|
|
230
|
+
supportCode = "SELF-CHECKOUT-001"
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class LoanSelfCheckoutDocumentOverbooked(LoanSelfCheckoutItemUnavailable):
|
|
234
|
+
"""A patron cannot self-checkout an item for an overbooked document."""
|
|
235
|
+
|
|
236
|
+
supportCode = "SELF-CHECKOUT-002"
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class LoanSelfCheckoutItemActiveLoan(LoanSelfCheckoutItemUnavailable):
|
|
240
|
+
"""A patron cannot self-checkout an item that cannot circulate."""
|
|
241
|
+
|
|
242
|
+
supportCode = "SELF-CHECKOUT-003"
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
class LoanSelfCheckoutItemNotFound(LoanSelfCheckoutItemUnavailable):
|
|
246
|
+
"""A patron cannot self-checkout an item because item with provided barcode doesn't exist."""
|
|
247
|
+
|
|
248
|
+
supportCode = "SELF-CHECKOUT-004"
|
|
249
|
+
description = "Literature not found. Please try again with another barcode or contact the library."
|
|
250
|
+
|
|
251
|
+
|
|
183
252
|
class NotImplementedConfigurationError(IlsException):
|
|
184
253
|
"""Exception raised when function is not implemented."""
|
|
185
254
|
|
|
255
|
+
code = 500
|
|
186
256
|
description = (
|
|
187
257
|
"Function is not implemented. Implement this function in your module "
|
|
188
258
|
"and pass it to the config variable"
|
|
@@ -197,15 +267,20 @@ class NotImplementedConfigurationError(IlsException):
|
|
|
197
267
|
class MissingRequiredParameterError(IlsException):
|
|
198
268
|
"""Exception raised when required parameter is missing."""
|
|
199
269
|
|
|
270
|
+
code = 400
|
|
271
|
+
|
|
200
272
|
|
|
201
273
|
class InvalidParameterError(IlsException):
|
|
202
274
|
"""Exception raised when an invalid parameter is has been given."""
|
|
203
275
|
|
|
276
|
+
code = 400
|
|
277
|
+
|
|
204
278
|
|
|
205
279
|
class DocumentNotFoundError(IlsException):
|
|
206
280
|
"""Raised when a document could not be found."""
|
|
207
281
|
|
|
208
|
-
|
|
282
|
+
code = 404
|
|
283
|
+
description = "Document PID '{}' was not found."
|
|
209
284
|
|
|
210
285
|
def __init__(self, document_pid, **kwargs):
|
|
211
286
|
"""Initialize exception."""
|
|
@@ -213,10 +288,38 @@ class DocumentNotFoundError(IlsException):
|
|
|
213
288
|
self.description = self.description.format(document_pid)
|
|
214
289
|
|
|
215
290
|
|
|
291
|
+
class ItemNotFoundError(IlsException):
|
|
292
|
+
"""Raised when an item could not be found."""
|
|
293
|
+
|
|
294
|
+
code = 404
|
|
295
|
+
description = "Item not found."
|
|
296
|
+
|
|
297
|
+
def __init__(self, pid=None, barcode=None, **kwargs):
|
|
298
|
+
"""Initialize exception."""
|
|
299
|
+
super().__init__(**kwargs)
|
|
300
|
+
if pid:
|
|
301
|
+
self.description += " PID: {}".format(pid)
|
|
302
|
+
if barcode:
|
|
303
|
+
self.description += " Barcode: {}".format(barcode)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class MultipleItemsBarcodeFoundError(IlsException):
|
|
307
|
+
"""Raised when multiple items with the same barcode has been found."""
|
|
308
|
+
|
|
309
|
+
code = 500
|
|
310
|
+
description = "Multiple items with barcode {} found."
|
|
311
|
+
|
|
312
|
+
def __init__(self, barcode, **kwargs):
|
|
313
|
+
"""Initialize exception."""
|
|
314
|
+
super().__init__(**kwargs)
|
|
315
|
+
self.description = self.description.format(barcode)
|
|
316
|
+
|
|
317
|
+
|
|
216
318
|
class LocationNotFoundError(IlsException):
|
|
217
319
|
"""Raised when a location could not be found."""
|
|
218
320
|
|
|
219
|
-
|
|
321
|
+
code = 404
|
|
322
|
+
description = "Location PID '{}' was not found."
|
|
220
323
|
|
|
221
324
|
def __init__(self, location_pid, **kwargs):
|
|
222
325
|
"""Initialize exception."""
|
|
@@ -227,7 +330,8 @@ class LocationNotFoundError(IlsException):
|
|
|
227
330
|
class InternalLocationNotFoundError(IlsException):
|
|
228
331
|
"""Raised when an internal location could not be found."""
|
|
229
332
|
|
|
230
|
-
|
|
333
|
+
code = 404
|
|
334
|
+
description = "Internal Location PID '{}' was not found."
|
|
231
335
|
|
|
232
336
|
def __init__(self, internal_location_pid, **kwargs):
|
|
233
337
|
"""Initialize exception."""
|
|
@@ -238,6 +342,7 @@ class InternalLocationNotFoundError(IlsException):
|
|
|
238
342
|
class UnknownItemPidTypeError(IlsException):
|
|
239
343
|
"""Raised when the given item PID type is unknown."""
|
|
240
344
|
|
|
345
|
+
code = 400
|
|
241
346
|
description = "Unknown Item PID type '{}'"
|
|
242
347
|
|
|
243
348
|
def __init__(self, pid_type, **kwargs):
|
|
@@ -279,6 +384,14 @@ class DocumentRequestError(IlsException):
|
|
|
279
384
|
super().__init__(description=description)
|
|
280
385
|
|
|
281
386
|
|
|
387
|
+
class DocumentOverbookedError(IlsException):
|
|
388
|
+
"""Raised when a document is overbooked."""
|
|
389
|
+
|
|
390
|
+
def __init__(self, description):
|
|
391
|
+
"""Initialize exception."""
|
|
392
|
+
super().__init__(description=description)
|
|
393
|
+
|
|
394
|
+
|
|
282
395
|
class VocabularyError(IlsException):
|
|
283
396
|
"""Generic vocabulary exception."""
|
|
284
397
|
|