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,326 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings": {
|
|
3
|
+
"analysis": {
|
|
4
|
+
"normalizer": {
|
|
5
|
+
"custom_normalizer": {
|
|
6
|
+
"type": "custom",
|
|
7
|
+
"char_filter": [
|
|
8
|
+
"strip_special_chars"
|
|
9
|
+
],
|
|
10
|
+
"filter": [
|
|
11
|
+
"lowercase",
|
|
12
|
+
"asciifolding"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"analyzer": {
|
|
17
|
+
"email": {
|
|
18
|
+
"type": "custom",
|
|
19
|
+
"tokenizer": "uax_url_email"
|
|
20
|
+
},
|
|
21
|
+
"custom_analyzer": {
|
|
22
|
+
"tokenizer": "standard",
|
|
23
|
+
"type": "custom",
|
|
24
|
+
"char_filter": [
|
|
25
|
+
"strip_special_chars"
|
|
26
|
+
],
|
|
27
|
+
"filter": [
|
|
28
|
+
"lowercase",
|
|
29
|
+
"asciifolding"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"filter": {
|
|
34
|
+
"asciifolding": {
|
|
35
|
+
"type": "asciifolding"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"char_filter": {
|
|
39
|
+
"strip_special_chars": {
|
|
40
|
+
"type": "pattern_replace",
|
|
41
|
+
"pattern": "[\\p{Punct}\\p{S}]",
|
|
42
|
+
"replacement": ""
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"mappings": {
|
|
48
|
+
"date_detection": false,
|
|
49
|
+
"numeric_detection": false,
|
|
50
|
+
"properties": {
|
|
51
|
+
"$schema": {
|
|
52
|
+
"type": "keyword"
|
|
53
|
+
},
|
|
54
|
+
"_created": {
|
|
55
|
+
"type": "date"
|
|
56
|
+
},
|
|
57
|
+
"_updated": {
|
|
58
|
+
"type": "date"
|
|
59
|
+
},
|
|
60
|
+
"acquisition_pid": { "type": "keyword" },
|
|
61
|
+
"barcode": {
|
|
62
|
+
"type": "keyword"
|
|
63
|
+
},
|
|
64
|
+
"circulation": {
|
|
65
|
+
"properties": {
|
|
66
|
+
"document_pid": {
|
|
67
|
+
"type": "keyword"
|
|
68
|
+
},
|
|
69
|
+
"end_date": {
|
|
70
|
+
"type": "date"
|
|
71
|
+
},
|
|
72
|
+
"extension_count": {
|
|
73
|
+
"type": "short"
|
|
74
|
+
},
|
|
75
|
+
"is_overdue": {
|
|
76
|
+
"type": "boolean"
|
|
77
|
+
},
|
|
78
|
+
"item_pid": {
|
|
79
|
+
"properties": {
|
|
80
|
+
"type": {
|
|
81
|
+
"type": "keyword"
|
|
82
|
+
},
|
|
83
|
+
"value": {
|
|
84
|
+
"type": "keyword"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"type": "object"
|
|
88
|
+
},
|
|
89
|
+
"loan_pid": {
|
|
90
|
+
"type": "keyword"
|
|
91
|
+
},
|
|
92
|
+
"patron": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"email": {
|
|
95
|
+
"type": "text",
|
|
96
|
+
"analyzer": "email"
|
|
97
|
+
},
|
|
98
|
+
"id": {
|
|
99
|
+
"type": "keyword"
|
|
100
|
+
},
|
|
101
|
+
"name": {
|
|
102
|
+
"type": "text",
|
|
103
|
+
"fields": {
|
|
104
|
+
"keyword": {
|
|
105
|
+
"type": "keyword"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"location_pid": {
|
|
110
|
+
"type": "keyword"
|
|
111
|
+
},
|
|
112
|
+
"pid": {
|
|
113
|
+
"type": "keyword"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"type": "object"
|
|
117
|
+
},
|
|
118
|
+
"patron_pid": {
|
|
119
|
+
"type": "keyword"
|
|
120
|
+
},
|
|
121
|
+
"start_date": {
|
|
122
|
+
"type": "date"
|
|
123
|
+
},
|
|
124
|
+
"state": {
|
|
125
|
+
"type": "keyword"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"type": "object"
|
|
129
|
+
},
|
|
130
|
+
"circulation_restriction": {
|
|
131
|
+
"type": "keyword"
|
|
132
|
+
},
|
|
133
|
+
"created_by": {
|
|
134
|
+
"properties": {
|
|
135
|
+
"type": {
|
|
136
|
+
"type": "keyword"
|
|
137
|
+
},
|
|
138
|
+
"value": {
|
|
139
|
+
"type": "keyword"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"type": "object"
|
|
143
|
+
},
|
|
144
|
+
"description": {
|
|
145
|
+
"type": "text"
|
|
146
|
+
},
|
|
147
|
+
"document": {
|
|
148
|
+
"properties": {
|
|
149
|
+
"authors": {
|
|
150
|
+
"type": "text"
|
|
151
|
+
},
|
|
152
|
+
"cover_metadata": {
|
|
153
|
+
"properties": {},
|
|
154
|
+
"type": "object"
|
|
155
|
+
},
|
|
156
|
+
"document_type": {
|
|
157
|
+
"type": "keyword"
|
|
158
|
+
},
|
|
159
|
+
"edition": {
|
|
160
|
+
"type": "text"
|
|
161
|
+
},
|
|
162
|
+
"pid": {
|
|
163
|
+
"type": "keyword"
|
|
164
|
+
},
|
|
165
|
+
"publication_year": {
|
|
166
|
+
"type": "keyword"
|
|
167
|
+
},
|
|
168
|
+
"title": {
|
|
169
|
+
"type": "text",
|
|
170
|
+
"fields": {
|
|
171
|
+
"keyword": {
|
|
172
|
+
"type": "keyword"
|
|
173
|
+
},
|
|
174
|
+
"normalized_keyword": {
|
|
175
|
+
"type": "keyword",
|
|
176
|
+
"normalizer": "custom_normalizer"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"analyzer": "custom_analyzer",
|
|
180
|
+
"search_analyzer": "custom_analyzer"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"type": "object"
|
|
184
|
+
},
|
|
185
|
+
"document_pid": {
|
|
186
|
+
"type": "keyword"
|
|
187
|
+
},
|
|
188
|
+
"internal_location": {
|
|
189
|
+
"properties": {
|
|
190
|
+
"legacy_id": {
|
|
191
|
+
"type": "keyword"
|
|
192
|
+
},
|
|
193
|
+
"location": {
|
|
194
|
+
"properties": {
|
|
195
|
+
"pid": {
|
|
196
|
+
"type": "keyword"
|
|
197
|
+
},
|
|
198
|
+
"legacy_id": {
|
|
199
|
+
"type": "keyword"
|
|
200
|
+
},
|
|
201
|
+
"name": {
|
|
202
|
+
"type": "keyword"
|
|
203
|
+
},
|
|
204
|
+
"opening_weekdays": {
|
|
205
|
+
"properties": {
|
|
206
|
+
"weekday": {
|
|
207
|
+
"type": "keyword"
|
|
208
|
+
},
|
|
209
|
+
"is_open": {
|
|
210
|
+
"type": "boolean"
|
|
211
|
+
},
|
|
212
|
+
"times": {
|
|
213
|
+
"properties": {
|
|
214
|
+
"start_time": {
|
|
215
|
+
"type": "keyword"
|
|
216
|
+
},
|
|
217
|
+
"end_time": {
|
|
218
|
+
"type": "keyword"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"type": "object"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"type": "object"
|
|
225
|
+
},
|
|
226
|
+
"opening_exceptions": {
|
|
227
|
+
"properties": {
|
|
228
|
+
"title": {
|
|
229
|
+
"type": "keyword"
|
|
230
|
+
},
|
|
231
|
+
"is_open": {
|
|
232
|
+
"type": "boolean"
|
|
233
|
+
},
|
|
234
|
+
"start_date": {
|
|
235
|
+
"type": "date"
|
|
236
|
+
},
|
|
237
|
+
"end_date": {
|
|
238
|
+
"type": "date"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"type": "object"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"type": "object"
|
|
245
|
+
},
|
|
246
|
+
"location_pid": {
|
|
247
|
+
"type": "keyword"
|
|
248
|
+
},
|
|
249
|
+
"name": {
|
|
250
|
+
"type": "keyword"
|
|
251
|
+
},
|
|
252
|
+
"notes": {
|
|
253
|
+
"type": "text"
|
|
254
|
+
},
|
|
255
|
+
"physical_location": {
|
|
256
|
+
"type": "keyword"
|
|
257
|
+
},
|
|
258
|
+
"pid": {
|
|
259
|
+
"type": "keyword"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"type": "object"
|
|
263
|
+
},
|
|
264
|
+
"internal_location_pid": {
|
|
265
|
+
"type": "keyword"
|
|
266
|
+
},
|
|
267
|
+
"internal_notes": {
|
|
268
|
+
"type": "text"
|
|
269
|
+
},
|
|
270
|
+
"isbns": {
|
|
271
|
+
"properties": {
|
|
272
|
+
"description": {
|
|
273
|
+
"type": "keyword"
|
|
274
|
+
},
|
|
275
|
+
"value": {
|
|
276
|
+
"type": "keyword"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"type": "object"
|
|
280
|
+
},
|
|
281
|
+
"legacy_id": {
|
|
282
|
+
"type": "keyword"
|
|
283
|
+
},
|
|
284
|
+
"legacy_library_id": {
|
|
285
|
+
"type": "keyword"
|
|
286
|
+
},
|
|
287
|
+
"medium": {
|
|
288
|
+
"type": "keyword"
|
|
289
|
+
},
|
|
290
|
+
"number_of_pages": {
|
|
291
|
+
"type": "integer"
|
|
292
|
+
},
|
|
293
|
+
"pid": {
|
|
294
|
+
"type": "keyword"
|
|
295
|
+
},
|
|
296
|
+
"price": {
|
|
297
|
+
"properties": {
|
|
298
|
+
"currency": {
|
|
299
|
+
"type": "keyword"
|
|
300
|
+
},
|
|
301
|
+
"value": {
|
|
302
|
+
"type": "float"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"type": "object"
|
|
306
|
+
},
|
|
307
|
+
"shelf": {
|
|
308
|
+
"type": "text"
|
|
309
|
+
},
|
|
310
|
+
"identifiers": {
|
|
311
|
+
"properties": {
|
|
312
|
+
"scheme": {
|
|
313
|
+
"type": "keyword"
|
|
314
|
+
},
|
|
315
|
+
"value": {
|
|
316
|
+
"type": "keyword"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"type": "object"
|
|
320
|
+
},
|
|
321
|
+
"status": {
|
|
322
|
+
"type": "keyword"
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -142,6 +142,28 @@
|
|
|
142
142
|
"type": "string",
|
|
143
143
|
"title": "The shelf location of this Item"
|
|
144
144
|
},
|
|
145
|
+
"identifiers": {
|
|
146
|
+
"items": {
|
|
147
|
+
"additionalProperties": false,
|
|
148
|
+
"properties": {
|
|
149
|
+
"scheme": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"title": "Type of identification"
|
|
152
|
+
},
|
|
153
|
+
"value": {
|
|
154
|
+
"minLength": 1,
|
|
155
|
+
"type": "string",
|
|
156
|
+
"title": "Scheme's value"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"required": ["scheme", "value"],
|
|
160
|
+
"title": "Identifiers",
|
|
161
|
+
"type": "object"
|
|
162
|
+
},
|
|
163
|
+
"title": "List of Identifiers",
|
|
164
|
+
"type": "array",
|
|
165
|
+
"uniqueItems": true
|
|
166
|
+
},
|
|
145
167
|
"status": {
|
|
146
168
|
"type": "string",
|
|
147
169
|
"title": "The current status of this Item"
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
3
|
+
"title": "Schema for Item",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"$schema",
|
|
7
|
+
"created_by",
|
|
8
|
+
"internal_location_pid",
|
|
9
|
+
"barcode",
|
|
10
|
+
"status",
|
|
11
|
+
"pid",
|
|
12
|
+
"document_pid",
|
|
13
|
+
"circulation_restriction",
|
|
14
|
+
"medium"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"$schema": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"acquisition_pid": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"title": "The persistent identifier of the acquisition"
|
|
23
|
+
},
|
|
24
|
+
"barcode": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"title": "The barcode of this Item"
|
|
27
|
+
},
|
|
28
|
+
"circulation_restriction": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"title": "The circulation restriction on this Item"
|
|
31
|
+
},
|
|
32
|
+
"circulation": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"$ref": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"created_by": {
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"properties": {
|
|
43
|
+
"type": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"value": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"type": "object"
|
|
51
|
+
},
|
|
52
|
+
"description": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"title": "Any extra description for this Item"
|
|
55
|
+
},
|
|
56
|
+
"document_pid": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"title": "The persistent identifier of its Document"
|
|
59
|
+
},
|
|
60
|
+
"document": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"$ref": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"internal_location_pid": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"title": "The persistent identifier of its Internal Location"
|
|
71
|
+
},
|
|
72
|
+
"internal_location": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"$ref": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"internal_notes": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"title": "Any extra description for this Item reserved for library usage"
|
|
83
|
+
},
|
|
84
|
+
"isbns": {
|
|
85
|
+
"items": {
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"properties": {
|
|
88
|
+
"description": {
|
|
89
|
+
"title": "Free text, used to describe the document to ISBN refers to.",
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"value": {
|
|
93
|
+
"minLength": 1,
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": ["value"],
|
|
98
|
+
"title": "ISBN",
|
|
99
|
+
"type": "object"
|
|
100
|
+
},
|
|
101
|
+
"title": "List of ISBNs",
|
|
102
|
+
"type": "array",
|
|
103
|
+
"uniqueItems": true
|
|
104
|
+
},
|
|
105
|
+
"legacy_id": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"title": "The previous id of this Item before migration"
|
|
108
|
+
},
|
|
109
|
+
"legacy_library_id": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"title": "The previous id of the location of this Item before migration"
|
|
112
|
+
},
|
|
113
|
+
"medium": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"title": "The medium of this Item"
|
|
116
|
+
},
|
|
117
|
+
"number_of_pages": {
|
|
118
|
+
"minimum": 1,
|
|
119
|
+
"title": "Number of pages of the book",
|
|
120
|
+
"type": "integer"
|
|
121
|
+
},
|
|
122
|
+
"pid": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"title": "The persistent identifier of this Item"
|
|
125
|
+
},
|
|
126
|
+
"price": {
|
|
127
|
+
"properties": {
|
|
128
|
+
"currency": {
|
|
129
|
+
"title": "Currency of the price (Vocabulary)",
|
|
130
|
+
"type": "string"
|
|
131
|
+
},
|
|
132
|
+
"value": {
|
|
133
|
+
"minimum": 0,
|
|
134
|
+
"title": "Price value",
|
|
135
|
+
"type": "number"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
"type": "object"
|
|
140
|
+
},
|
|
141
|
+
"shelf": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"title": "The shelf location of this Item"
|
|
144
|
+
},
|
|
145
|
+
"identifiers": {
|
|
146
|
+
"items": {
|
|
147
|
+
"additionalProperties": false,
|
|
148
|
+
"properties": {
|
|
149
|
+
"scheme": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"title": "Type of identification"
|
|
152
|
+
},
|
|
153
|
+
"value": {
|
|
154
|
+
"minLength": 1,
|
|
155
|
+
"type": "string",
|
|
156
|
+
"title": "Scheme's value"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"required": ["scheme", "value"],
|
|
160
|
+
"title": "Identifiers",
|
|
161
|
+
"type": "object"
|
|
162
|
+
},
|
|
163
|
+
"title": "List of Identifiers",
|
|
164
|
+
"type": "array",
|
|
165
|
+
"uniqueItems": true
|
|
166
|
+
},
|
|
167
|
+
"status": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"title": "The current status of this Item"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
invenio_app_ils/items/search.py
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
"""ILS Items search APIs."""
|
|
9
9
|
|
|
10
|
-
from elasticsearch_dsl import A, Q
|
|
11
10
|
from invenio_search.api import RecordsSearch
|
|
11
|
+
from invenio_search.engine import dsl
|
|
12
12
|
|
|
13
13
|
from invenio_app_ils.errors import MissingRequiredParameterError
|
|
14
14
|
from invenio_app_ils.proxies import current_app_ils
|
|
@@ -32,9 +32,20 @@ class ItemSearch(RecordsSearch):
|
|
|
32
32
|
if document_pid:
|
|
33
33
|
search = search.filter("term", document_pid=document_pid)
|
|
34
34
|
else:
|
|
35
|
-
raise MissingRequiredParameterError(
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
raise MissingRequiredParameterError(description="document_pid is required")
|
|
36
|
+
|
|
37
|
+
if filter_states:
|
|
38
|
+
search = search.filter("terms", status=filter_states)
|
|
39
|
+
elif exclude_states:
|
|
40
|
+
search = search.exclude("terms", status=exclude_states)
|
|
41
|
+
|
|
42
|
+
return search
|
|
43
|
+
|
|
44
|
+
def search_by_barcode(self, barcode, filter_states=None, exclude_states=None):
|
|
45
|
+
"""Retrieve items matching the given barcode."""
|
|
46
|
+
search = self
|
|
47
|
+
|
|
48
|
+
search = search.filter("term", barcode=barcode)
|
|
38
49
|
|
|
39
50
|
if filter_states:
|
|
40
51
|
search = search.filter("terms", status=filter_states)
|
|
@@ -53,9 +64,7 @@ class ItemSearch(RecordsSearch):
|
|
|
53
64
|
search = self
|
|
54
65
|
|
|
55
66
|
if internal_location_pid:
|
|
56
|
-
search = search.filter(
|
|
57
|
-
"term", internal_location_pid=internal_location_pid
|
|
58
|
-
)
|
|
67
|
+
search = search.filter("term", internal_location_pid=internal_location_pid)
|
|
59
68
|
else:
|
|
60
69
|
raise MissingRequiredParameterError(
|
|
61
70
|
description="internal_location_pid is required"
|
|
@@ -79,9 +88,7 @@ class ItemSearch(RecordsSearch):
|
|
|
79
88
|
"term", **{"internal_location.location_pid": location_pid}
|
|
80
89
|
)
|
|
81
90
|
else:
|
|
82
|
-
raise MissingRequiredParameterError(
|
|
83
|
-
description="location_pid is required"
|
|
84
|
-
)
|
|
91
|
+
raise MissingRequiredParameterError(description="location_pid is required")
|
|
85
92
|
|
|
86
93
|
if filter_states:
|
|
87
94
|
search = search.filter("terms", status=filter_states)
|
|
@@ -98,7 +105,7 @@ def get_items_aggregated_by_statuses(document_pid):
|
|
|
98
105
|
search = search_cls().filter("term", document_pid=document_pid)
|
|
99
106
|
|
|
100
107
|
# Aggregation
|
|
101
|
-
aggs = A("terms", field="status")
|
|
108
|
+
aggs = dsl.A("terms", field="status")
|
|
102
109
|
search.aggs.bucket("statuses", aggs)
|
|
103
110
|
|
|
104
111
|
return search
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
from invenio_records_rest.serializers.csv import CSVSerializer
|
|
11
11
|
from invenio_records_rest.serializers.json import JSONSerializer
|
|
12
12
|
|
|
13
|
+
from invenio_app_ils.literature.serializers.custom_fields import field_cover_metadata
|
|
13
14
|
from invenio_app_ils.permissions import patron_permission
|
|
14
15
|
|
|
15
16
|
FILTER_KEYS = [
|
|
@@ -48,16 +49,16 @@ class ItemCSVSerializer(CSVSerializer):
|
|
|
48
49
|
pid, record, links_factory=links_factory, **kwargs
|
|
49
50
|
)
|
|
50
51
|
filter_circulation(item)
|
|
52
|
+
field_cover_metadata(item.get("metadata", {}).get("document", {}))
|
|
51
53
|
return item
|
|
52
54
|
|
|
53
|
-
def transform_search_hit(
|
|
54
|
-
self, pid, record_hit, links_factory=None, **kwargs
|
|
55
|
-
):
|
|
55
|
+
def transform_search_hit(self, pid, record_hit, links_factory=None, **kwargs):
|
|
56
56
|
"""Transform search result hit into an intermediate representation."""
|
|
57
57
|
hit = super().transform_search_hit(
|
|
58
58
|
pid, record_hit, links_factory=links_factory, **kwargs
|
|
59
59
|
)
|
|
60
60
|
filter_circulation(hit)
|
|
61
|
+
field_cover_metadata(hit.get("metadata", {}).get("document", {}))
|
|
61
62
|
return hit
|
|
62
63
|
|
|
63
64
|
|
|
@@ -70,14 +71,14 @@ class ItemJSONSerializer(JSONSerializer):
|
|
|
70
71
|
pid, record, links_factory=links_factory, **kwargs
|
|
71
72
|
)
|
|
72
73
|
filter_circulation(item)
|
|
74
|
+
field_cover_metadata(item.get("metadata", {}).get("document", {}))
|
|
73
75
|
return item
|
|
74
76
|
|
|
75
|
-
def transform_search_hit(
|
|
76
|
-
self, pid, record_hit, links_factory=None, **kwargs
|
|
77
|
-
):
|
|
77
|
+
def transform_search_hit(self, pid, record_hit, links_factory=None, **kwargs):
|
|
78
78
|
"""Transform search result hit into an intermediate representation."""
|
|
79
79
|
hit = super().transform_search_hit(
|
|
80
80
|
pid, record_hit, links_factory=links_factory, **kwargs
|
|
81
81
|
)
|
|
82
82
|
filter_circulation(hit)
|
|
83
|
+
field_cover_metadata(hit.get("metadata", {}).get("document", {}))
|
|
83
84
|
return hit
|
|
@@ -25,6 +25,4 @@ LiteratureIdProvider = type(
|
|
|
25
25
|
dict(pid_type=LITERATURE_PID_TYPE, default_status=PIDStatus.REGISTERED),
|
|
26
26
|
)
|
|
27
27
|
literature_pid_minter = dummy_pid_minter
|
|
28
|
-
literature_pid_fetcher = partial(
|
|
29
|
-
pid_fetcher, provider_cls=LiteratureIdProvider
|
|
30
|
-
)
|
|
28
|
+
literature_pid_fetcher = partial(pid_fetcher, provider_cls=LiteratureIdProvider)
|
|
@@ -15,7 +15,7 @@ from invenio_app_ils.search_permissions import (
|
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
def search_factory_literature(self, search):
|
|
18
|
+
def search_factory_literature(self, search, query_parser=None):
|
|
19
19
|
"""Search factory for literature (series and documents)."""
|
|
20
20
|
|
|
21
21
|
def filter_serial_issues(search, query_string=None):
|
|
@@ -31,14 +31,12 @@ def search_factory_literature(self, search):
|
|
|
31
31
|
if not strtobool(include_all):
|
|
32
32
|
issue_query_string = "NOT document_type:SERIAL_ISSUE"
|
|
33
33
|
if query_string:
|
|
34
|
-
query_string = "{} AND {}".format(
|
|
35
|
-
query_string, issue_query_string
|
|
36
|
-
)
|
|
34
|
+
query_string = "({}) AND ({})".format(query_string, issue_query_string)
|
|
37
35
|
else:
|
|
38
36
|
query_string = issue_query_string
|
|
39
37
|
return search, query_string
|
|
40
38
|
|
|
41
|
-
return ils_search_factory(self, search, filter_serial_issues)
|
|
39
|
+
return ils_search_factory(self, search, query_parser, filter_serial_issues)
|
|
42
40
|
|
|
43
41
|
|
|
44
42
|
class LiteratureSearch(RecordsSearch):
|
|
@@ -23,9 +23,7 @@ class LiteratureCSVSerializer(CSVSerializer):
|
|
|
23
23
|
field_cover_metadata(literature["metadata"])
|
|
24
24
|
return literature
|
|
25
25
|
|
|
26
|
-
def transform_search_hit(
|
|
27
|
-
self, pid, record_hit, links_factory=None, **kwargs
|
|
28
|
-
):
|
|
26
|
+
def transform_search_hit(self, pid, record_hit, links_factory=None, **kwargs):
|
|
29
27
|
"""Transform search result hit into an intermediate representation."""
|
|
30
28
|
hit = super().transform_search_hit(
|
|
31
29
|
pid, record_hit, links_factory=links_factory, **kwargs
|
|
@@ -23,9 +23,7 @@ class LiteratureJSONSerializer(JSONSerializer):
|
|
|
23
23
|
field_cover_metadata(literature["metadata"])
|
|
24
24
|
return literature
|
|
25
25
|
|
|
26
|
-
def transform_search_hit(
|
|
27
|
-
self, pid, record_hit, links_factory=None, **kwargs
|
|
28
|
-
):
|
|
26
|
+
def transform_search_hit(self, pid, record_hit, links_factory=None, **kwargs):
|
|
29
27
|
"""Transform search result hit into an intermediate representation."""
|
|
30
28
|
hit = super().transform_search_hit(
|
|
31
29
|
pid, record_hit, links_factory=links_factory, **kwargs
|