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
invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/update_dates.html
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% block title %}
|
|
2
|
+
InvenioILS: loan dates changed for "{{ document.title|safe }}"
|
|
3
|
+
{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block body_plain %}
|
|
6
|
+
Dear {{ patron.name }},
|
|
7
|
+
|
|
8
|
+
The dates of your loan for "{{ document.full_title }}" <{{ spa_routes.HOST }}{{ spa_routes.PATHS['literature']|format(pid=document.pid) }}> have been changed.
|
|
9
|
+
|
|
10
|
+
The new dates are {{ loan.start_date }} to {{ loan.end_date }}.
|
|
11
|
+
{% endblock %}
|
|
12
|
+
|
|
13
|
+
{% block body_html %}
|
|
14
|
+
Dear {{ patron.name }}, <br/><br/>
|
|
15
|
+
|
|
16
|
+
The dates of your loan for <a href="{{ spa_routes.HOST }}{{ spa_routes.PATHS['literature']|format(pid=document.pid) }}">"{{ document.full_title }}"</a> have been <b>changed</b>. <br/>
|
|
17
|
+
|
|
18
|
+
The new dates are <b>{{ loan.start_date }}</b> to <b>{{ loan.end_date }}</b>.<br/>
|
|
19
|
+
{% endblock %}
|
|
@@ -20,11 +20,13 @@ from invenio_app_ils.proxies import current_app_ils
|
|
|
20
20
|
def circulation_build_item_ref(loan_pid, loan):
|
|
21
21
|
"""Build $ref for the Item attached to the Loan."""
|
|
22
22
|
return {
|
|
23
|
-
"$ref":
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
"$ref": (
|
|
24
|
+
"{scheme}://{host}/api/resolver/circulation/loans/{loan_pid}/"
|
|
25
|
+
"item".format(
|
|
26
|
+
scheme=current_app.config["JSONSCHEMAS_URL_SCHEME"],
|
|
27
|
+
host=current_app.config["JSONSCHEMAS_HOST"],
|
|
28
|
+
loan_pid=loan_pid,
|
|
29
|
+
)
|
|
28
30
|
)
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -32,11 +34,13 @@ def circulation_build_item_ref(loan_pid, loan):
|
|
|
32
34
|
def circulation_build_patron_ref(loan_pid, loan):
|
|
33
35
|
"""Build $ref for the Patron of the Loan."""
|
|
34
36
|
return {
|
|
35
|
-
"$ref":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
"$ref": (
|
|
38
|
+
"{scheme}://{host}/api/resolver/circulation/loans/{loan_pid}/"
|
|
39
|
+
"patron".format(
|
|
40
|
+
scheme=current_app.config["JSONSCHEMAS_URL_SCHEME"],
|
|
41
|
+
host=current_app.config["JSONSCHEMAS_HOST"],
|
|
42
|
+
loan_pid=loan_pid,
|
|
43
|
+
)
|
|
40
44
|
)
|
|
41
45
|
}
|
|
42
46
|
|
|
@@ -44,19 +48,21 @@ def circulation_build_patron_ref(loan_pid, loan):
|
|
|
44
48
|
def circulation_build_document_ref(loan_pid, loan):
|
|
45
49
|
"""Build $ref for the Document attached to the Loan."""
|
|
46
50
|
return {
|
|
47
|
-
"$ref":
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
"$ref": (
|
|
52
|
+
"{scheme}://{host}/api/resolver/circulation/loans/{loan_pid}/"
|
|
53
|
+
"document".format(
|
|
54
|
+
scheme=current_app.config["JSONSCHEMAS_URL_SCHEME"],
|
|
55
|
+
host=current_app.config["JSONSCHEMAS_HOST"],
|
|
56
|
+
loan_pid=loan_pid,
|
|
57
|
+
)
|
|
52
58
|
)
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
|
|
56
62
|
def circulation_default_extension_max_count(loan):
|
|
57
63
|
"""Return a default extensions max count."""
|
|
58
|
-
is_admin_or_librarian = (
|
|
59
|
-
|
|
64
|
+
is_admin_or_librarian = has_request_context() and backoffice_permission().allows(
|
|
65
|
+
g.identity
|
|
60
66
|
)
|
|
61
67
|
if is_admin_or_librarian:
|
|
62
68
|
unlimited = loan.get("extension_count", 0) + 1
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
"""Invenio App ILS Circulation views."""
|
|
9
9
|
|
|
10
|
-
from flask import Blueprint, abort
|
|
10
|
+
from flask import Blueprint, abort, request
|
|
11
11
|
from flask_login import current_user
|
|
12
12
|
from invenio_circulation.links import loan_links_factory
|
|
13
13
|
from invenio_circulation.pidstore.pids import CIRCULATION_LOAN_PID_TYPE
|
|
@@ -18,11 +18,24 @@ from invenio_rest import ContentNegotiatedMethodView
|
|
|
18
18
|
from invenio_app_ils.circulation.loaders import (
|
|
19
19
|
loan_checkout_loader,
|
|
20
20
|
loan_request_loader,
|
|
21
|
+
loan_self_checkout_loader,
|
|
21
22
|
loan_update_dates_loader,
|
|
22
23
|
loans_bulk_update_loader,
|
|
23
24
|
)
|
|
24
25
|
from invenio_app_ils.circulation.utils import circulation_overdue_loan_days
|
|
25
|
-
from invenio_app_ils.errors import
|
|
26
|
+
from invenio_app_ils.errors import (
|
|
27
|
+
DocumentOverbookedError,
|
|
28
|
+
ItemCannotCirculateError,
|
|
29
|
+
ItemHasActiveLoanError,
|
|
30
|
+
ItemNotFoundError,
|
|
31
|
+
LoanSelfCheckoutDocumentOverbooked,
|
|
32
|
+
LoanSelfCheckoutItemActiveLoan,
|
|
33
|
+
LoanSelfCheckoutItemInvalidStatus,
|
|
34
|
+
LoanSelfCheckoutItemNotFound,
|
|
35
|
+
MissingRequiredParameterError,
|
|
36
|
+
OverdueLoansNotificationError,
|
|
37
|
+
)
|
|
38
|
+
from invenio_app_ils.items.api import ITEM_PID_TYPE
|
|
26
39
|
from invenio_app_ils.permissions import need_permissions
|
|
27
40
|
|
|
28
41
|
from ..patrons.api import patron_exists
|
|
@@ -30,6 +43,8 @@ from .api import (
|
|
|
30
43
|
bulk_extend_loans,
|
|
31
44
|
checkout_loan,
|
|
32
45
|
request_loan,
|
|
46
|
+
self_checkout,
|
|
47
|
+
self_checkout_get_item_by_barcode,
|
|
33
48
|
update_dates_loan,
|
|
34
49
|
)
|
|
35
50
|
from .notifications.api import (
|
|
@@ -48,81 +63,97 @@ def create_circulation_blueprint(app):
|
|
|
48
63
|
url_prefix="",
|
|
49
64
|
)
|
|
50
65
|
|
|
51
|
-
|
|
52
|
-
options = endpoints.get(CIRCULATION_LOAN_PID_TYPE, {})
|
|
66
|
+
options = app.config["RECORDS_REST_ENDPOINTS"][CIRCULATION_LOAN_PID_TYPE]
|
|
53
67
|
default_media_type = options.get("default_media_type", "")
|
|
54
68
|
rec_serializers = options.get("record_serializers", {})
|
|
55
69
|
serializers = {
|
|
56
|
-
mime: obj_or_import_string(func)
|
|
57
|
-
for mime, func in rec_serializers.items()
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
bulk_loan_extension_serializers = {
|
|
61
|
-
"application/json":
|
|
62
|
-
bulk_extend_v1_response
|
|
70
|
+
mime: obj_or_import_string(func) for mime, func in rec_serializers.items()
|
|
63
71
|
}
|
|
64
72
|
|
|
73
|
+
# /request
|
|
65
74
|
loan_request = LoanRequestResource.as_view(
|
|
66
75
|
LoanRequestResource.view_name,
|
|
67
76
|
serializers=serializers,
|
|
68
77
|
default_media_type=default_media_type,
|
|
69
78
|
ctx=dict(links_factory=loan_links_factory, loader=loan_request_loader),
|
|
70
79
|
)
|
|
71
|
-
|
|
72
80
|
blueprint.add_url_rule(
|
|
73
81
|
"/circulation/loans/request", view_func=loan_request, methods=["POST"]
|
|
74
82
|
)
|
|
75
83
|
|
|
84
|
+
# /checkout
|
|
76
85
|
loan_checkout = LoanCheckoutResource.as_view(
|
|
77
86
|
LoanCheckoutResource.view_name,
|
|
78
87
|
serializers=serializers,
|
|
79
88
|
default_media_type=default_media_type,
|
|
80
|
-
ctx=dict(
|
|
81
|
-
links_factory=loan_links_factory, loader=loan_checkout_loader
|
|
82
|
-
),
|
|
89
|
+
ctx=dict(links_factory=loan_links_factory, loader=loan_checkout_loader),
|
|
83
90
|
)
|
|
84
|
-
|
|
85
91
|
blueprint.add_url_rule(
|
|
86
92
|
"/circulation/loans/checkout",
|
|
87
93
|
view_func=loan_checkout,
|
|
88
94
|
methods=["POST"],
|
|
89
95
|
)
|
|
90
96
|
|
|
97
|
+
# /self-checkout
|
|
98
|
+
item_rec_serializers = app.config["RECORDS_REST_ENDPOINTS"][ITEM_PID_TYPE].get(
|
|
99
|
+
"record_serializers", {}
|
|
100
|
+
)
|
|
101
|
+
item_serializers = {
|
|
102
|
+
mime: obj_or_import_string(func) for mime, func in item_rec_serializers.items()
|
|
103
|
+
}
|
|
104
|
+
loan_self_checkout_item = LoanSelfCheckoutResource.as_view(
|
|
105
|
+
LoanSelfCheckoutResource.view_name,
|
|
106
|
+
serializers={}, # required, even if `method_serializers` will override it
|
|
107
|
+
method_serializers={
|
|
108
|
+
"GET": item_serializers,
|
|
109
|
+
"POST": serializers, # default loan serializers
|
|
110
|
+
},
|
|
111
|
+
default_media_type=default_media_type,
|
|
112
|
+
ctx=dict(
|
|
113
|
+
loan_links_factory=loan_links_factory, loader=loan_self_checkout_loader
|
|
114
|
+
),
|
|
115
|
+
)
|
|
116
|
+
blueprint.add_url_rule(
|
|
117
|
+
"/circulation/loans/self-checkout",
|
|
118
|
+
view_func=loan_self_checkout_item,
|
|
119
|
+
methods=["GET", "POST"],
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# /notification-overdue
|
|
91
123
|
loan_notification_overdue = LoanNotificationResource.as_view(
|
|
92
124
|
LoanNotificationResource.view_name.format(CIRCULATION_LOAN_PID_TYPE),
|
|
93
125
|
serializers=serializers,
|
|
94
126
|
default_media_type=default_media_type,
|
|
95
127
|
ctx=dict(links_factory=loan_links_factory),
|
|
96
128
|
)
|
|
97
|
-
|
|
98
129
|
blueprint.add_url_rule(
|
|
99
130
|
"{0}/notification-overdue".format(options["item_route"]),
|
|
100
131
|
view_func=loan_notification_overdue,
|
|
101
132
|
methods=["POST"],
|
|
102
133
|
)
|
|
103
134
|
|
|
135
|
+
# /bulk-extend
|
|
136
|
+
bulk_loan_extension_serializers = {"application/json": bulk_extend_v1_response}
|
|
137
|
+
|
|
104
138
|
bulk_loan_extension = BulkLoanExtensionResource.as_view(
|
|
105
139
|
BulkLoanExtensionResource.view_name,
|
|
106
140
|
serializers=bulk_loan_extension_serializers,
|
|
107
141
|
default_media_type=default_media_type,
|
|
108
142
|
ctx=dict(loader=loans_bulk_update_loader),
|
|
109
143
|
)
|
|
110
|
-
|
|
111
144
|
blueprint.add_url_rule(
|
|
112
145
|
"/circulation/bulk-extend",
|
|
113
146
|
view_func=bulk_loan_extension,
|
|
114
147
|
methods=["POST"],
|
|
115
148
|
)
|
|
116
149
|
|
|
150
|
+
# /update-dates
|
|
117
151
|
loan_update = LoanUpdateDatesResource.as_view(
|
|
118
152
|
LoanUpdateDatesResource.view_name.format(CIRCULATION_LOAN_PID_TYPE),
|
|
119
153
|
serializers=serializers,
|
|
120
154
|
default_media_type=default_media_type,
|
|
121
|
-
ctx=dict(
|
|
122
|
-
links_factory=loan_links_factory, loader=loan_update_dates_loader
|
|
123
|
-
),
|
|
155
|
+
ctx=dict(links_factory=loan_links_factory, loader=loan_update_dates_loader),
|
|
124
156
|
)
|
|
125
|
-
|
|
126
157
|
blueprint.add_url_rule(
|
|
127
158
|
"{0}/update-dates".format(options["item_route"]),
|
|
128
159
|
view_func=loan_update,
|
|
@@ -153,9 +184,7 @@ class LoanRequestResource(IlsCirculationResource):
|
|
|
153
184
|
data = self.loader()
|
|
154
185
|
pid, loan = request_loan(**data)
|
|
155
186
|
|
|
156
|
-
return self.make_response(
|
|
157
|
-
pid, loan, 202, links_factory=self.links_factory
|
|
158
|
-
)
|
|
187
|
+
return self.make_response(pid, loan, 202, links_factory=self.links_factory)
|
|
159
188
|
|
|
160
189
|
|
|
161
190
|
class LoanCheckoutResource(IlsCirculationResource):
|
|
@@ -169,9 +198,51 @@ class LoanCheckoutResource(IlsCirculationResource):
|
|
|
169
198
|
data = self.loader()
|
|
170
199
|
pid, loan = checkout_loan(**data)
|
|
171
200
|
|
|
172
|
-
return self.make_response(
|
|
173
|
-
|
|
174
|
-
|
|
201
|
+
return self.make_response(pid, loan, 202, links_factory=self.links_factory)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class LoanSelfCheckoutResource(IlsCirculationResource):
|
|
205
|
+
"""Loan self-checkout action resource."""
|
|
206
|
+
|
|
207
|
+
view_name = "loan_self_checkout"
|
|
208
|
+
|
|
209
|
+
@need_permissions("circulation-loan-self-checkout")
|
|
210
|
+
def get(self, **kwargs):
|
|
211
|
+
"""Loan self-checkout GET method to retrieve items."""
|
|
212
|
+
try:
|
|
213
|
+
barcode = request.args["barcode"].upper()
|
|
214
|
+
assert barcode
|
|
215
|
+
except (KeyError, AssertionError):
|
|
216
|
+
msg = "Parameter `barcode` is missing"
|
|
217
|
+
raise MissingRequiredParameterError(description=msg)
|
|
218
|
+
|
|
219
|
+
try:
|
|
220
|
+
pid, item = self_checkout_get_item_by_barcode(barcode)
|
|
221
|
+
except ItemCannotCirculateError:
|
|
222
|
+
raise LoanSelfCheckoutItemInvalidStatus()
|
|
223
|
+
except ItemHasActiveLoanError:
|
|
224
|
+
raise LoanSelfCheckoutItemActiveLoan()
|
|
225
|
+
except DocumentOverbookedError:
|
|
226
|
+
raise LoanSelfCheckoutDocumentOverbooked()
|
|
227
|
+
except ItemNotFoundError:
|
|
228
|
+
raise LoanSelfCheckoutItemNotFound()
|
|
229
|
+
|
|
230
|
+
return self.make_response(pid, item, 200)
|
|
231
|
+
|
|
232
|
+
@need_permissions("circulation-loan-self-checkout")
|
|
233
|
+
def post(self, **kwargs):
|
|
234
|
+
"""Loan self-checkout POST method to perform the checkout."""
|
|
235
|
+
data = self.loader()
|
|
236
|
+
try:
|
|
237
|
+
pid, loan = self_checkout(**data)
|
|
238
|
+
except ItemCannotCirculateError:
|
|
239
|
+
raise LoanSelfCheckoutItemInvalidStatus()
|
|
240
|
+
except ItemHasActiveLoanError:
|
|
241
|
+
raise LoanSelfCheckoutItemActiveLoan()
|
|
242
|
+
except DocumentOverbookedError:
|
|
243
|
+
raise LoanSelfCheckoutDocumentOverbooked()
|
|
244
|
+
|
|
245
|
+
return self.make_response(pid, loan, 202, links_factory=self.loan_links_factory)
|
|
175
246
|
|
|
176
247
|
|
|
177
248
|
class BulkLoanExtensionResource(IlsCirculationResource):
|
|
@@ -190,9 +261,7 @@ class BulkLoanExtensionResource(IlsCirculationResource):
|
|
|
190
261
|
extended_loans, not_extended_loans = bulk_extend_loans(**data)
|
|
191
262
|
if extended_loans:
|
|
192
263
|
send_bulk_extend_notification(
|
|
193
|
-
extended_loans,
|
|
194
|
-
not_extended_loans,
|
|
195
|
-
patron_pid=data["patron_pid"]
|
|
264
|
+
extended_loans, not_extended_loans, patron_pid=data["patron_pid"]
|
|
196
265
|
)
|
|
197
266
|
return self.make_response(extended_loans, not_extended_loans, 202)
|
|
198
267
|
|
|
@@ -209,15 +278,12 @@ class LoanNotificationResource(IlsCirculationResource):
|
|
|
209
278
|
days_ago = circulation_overdue_loan_days(record)
|
|
210
279
|
is_overdue = days_ago > 0
|
|
211
280
|
if not is_overdue:
|
|
212
|
-
raise OverdueLoansNotificationError(
|
|
213
|
-
description="This loan is not overdue")
|
|
281
|
+
raise OverdueLoansNotificationError(description="This loan is not overdue")
|
|
214
282
|
send_loan_overdue_reminder_notification(
|
|
215
283
|
record, days_ago, is_manually_triggered=True
|
|
216
284
|
)
|
|
217
285
|
|
|
218
|
-
return self.make_response(
|
|
219
|
-
pid, record, 202, links_factory=self.links_factory
|
|
220
|
-
)
|
|
286
|
+
return self.make_response(pid, record, 202, links_factory=self.links_factory)
|
|
221
287
|
|
|
222
288
|
|
|
223
289
|
class LoanUpdateDatesResource(IlsCirculationResource):
|
|
@@ -232,6 +298,4 @@ class LoanUpdateDatesResource(IlsCirculationResource):
|
|
|
232
298
|
data = self.loader()
|
|
233
299
|
update_dates_loan(record, **data)
|
|
234
300
|
|
|
235
|
-
return self.make_response(
|
|
236
|
-
pid, record, 202, links_factory=self.links_factory
|
|
237
|
-
)
|
|
301
|
+
return self.make_response(pid, record, 202, links_factory=self.links_factory)
|