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
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2020 CERN.
|
|
4
|
-
#
|
|
5
|
-
# invenio-app-ils is free software; you can redistribute it and/or modify it
|
|
6
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
|
|
8
|
-
"""Test records relations sequence."""
|
|
9
|
-
|
|
10
|
-
import json
|
|
11
|
-
|
|
12
|
-
from flask import url_for
|
|
13
|
-
|
|
14
|
-
from tests.helpers import get_test_record, user_login
|
|
15
|
-
|
|
16
|
-
from .helpers import (
|
|
17
|
-
recrel_assert_record_relations,
|
|
18
|
-
recrel_choose_endpoints_and_do_request,
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def _test_sequence_invalid_relations_should_fail(
|
|
23
|
-
client, json_headers, invalids, status_code=400
|
|
24
|
-
):
|
|
25
|
-
"""Test relation creation with invalid link relation should fail."""
|
|
26
|
-
api_endpoint_series = "invenio_app_ils_relations.serid_relations"
|
|
27
|
-
|
|
28
|
-
for invalid in invalids:
|
|
29
|
-
next_pid_value = invalid["next_pid_value"]
|
|
30
|
-
next_pid_type = invalid["next_pid_type"]
|
|
31
|
-
previous_pid_value = invalid["previous_pid_value"]
|
|
32
|
-
previous_pid_type = invalid["previous_pid_type"]
|
|
33
|
-
relation_type = invalid["relation_type"]
|
|
34
|
-
|
|
35
|
-
url = url_for(api_endpoint_series, pid_value=next_pid_value)
|
|
36
|
-
payload = {
|
|
37
|
-
"next_pid_value": next_pid_value,
|
|
38
|
-
"next_pid_type": next_pid_type,
|
|
39
|
-
"previous_pid_value": previous_pid_value,
|
|
40
|
-
"previous_pid_type": previous_pid_type,
|
|
41
|
-
"relation_type": relation_type,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
res = client.post(url, headers=json_headers, data=json.dumps(payload))
|
|
45
|
-
assert res.status_code == status_code
|
|
46
|
-
if status_code == 400:
|
|
47
|
-
error = json.loads(res.data.decode("utf-8"))
|
|
48
|
-
assert "message" in error
|
|
49
|
-
assert next_pid_value in error["message"]
|
|
50
|
-
assert previous_pid_value in error["message"]
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def _test_sequence(client, json_headers):
|
|
54
|
-
"""Test create and delete next and previous relations."""
|
|
55
|
-
next_pid_value = "serid-2"
|
|
56
|
-
next_pid_type = "serid"
|
|
57
|
-
previous_pid_value = "serid-1"
|
|
58
|
-
previous_pid_type = "serid"
|
|
59
|
-
relation_type = "sequence"
|
|
60
|
-
|
|
61
|
-
payload = {
|
|
62
|
-
"next_pid_value": next_pid_value,
|
|
63
|
-
"next_pid_type": next_pid_type,
|
|
64
|
-
"previous_pid_value": previous_pid_value,
|
|
65
|
-
"previous_pid_type": previous_pid_type,
|
|
66
|
-
"relation_type": relation_type,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
def _test_create_sequence(create_using_pid1=True):
|
|
70
|
-
"""Test relation creation of sequence Series."""
|
|
71
|
-
|
|
72
|
-
next_rec, prev_rec = recrel_choose_endpoints_and_do_request(
|
|
73
|
-
(client, json_headers, "POST"),
|
|
74
|
-
(
|
|
75
|
-
next_pid_value,
|
|
76
|
-
next_pid_type,
|
|
77
|
-
previous_pid_value,
|
|
78
|
-
previous_pid_type,
|
|
79
|
-
),
|
|
80
|
-
payload,
|
|
81
|
-
create_using_pid1=create_using_pid1,
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
recrel_assert_record_relations(
|
|
85
|
-
next_rec,
|
|
86
|
-
expected={
|
|
87
|
-
"relations": {
|
|
88
|
-
"sequence": [
|
|
89
|
-
{
|
|
90
|
-
"pid_value": previous_pid_value,
|
|
91
|
-
"pid_type": previous_pid_type,
|
|
92
|
-
"relation_type": "sequence",
|
|
93
|
-
"relation_order": "continues",
|
|
94
|
-
"record_metadata": {
|
|
95
|
-
"title": prev_rec["title"],
|
|
96
|
-
"mode_of_issuance": prev_rec[
|
|
97
|
-
"mode_of_issuance"
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
recrel_assert_record_relations(
|
|
107
|
-
prev_rec,
|
|
108
|
-
expected={
|
|
109
|
-
"relations": {
|
|
110
|
-
"sequence": [
|
|
111
|
-
{
|
|
112
|
-
"pid_value": next_pid_value,
|
|
113
|
-
"pid_type": next_pid_type,
|
|
114
|
-
"relation_type": "sequence",
|
|
115
|
-
"relation_order": "is_continued_by",
|
|
116
|
-
"record_metadata": {
|
|
117
|
-
"title": next_rec["title"],
|
|
118
|
-
"mode_of_issuance": next_rec[
|
|
119
|
-
"mode_of_issuance"
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
def _test_delete_sequence(create_using_pid1=True):
|
|
129
|
-
"""Test deletion of sequence relation."""
|
|
130
|
-
|
|
131
|
-
next_rec, prev_rec = recrel_choose_endpoints_and_do_request(
|
|
132
|
-
(client, json_headers, "DELETE"),
|
|
133
|
-
(
|
|
134
|
-
next_pid_value,
|
|
135
|
-
next_pid_type,
|
|
136
|
-
previous_pid_value,
|
|
137
|
-
previous_pid_type,
|
|
138
|
-
),
|
|
139
|
-
payload,
|
|
140
|
-
create_using_pid1=create_using_pid1,
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
recrel_assert_record_relations(next_rec, expected={"relations": {}})
|
|
144
|
-
recrel_assert_record_relations(prev_rec, expected={"relations": {}})
|
|
145
|
-
|
|
146
|
-
_test_create_sequence()
|
|
147
|
-
_test_delete_sequence()
|
|
148
|
-
_test_create_sequence(create_using_pid1=False)
|
|
149
|
-
_test_delete_sequence(create_using_pid1=False)
|
|
150
|
-
# recreate for the next one, to have some more valuable test data
|
|
151
|
-
_test_create_sequence()
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
def _test_split_sequence(client, json_headers, testdata):
|
|
155
|
-
"""Test create split next relations."""
|
|
156
|
-
next_pid_type = "serid"
|
|
157
|
-
previous_pid_value = "serid-2"
|
|
158
|
-
previous_pid_type = "serid"
|
|
159
|
-
relation_type = "sequence"
|
|
160
|
-
|
|
161
|
-
payload = {
|
|
162
|
-
"next_pid_type": next_pid_type,
|
|
163
|
-
"previous_pid_value": previous_pid_value,
|
|
164
|
-
"previous_pid_type": previous_pid_type,
|
|
165
|
-
"relation_type": relation_type,
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
# serid-1 from previous test
|
|
169
|
-
rec_serid_1 = get_test_record(testdata, "series", "serid-1")
|
|
170
|
-
serid_1 = {
|
|
171
|
-
"pid_value": "serid-1",
|
|
172
|
-
"pid_type": "serid",
|
|
173
|
-
"relation_type": "sequence",
|
|
174
|
-
"relation_order": "continues",
|
|
175
|
-
"record_metadata": {
|
|
176
|
-
"title": rec_serid_1["title"],
|
|
177
|
-
"mode_of_issuance": rec_serid_1["mode_of_issuance"],
|
|
178
|
-
},
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
def _test_create_split_sequence(create_using_pid1=True):
|
|
182
|
-
"""Test relation creation for split sequence."""
|
|
183
|
-
pid_values = ["serid-3", "serid-4"]
|
|
184
|
-
second_records = []
|
|
185
|
-
|
|
186
|
-
for pid_value in pid_values:
|
|
187
|
-
next_pid_value = pid_value
|
|
188
|
-
payload["next_pid_value"] = pid_value
|
|
189
|
-
next_rec, prev_rec = recrel_choose_endpoints_and_do_request(
|
|
190
|
-
(client, json_headers, "POST"),
|
|
191
|
-
(
|
|
192
|
-
pid_value,
|
|
193
|
-
next_pid_type,
|
|
194
|
-
previous_pid_value,
|
|
195
|
-
previous_pid_type,
|
|
196
|
-
),
|
|
197
|
-
payload,
|
|
198
|
-
create_using_pid1=create_using_pid1,
|
|
199
|
-
)
|
|
200
|
-
second_records.append(
|
|
201
|
-
{
|
|
202
|
-
"pid_value": next_pid_value,
|
|
203
|
-
"pid_type": next_pid_type,
|
|
204
|
-
"relation_type": "sequence",
|
|
205
|
-
"relation_order": "is_continued_by",
|
|
206
|
-
"record_metadata": {
|
|
207
|
-
"title": next_rec["title"],
|
|
208
|
-
"mode_of_issuance": next_rec["mode_of_issuance"],
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
# serid-2
|
|
214
|
-
recrel_assert_record_relations(
|
|
215
|
-
prev_rec,
|
|
216
|
-
expected={
|
|
217
|
-
"relations": {"sequence": second_records + [serid_1]}
|
|
218
|
-
},
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
# serid-3 and serid-4
|
|
222
|
-
recrel_assert_record_relations(
|
|
223
|
-
next_rec,
|
|
224
|
-
expected={
|
|
225
|
-
"relations": {
|
|
226
|
-
"sequence": [
|
|
227
|
-
{
|
|
228
|
-
"pid_value": previous_pid_value,
|
|
229
|
-
"pid_type": previous_pid_type,
|
|
230
|
-
"relation_type": "sequence",
|
|
231
|
-
"relation_order": "continues",
|
|
232
|
-
"record_metadata": {
|
|
233
|
-
"title": prev_rec["title"],
|
|
234
|
-
"mode_of_issuance": prev_rec[
|
|
235
|
-
"mode_of_issuance"
|
|
236
|
-
],
|
|
237
|
-
},
|
|
238
|
-
}
|
|
239
|
-
]
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
)
|
|
243
|
-
|
|
244
|
-
_test_create_split_sequence()
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
def test_sequence_relations(client, json_headers, testdata, users):
|
|
248
|
-
"""Test sequence relations."""
|
|
249
|
-
|
|
250
|
-
_test_sequence_invalid_relations_should_fail(
|
|
251
|
-
client,
|
|
252
|
-
json_headers,
|
|
253
|
-
[
|
|
254
|
-
{
|
|
255
|
-
"next_pid_value": "serid-1",
|
|
256
|
-
"next_pid_type": "serid",
|
|
257
|
-
"previous_pid_value": "serid-1",
|
|
258
|
-
"previous_pid_type": "serid",
|
|
259
|
-
"relation_type": "sequence",
|
|
260
|
-
}
|
|
261
|
-
],
|
|
262
|
-
status_code=401,
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
user_login(client, "librarian", users)
|
|
266
|
-
|
|
267
|
-
# serid-1 -> serid-2 (serid-1 is the previous of serid-2)
|
|
268
|
-
_test_sequence(client, json_headers)
|
|
269
|
-
|
|
270
|
-
# serid-4
|
|
271
|
-
# serid-2 (serid-2 is the previous) ->
|
|
272
|
-
# serid-3
|
|
273
|
-
_test_split_sequence(client, json_headers, testdata)
|
|
274
|
-
|
|
275
|
-
invalids = [
|
|
276
|
-
{
|
|
277
|
-
"next_pid_value": "serid-1",
|
|
278
|
-
"next_pid_type": "serid",
|
|
279
|
-
"previous_pid_value": "serid-1",
|
|
280
|
-
"previous_pid_type": "serid",
|
|
281
|
-
"relation_type": "sequence",
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"next_pid_value": "serid-1",
|
|
285
|
-
"next_pid_type": "serid",
|
|
286
|
-
"previous_pid_value": "docid-1",
|
|
287
|
-
"previous_pid_type": "docid",
|
|
288
|
-
"relation_type": "sequence",
|
|
289
|
-
},
|
|
290
|
-
# enable this test when the endpoint will be changed to a generic
|
|
291
|
-
# relations endpoint and not for series only
|
|
292
|
-
# {
|
|
293
|
-
# "next_pid_value": "docid-1",
|
|
294
|
-
# "next_pid_type": "docid",
|
|
295
|
-
# "previous_pid_value": "docid-2",
|
|
296
|
-
# "previous_pid_type": "docid",
|
|
297
|
-
# "relation_type": "sequence",
|
|
298
|
-
# }
|
|
299
|
-
]
|
|
300
|
-
_test_sequence_invalid_relations_should_fail(
|
|
301
|
-
client, json_headers, invalids, status_code=400
|
|
302
|
-
)
|