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,254 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings": {
|
|
3
|
+
"analysis": {
|
|
4
|
+
"analyzer": {
|
|
5
|
+
"email": {
|
|
6
|
+
"type": "custom",
|
|
7
|
+
"tokenizer": "uax_url_email"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"mappings": {
|
|
13
|
+
"date_detection": false,
|
|
14
|
+
"numeric_detection": false,
|
|
15
|
+
"properties": {
|
|
16
|
+
"$schema": {
|
|
17
|
+
"type": "keyword"
|
|
18
|
+
},
|
|
19
|
+
"_created": {
|
|
20
|
+
"type": "date"
|
|
21
|
+
},
|
|
22
|
+
"_updated": {
|
|
23
|
+
"type": "date"
|
|
24
|
+
},
|
|
25
|
+
"cancel_reason": {
|
|
26
|
+
"type": "text"
|
|
27
|
+
},
|
|
28
|
+
"created_by": {
|
|
29
|
+
"properties": {
|
|
30
|
+
"type": {
|
|
31
|
+
"type": "keyword"
|
|
32
|
+
},
|
|
33
|
+
"value": {
|
|
34
|
+
"type": "keyword"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"type": "object"
|
|
38
|
+
},
|
|
39
|
+
"document": {
|
|
40
|
+
"properties": {
|
|
41
|
+
"authors": {
|
|
42
|
+
"type": "text"
|
|
43
|
+
},
|
|
44
|
+
"cover_metadata": {
|
|
45
|
+
"properties": {},
|
|
46
|
+
"type": "object"
|
|
47
|
+
},
|
|
48
|
+
"edition": {
|
|
49
|
+
"type": "text"
|
|
50
|
+
},
|
|
51
|
+
"pid": {
|
|
52
|
+
"type": "keyword"
|
|
53
|
+
},
|
|
54
|
+
"publication_year": {
|
|
55
|
+
"type": "keyword"
|
|
56
|
+
},
|
|
57
|
+
"title": {
|
|
58
|
+
"type": "text"
|
|
59
|
+
},
|
|
60
|
+
"alternative_titles": {
|
|
61
|
+
"properties": {
|
|
62
|
+
"language": {
|
|
63
|
+
"type": "keyword"
|
|
64
|
+
},
|
|
65
|
+
"type": {
|
|
66
|
+
"type": "keyword"
|
|
67
|
+
},
|
|
68
|
+
"value": {
|
|
69
|
+
"type": "text"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"type": "object"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"type": "object"
|
|
76
|
+
},
|
|
77
|
+
"document_pid": {
|
|
78
|
+
"type": "keyword"
|
|
79
|
+
},
|
|
80
|
+
"due_date": {
|
|
81
|
+
"type": "date"
|
|
82
|
+
},
|
|
83
|
+
"expected_delivery_date": {
|
|
84
|
+
"type": "date"
|
|
85
|
+
},
|
|
86
|
+
"legacy_id": {
|
|
87
|
+
"type": "keyword"
|
|
88
|
+
},
|
|
89
|
+
"provider": {
|
|
90
|
+
"properties": {
|
|
91
|
+
"name": {
|
|
92
|
+
"fields": {
|
|
93
|
+
"keyword": {
|
|
94
|
+
"type": "keyword"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"type": "text"
|
|
98
|
+
},
|
|
99
|
+
"pid": {
|
|
100
|
+
"type": "keyword"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"type": "object"
|
|
104
|
+
},
|
|
105
|
+
"provider_pid": {
|
|
106
|
+
"type": "keyword"
|
|
107
|
+
},
|
|
108
|
+
"notes": {
|
|
109
|
+
"type": "text"
|
|
110
|
+
},
|
|
111
|
+
"patron": {
|
|
112
|
+
"properties": {
|
|
113
|
+
"email": {
|
|
114
|
+
"type": "text",
|
|
115
|
+
"analyzer": "email"
|
|
116
|
+
},
|
|
117
|
+
"id": {
|
|
118
|
+
"type": "keyword"
|
|
119
|
+
},
|
|
120
|
+
"name": {
|
|
121
|
+
"type": "text",
|
|
122
|
+
"fields": {
|
|
123
|
+
"keyword": {
|
|
124
|
+
"type": "keyword"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"location_pid": {
|
|
129
|
+
"type": "keyword"
|
|
130
|
+
},
|
|
131
|
+
"pid": {
|
|
132
|
+
"type": "keyword"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"type": "object"
|
|
136
|
+
},
|
|
137
|
+
"patron_pid": {
|
|
138
|
+
"type": "keyword"
|
|
139
|
+
},
|
|
140
|
+
"patron_loan": {
|
|
141
|
+
"properties": {
|
|
142
|
+
"extension": {
|
|
143
|
+
"properties": {
|
|
144
|
+
"notes": {
|
|
145
|
+
"type": "text"
|
|
146
|
+
},
|
|
147
|
+
"request_date": {
|
|
148
|
+
"type": "date"
|
|
149
|
+
},
|
|
150
|
+
"status": {
|
|
151
|
+
"type": "keyword"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"type": "object"
|
|
155
|
+
},
|
|
156
|
+
"pid": {
|
|
157
|
+
"type": "keyword"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"type": "object"
|
|
161
|
+
},
|
|
162
|
+
"payment": {
|
|
163
|
+
"properties": {
|
|
164
|
+
"budget_code": {
|
|
165
|
+
"type": "keyword"
|
|
166
|
+
},
|
|
167
|
+
"debit_cost": {
|
|
168
|
+
"properties": {
|
|
169
|
+
"currency": {
|
|
170
|
+
"type": "keyword"
|
|
171
|
+
},
|
|
172
|
+
"value": {
|
|
173
|
+
"type": "float"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"type": "object"
|
|
177
|
+
},
|
|
178
|
+
"debit_cost_main_currency": {
|
|
179
|
+
"properties": {
|
|
180
|
+
"currency": {
|
|
181
|
+
"type": "keyword"
|
|
182
|
+
},
|
|
183
|
+
"value": {
|
|
184
|
+
"type": "float"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"type": "object"
|
|
188
|
+
},
|
|
189
|
+
"debit_date": {
|
|
190
|
+
"type": "date"
|
|
191
|
+
},
|
|
192
|
+
"debit_note": {
|
|
193
|
+
"type": "text"
|
|
194
|
+
},
|
|
195
|
+
"internal_purchase_requisition_id": {
|
|
196
|
+
"type": "keyword"
|
|
197
|
+
},
|
|
198
|
+
"mode": {
|
|
199
|
+
"type": "keyword"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"type": "object"
|
|
203
|
+
},
|
|
204
|
+
"pid": {
|
|
205
|
+
"type": "keyword"
|
|
206
|
+
},
|
|
207
|
+
"received_date": {
|
|
208
|
+
"type": "date"
|
|
209
|
+
},
|
|
210
|
+
"request_date": {
|
|
211
|
+
"type": "date"
|
|
212
|
+
},
|
|
213
|
+
"status": {
|
|
214
|
+
"type": "keyword"
|
|
215
|
+
},
|
|
216
|
+
"total": {
|
|
217
|
+
"properties": {
|
|
218
|
+
"currency": {
|
|
219
|
+
"type": "keyword"
|
|
220
|
+
},
|
|
221
|
+
"value": {
|
|
222
|
+
"type": "float"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"type": "object"
|
|
226
|
+
},
|
|
227
|
+
"total_main_currency": {
|
|
228
|
+
"properties": {
|
|
229
|
+
"currency": {
|
|
230
|
+
"type": "keyword"
|
|
231
|
+
},
|
|
232
|
+
"value": {
|
|
233
|
+
"type": "float"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"type": "object"
|
|
237
|
+
},
|
|
238
|
+
"type": {
|
|
239
|
+
"type": "keyword"
|
|
240
|
+
},
|
|
241
|
+
"updated_by": {
|
|
242
|
+
"properties": {
|
|
243
|
+
"type": {
|
|
244
|
+
"type": "keyword"
|
|
245
|
+
},
|
|
246
|
+
"value": {
|
|
247
|
+
"type": "keyword"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"type": "object"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -56,6 +56,20 @@
|
|
|
56
56
|
},
|
|
57
57
|
"title": {
|
|
58
58
|
"type": "text"
|
|
59
|
+
},
|
|
60
|
+
"alternative_titles": {
|
|
61
|
+
"properties": {
|
|
62
|
+
"language": {
|
|
63
|
+
"type": "keyword"
|
|
64
|
+
},
|
|
65
|
+
"type": {
|
|
66
|
+
"type": "keyword"
|
|
67
|
+
},
|
|
68
|
+
"value": {
|
|
69
|
+
"type": "text"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"type": "object"
|
|
59
73
|
}
|
|
60
74
|
},
|
|
61
75
|
"type": "object"
|
|
@@ -11,10 +11,7 @@ from flask import current_app
|
|
|
11
11
|
from invenio_records_rest.utils import obj_or_import_string
|
|
12
12
|
|
|
13
13
|
from invenio_app_ils.ill.errors import ILLError
|
|
14
|
-
from invenio_app_ils.notifications.api import
|
|
15
|
-
build_common_msg_ctx,
|
|
16
|
-
send_notification,
|
|
17
|
-
)
|
|
14
|
+
from invenio_app_ils.notifications.api import build_common_msg_ctx, send_notification
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
def _build_ill_msg_ctx(brw_req):
|
invenio_app_ils/ill/search.py
CHANGED
|
@@ -28,9 +28,7 @@ class BorrowingRequestsSearch(RecordsSearch):
|
|
|
28
28
|
if document_pid:
|
|
29
29
|
search = search.filter("term", document_pid=document_pid)
|
|
30
30
|
else:
|
|
31
|
-
raise MissingRequiredParameterError(
|
|
32
|
-
description="document_pid is required"
|
|
33
|
-
)
|
|
31
|
+
raise MissingRequiredParameterError(description="document_pid is required")
|
|
34
32
|
return search
|
|
35
33
|
|
|
36
34
|
def search_by_patron_pid(self, patron_pid=None):
|
|
@@ -40,9 +38,7 @@ class BorrowingRequestsSearch(RecordsSearch):
|
|
|
40
38
|
if patron_pid:
|
|
41
39
|
search = search.filter("term", patron_pid=patron_pid)
|
|
42
40
|
else:
|
|
43
|
-
raise MissingRequiredParameterError(
|
|
44
|
-
description="patron_pid is required"
|
|
45
|
-
)
|
|
41
|
+
raise MissingRequiredParameterError(description="patron_pid is required")
|
|
46
42
|
return search
|
|
47
43
|
|
|
48
44
|
def search_by_provider_pid(self, provider_pid=None):
|
|
@@ -52,8 +48,6 @@ class BorrowingRequestsSearch(RecordsSearch):
|
|
|
52
48
|
if provider_pid:
|
|
53
49
|
search = search.filter("term", provider_pid=provider_pid)
|
|
54
50
|
else:
|
|
55
|
-
raise MissingRequiredParameterError(
|
|
56
|
-
description="provider_pid is required"
|
|
57
|
-
)
|
|
51
|
+
raise MissingRequiredParameterError(description="provider_pid is required")
|
|
58
52
|
|
|
59
53
|
return search
|
|
@@ -19,8 +19,6 @@ csv_v1 = BorrowingRequestCSVSerializer(ILSRecordSchemaJSONV1)
|
|
|
19
19
|
csv_v1_response = record_responsify_no_etag(csv_v1, "text/csv")
|
|
20
20
|
csv_v1_search = search_responsify(csv_v1, "text/csv")
|
|
21
21
|
|
|
22
|
-
json_v1 = BorrowingRequestJSONSerializer(
|
|
23
|
-
ILSRecordSchemaJSONV1, replace_refs=True
|
|
24
|
-
)
|
|
22
|
+
json_v1 = BorrowingRequestJSONSerializer(ILSRecordSchemaJSONV1, replace_refs=True)
|
|
25
23
|
json_v1_response = record_responsify_no_etag(json_v1, "application/json")
|
|
26
24
|
json_v1_search = search_responsify(json_v1, "application/json")
|
invenio_app_ils/ill/views.py
CHANGED
|
@@ -41,8 +41,7 @@ def create_ill_blueprint(app):
|
|
|
41
41
|
default_media_type = options.get("default_media_type", "")
|
|
42
42
|
rec_serializers = options.get("record_serializers", {})
|
|
43
43
|
serializers = {
|
|
44
|
-
mime: obj_or_import_string(func)
|
|
45
|
-
for mime, func in rec_serializers.items()
|
|
44
|
+
mime: obj_or_import_string(func) for mime, func in rec_serializers.items()
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
def create_view(view_cls, path, loader):
|
|
@@ -123,8 +122,7 @@ class ILLPatronLoanExtensionActionResource(ILLActionResource):
|
|
|
123
122
|
"""Validate that the extension action can be performed."""
|
|
124
123
|
loan = record.patron_loan.get()
|
|
125
124
|
is_loan_active = (
|
|
126
|
-
loan["state"]
|
|
127
|
-
in current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]
|
|
125
|
+
loan["state"] in current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]
|
|
128
126
|
)
|
|
129
127
|
if not is_loan_active:
|
|
130
128
|
raise ILLError("This interlibrary loan is not active.")
|
|
@@ -14,10 +14,7 @@ from invenio_pidstore.errors import PIDDoesNotExistError
|
|
|
14
14
|
from invenio_pidstore.models import PIDStatus
|
|
15
15
|
from invenio_pidstore.providers.recordid_v2 import RecordIdProviderV2
|
|
16
16
|
|
|
17
|
-
from invenio_app_ils.errors import
|
|
18
|
-
LocationNotFoundError,
|
|
19
|
-
RecordHasReferencesError,
|
|
20
|
-
)
|
|
17
|
+
from invenio_app_ils.errors import LocationNotFoundError, RecordHasReferencesError
|
|
21
18
|
from invenio_app_ils.fetchers import pid_fetcher
|
|
22
19
|
from invenio_app_ils.minters import pid_minter
|
|
23
20
|
from invenio_app_ils.proxies import current_app_ils
|
invenio_app_ils/internal_locations/mappings/os-v1/internal_locations/internal_location-v1.0.0.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings": {
|
|
3
|
+
"analysis": {
|
|
4
|
+
"analyzer": {
|
|
5
|
+
"email": {
|
|
6
|
+
"type": "custom",
|
|
7
|
+
"tokenizer": "uax_url_email"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"mappings": {
|
|
13
|
+
"date_detection": false,
|
|
14
|
+
"numeric_detection": false,
|
|
15
|
+
"properties": {
|
|
16
|
+
"$schema": {
|
|
17
|
+
"type": "keyword"
|
|
18
|
+
},
|
|
19
|
+
"_created": {
|
|
20
|
+
"type": "date"
|
|
21
|
+
},
|
|
22
|
+
"_updated": {
|
|
23
|
+
"type": "date"
|
|
24
|
+
},
|
|
25
|
+
"legacy_id": {
|
|
26
|
+
"type": "keyword"
|
|
27
|
+
},
|
|
28
|
+
"location": {
|
|
29
|
+
"properties": {
|
|
30
|
+
"pid": {
|
|
31
|
+
"type": "keyword"
|
|
32
|
+
},
|
|
33
|
+
"legacy_id": {
|
|
34
|
+
"type": "keyword"
|
|
35
|
+
},
|
|
36
|
+
"name": {
|
|
37
|
+
"type": "text",
|
|
38
|
+
"fields": {
|
|
39
|
+
"keyword": {
|
|
40
|
+
"type": "keyword"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"opening_weekdays": {
|
|
45
|
+
"properties": {
|
|
46
|
+
"weekday": {
|
|
47
|
+
"type": "keyword"
|
|
48
|
+
},
|
|
49
|
+
"is_open": {
|
|
50
|
+
"type": "boolean"
|
|
51
|
+
},
|
|
52
|
+
"times": {
|
|
53
|
+
"properties": {
|
|
54
|
+
"start_time": {
|
|
55
|
+
"type": "text"
|
|
56
|
+
},
|
|
57
|
+
"end_time": {
|
|
58
|
+
"type": "text"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"type": "object"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"type": "object"
|
|
65
|
+
},
|
|
66
|
+
"opening_exceptions": {
|
|
67
|
+
"properties": {
|
|
68
|
+
"title": {
|
|
69
|
+
"type": "keyword"
|
|
70
|
+
},
|
|
71
|
+
"is_open": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"start_date": {
|
|
75
|
+
"type": "date"
|
|
76
|
+
},
|
|
77
|
+
"end_date": {
|
|
78
|
+
"type": "date"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"type": "object"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"type": "object"
|
|
85
|
+
},
|
|
86
|
+
"location_pid": {
|
|
87
|
+
"type": "keyword"
|
|
88
|
+
},
|
|
89
|
+
"name": {
|
|
90
|
+
"type": "text",
|
|
91
|
+
"fields": {
|
|
92
|
+
"keyword": {
|
|
93
|
+
"type": "keyword"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"notes": {
|
|
98
|
+
"type": "text"
|
|
99
|
+
},
|
|
100
|
+
"physical_location": {
|
|
101
|
+
"type": "text"
|
|
102
|
+
},
|
|
103
|
+
"pid": {
|
|
104
|
+
"type": "keyword"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
invenio_app_ils/internal_locations/mappings/os-v2/internal_locations/internal_location-v1.0.0.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings": {
|
|
3
|
+
"analysis": {
|
|
4
|
+
"analyzer": {
|
|
5
|
+
"email": {
|
|
6
|
+
"type": "custom",
|
|
7
|
+
"tokenizer": "uax_url_email"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"mappings": {
|
|
13
|
+
"date_detection": false,
|
|
14
|
+
"numeric_detection": false,
|
|
15
|
+
"properties": {
|
|
16
|
+
"$schema": {
|
|
17
|
+
"type": "keyword"
|
|
18
|
+
},
|
|
19
|
+
"_created": {
|
|
20
|
+
"type": "date"
|
|
21
|
+
},
|
|
22
|
+
"_updated": {
|
|
23
|
+
"type": "date"
|
|
24
|
+
},
|
|
25
|
+
"legacy_id": {
|
|
26
|
+
"type": "keyword"
|
|
27
|
+
},
|
|
28
|
+
"location": {
|
|
29
|
+
"properties": {
|
|
30
|
+
"pid": {
|
|
31
|
+
"type": "keyword"
|
|
32
|
+
},
|
|
33
|
+
"legacy_id": {
|
|
34
|
+
"type": "keyword"
|
|
35
|
+
},
|
|
36
|
+
"name": {
|
|
37
|
+
"type": "text",
|
|
38
|
+
"fields": {
|
|
39
|
+
"keyword": {
|
|
40
|
+
"type": "keyword"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"opening_weekdays": {
|
|
45
|
+
"properties": {
|
|
46
|
+
"weekday": {
|
|
47
|
+
"type": "keyword"
|
|
48
|
+
},
|
|
49
|
+
"is_open": {
|
|
50
|
+
"type": "boolean"
|
|
51
|
+
},
|
|
52
|
+
"times": {
|
|
53
|
+
"properties": {
|
|
54
|
+
"start_time": {
|
|
55
|
+
"type": "text"
|
|
56
|
+
},
|
|
57
|
+
"end_time": {
|
|
58
|
+
"type": "text"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"type": "object"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"type": "object"
|
|
65
|
+
},
|
|
66
|
+
"opening_exceptions": {
|
|
67
|
+
"properties": {
|
|
68
|
+
"title": {
|
|
69
|
+
"type": "keyword"
|
|
70
|
+
},
|
|
71
|
+
"is_open": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"start_date": {
|
|
75
|
+
"type": "date"
|
|
76
|
+
},
|
|
77
|
+
"end_date": {
|
|
78
|
+
"type": "date"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"type": "object"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"type": "object"
|
|
85
|
+
},
|
|
86
|
+
"location_pid": {
|
|
87
|
+
"type": "keyword"
|
|
88
|
+
},
|
|
89
|
+
"name": {
|
|
90
|
+
"type": "text",
|
|
91
|
+
"fields": {
|
|
92
|
+
"keyword": {
|
|
93
|
+
"type": "keyword"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"notes": {
|
|
98
|
+
"type": "text"
|
|
99
|
+
},
|
|
100
|
+
"physical_location": {
|
|
101
|
+
"type": "text"
|
|
102
|
+
},
|
|
103
|
+
"pid": {
|
|
104
|
+
"type": "keyword"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -30,9 +30,7 @@ class InternalLocationSearch(RecordsSearch):
|
|
|
30
30
|
if location_pid:
|
|
31
31
|
search = search.filter("term", location_pid=location_pid)
|
|
32
32
|
else:
|
|
33
|
-
raise MissingRequiredParameterError(
|
|
34
|
-
description="location_pid is required"
|
|
35
|
-
)
|
|
33
|
+
raise MissingRequiredParameterError(description="location_pid is required")
|
|
36
34
|
|
|
37
35
|
if filter_states:
|
|
38
36
|
search = search.filter("terms", state=filter_states)
|
invenio_app_ils/items/api.py
CHANGED
|
@@ -11,10 +11,7 @@ from functools import partial
|
|
|
11
11
|
|
|
12
12
|
from flask import current_app
|
|
13
13
|
from invenio_circulation.search.api import search_by_pid
|
|
14
|
-
from invenio_pidstore.errors import
|
|
15
|
-
PersistentIdentifierError,
|
|
16
|
-
PIDDoesNotExistError,
|
|
17
|
-
)
|
|
14
|
+
from invenio_pidstore.errors import PersistentIdentifierError, PIDDoesNotExistError
|
|
18
15
|
from invenio_pidstore.models import PIDStatus
|
|
19
16
|
from invenio_pidstore.providers.recordid_v2 import RecordIdProviderV2
|
|
20
17
|
|
|
@@ -82,9 +79,7 @@ class ItemValidator(RecordValidator):
|
|
|
82
79
|
has_loans = (
|
|
83
80
|
search_by_pid(
|
|
84
81
|
item_pid=item_pid,
|
|
85
|
-
filter_states=current_app.config[
|
|
86
|
-
"CIRCULATION_STATES_LOAN_ACTIVE"
|
|
87
|
-
]
|
|
82
|
+
filter_states=current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]
|
|
88
83
|
+ current_app.config["CIRCULATION_STATES_LOAN_COMPLETED"]
|
|
89
84
|
+ current_app.config["CIRCULATION_STATES_LOAN_CANCELLED"],
|
|
90
85
|
).count()
|
|
@@ -113,17 +108,13 @@ class Item(IlsRecord):
|
|
|
113
108
|
"""Item record class."""
|
|
114
109
|
|
|
115
110
|
_pid_type = ITEM_PID_TYPE
|
|
116
|
-
_schema = "items/item-
|
|
111
|
+
_schema = "items/item-v2.0.0.json"
|
|
117
112
|
_validator = ItemValidator()
|
|
118
|
-
_loan_resolver_path =
|
|
119
|
-
"{scheme}://{host}/api/resolver/items/{item_pid}/loan"
|
|
120
|
-
)
|
|
113
|
+
_loan_resolver_path = "{scheme}://{host}/api/resolver/items/{item_pid}/loan"
|
|
121
114
|
_internal_location_resolver_path = (
|
|
122
115
|
"{scheme}://{host}/api/resolver/items/{item_pid}/internal-location"
|
|
123
116
|
)
|
|
124
|
-
_document_resolver_path =
|
|
125
|
-
"{scheme}://{host}/api/resolver/items/{item_pid}/document"
|
|
126
|
-
)
|
|
117
|
+
_document_resolver_path = "{scheme}://{host}/api/resolver/items/{item_pid}/document"
|
|
127
118
|
STATUSES = [
|
|
128
119
|
"CAN_CIRCULATE",
|
|
129
120
|
"FOR_REFERENCE_ONLY",
|
|
@@ -169,15 +160,27 @@ class Item(IlsRecord):
|
|
|
169
160
|
)
|
|
170
161
|
}
|
|
171
162
|
|
|
163
|
+
@classmethod
|
|
164
|
+
def enforce_constraints(cls, data, **kwargs):
|
|
165
|
+
"""Enforce constraints.
|
|
166
|
+
|
|
167
|
+
:param data (dict): dict that can be mutated to enforce constraints.
|
|
168
|
+
"""
|
|
169
|
+
# barcode is a required field and it should be always uppercase
|
|
170
|
+
data["barcode"] = data["barcode"].upper()
|
|
171
|
+
|
|
172
172
|
@classmethod
|
|
173
173
|
def create(cls, data, id_=None, **kwargs):
|
|
174
174
|
"""Create Item record."""
|
|
175
175
|
cls.build_resolver_fields(data)
|
|
176
|
-
|
|
176
|
+
cls.enforce_constraints(data, **kwargs)
|
|
177
|
+
created = super().create(data, id_=id_, **kwargs)
|
|
178
|
+
return created
|
|
177
179
|
|
|
178
180
|
def update(self, *args, **kwargs):
|
|
179
181
|
"""Update Item record."""
|
|
180
182
|
super().update(*args, **kwargs)
|
|
183
|
+
self.enforce_constraints(self)
|
|
181
184
|
self.build_resolver_fields(self)
|
|
182
185
|
|
|
183
186
|
def delete(self, **kwargs):
|
invenio_app_ils/items/indexer.py
CHANGED
|
@@ -34,9 +34,7 @@ def index_referenced_records(item):
|
|
|
34
34
|
document_pid = item["document_pid"]
|
|
35
35
|
for loan in search_loans_by_pid(document_pid=document_pid).scan():
|
|
36
36
|
loan = loan_record_cls.get_record_by_pid(loan["pid"])
|
|
37
|
-
referenced.append(
|
|
38
|
-
dict(pid_type=CIRCULATION_LOAN_PID_TYPE, record=loan)
|
|
39
|
-
)
|
|
37
|
+
referenced.append(dict(pid_type=CIRCULATION_LOAN_PID_TYPE, record=loan))
|
|
40
38
|
|
|
41
39
|
# fetch and index the document
|
|
42
40
|
document_cls = current_app_ils.document_record_cls
|