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.
Files changed (331) hide show
  1. invenio_app_ils/__init__.py +2 -2
  2. invenio_app_ils/acquisition/api.py +3 -1
  3. invenio_app_ils/acquisition/config.py +10 -21
  4. invenio_app_ils/acquisition/jsonresolvers/order_order_lines.py +1 -0
  5. invenio_app_ils/acquisition/mappings/os-v1/acq_orders/order-v1.0.0.json +364 -0
  6. invenio_app_ils/acquisition/mappings/os-v2/__init__.py +0 -0
  7. invenio_app_ils/acquisition/mappings/os-v2/acq_orders/order-v1.0.0.json +364 -0
  8. invenio_app_ils/acquisition/mappings/v7/acq_orders/order-v1.0.0.json +14 -0
  9. invenio_app_ils/acquisition/search.py +5 -15
  10. invenio_app_ils/assets/semantic-ui/less/theme.config +103 -0
  11. invenio_app_ils/assets/semantic-ui/templates/.gitkeep +0 -0
  12. invenio_app_ils/circulation/api.py +153 -67
  13. invenio_app_ils/circulation/config.py +29 -25
  14. invenio_app_ils/circulation/indexer.py +14 -19
  15. invenio_app_ils/circulation/loaders/__init__.py +2 -0
  16. invenio_app_ils/circulation/loaders/schemas/json/loan_checkout.py +2 -3
  17. invenio_app_ils/circulation/loaders/schemas/json/loan_request.py +82 -16
  18. invenio_app_ils/circulation/loaders/schemas/json/loan_self_checkout.py +19 -0
  19. invenio_app_ils/circulation/notifications/api.py +23 -19
  20. invenio_app_ils/circulation/notifications/messages.py +6 -6
  21. invenio_app_ils/circulation/notifications/tasks.py +1 -2
  22. invenio_app_ils/circulation/receivers.py +2 -5
  23. invenio_app_ils/circulation/search.py +23 -22
  24. invenio_app_ils/circulation/serializers/__init__.py +2 -2
  25. invenio_app_ils/circulation/serializers/csv.py +1 -3
  26. invenio_app_ils/circulation/serializers/custom_fields.py +5 -9
  27. invenio_app_ils/circulation/serializers/json.py +2 -6
  28. invenio_app_ils/circulation/serializers/response.py +12 -12
  29. invenio_app_ils/circulation/stats/views.py +5 -15
  30. invenio_app_ils/circulation/tasks.py +2 -6
  31. invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/self_checkout.html +19 -0
  32. invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/update_dates.html +19 -0
  33. invenio_app_ils/circulation/utils.py +23 -17
  34. invenio_app_ils/circulation/views.py +103 -39
  35. invenio_app_ils/cli.py +220 -260
  36. invenio_app_ils/closures/api.py +72 -7
  37. invenio_app_ils/closures/serializers/__init__.py +16 -0
  38. invenio_app_ils/closures/serializers/response.py +35 -0
  39. invenio_app_ils/closures/serializers/schema.py +28 -0
  40. invenio_app_ils/closures/tasks.py +4 -11
  41. invenio_app_ils/closures/views.py +66 -0
  42. invenio_app_ils/config.py +207 -150
  43. invenio_app_ils/document_requests/api.py +6 -21
  44. invenio_app_ils/document_requests/loaders/__init__.py +4 -12
  45. invenio_app_ils/document_requests/mappings/{v6 → os-v1}/__init__.py +2 -2
  46. invenio_app_ils/document_requests/mappings/os-v1/document_requests/document_request-v1.0.0.json +196 -0
  47. invenio_app_ils/document_requests/mappings/os-v2/__init__.py +8 -0
  48. invenio_app_ils/document_requests/mappings/os-v2/document_requests/document_request-v1.0.0.json +196 -0
  49. invenio_app_ils/document_requests/notifications/api.py +2 -7
  50. invenio_app_ils/document_requests/notifications/messages.py +3 -7
  51. invenio_app_ils/document_requests/search.py +2 -6
  52. invenio_app_ils/document_requests/views.py +4 -10
  53. invenio_app_ils/documents/api.py +19 -25
  54. invenio_app_ils/documents/indexer.py +13 -20
  55. invenio_app_ils/documents/jsonresolvers/document_circulation.py +11 -33
  56. invenio_app_ils/documents/jsonresolvers/document_eitem.py +1 -0
  57. invenio_app_ils/documents/jsonresolvers/document_item.py +8 -9
  58. invenio_app_ils/documents/jsonresolvers/document_stock.py +7 -7
  59. invenio_app_ils/documents/loaders/jsonschemas/document.py +3 -14
  60. invenio_app_ils/documents/mappings/{v6 → os-v1}/__init__.py +1 -1
  61. invenio_app_ils/documents/mappings/os-v1/documents/document-v1.0.0.json +932 -0
  62. invenio_app_ils/documents/mappings/os-v1/documents/document-v2.0.0.json +1066 -0
  63. invenio_app_ils/documents/mappings/os-v2/__init__.py +8 -0
  64. invenio_app_ils/documents/mappings/os-v2/documents/document-v1.0.0.json +932 -0
  65. invenio_app_ils/documents/mappings/os-v2/documents/document-v2.0.0.json +1066 -0
  66. invenio_app_ils/documents/mappings/v7/documents/document-v1.0.0.json +102 -11
  67. invenio_app_ils/documents/mappings/v7/documents/document-v2.0.0.json +1066 -0
  68. invenio_app_ils/documents/schemas/documents/document-v2.0.0.json +732 -0
  69. invenio_app_ils/eitems/api.py +41 -7
  70. invenio_app_ils/eitems/loaders/jsonschemas/eitems.py +6 -6
  71. invenio_app_ils/eitems/mappings/{v6 → os-v1}/__init__.py +1 -1
  72. invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v1.0.0.json +139 -0
  73. invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v2.0.0.json +142 -0
  74. invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v3.0.0.json +179 -0
  75. invenio_app_ils/{series/mappings/v6 → eitems/mappings/os-v2}/__init__.py +1 -1
  76. invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v1.0.0.json +139 -0
  77. invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v2.0.0.json +142 -0
  78. invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v3.0.0.json +179 -0
  79. invenio_app_ils/eitems/mappings/v7/eitems/eitem-v1.0.0.json +12 -2
  80. invenio_app_ils/eitems/mappings/v7/eitems/eitem-v2.0.0.json +142 -0
  81. invenio_app_ils/eitems/mappings/v7/eitems/eitem-v3.0.0.json +179 -0
  82. invenio_app_ils/eitems/schemas/eitems/eitem-v2.0.0.json +120 -0
  83. invenio_app_ils/eitems/schemas/eitems/eitem-v3.0.0.json +120 -0
  84. invenio_app_ils/eitems/search.py +3 -9
  85. invenio_app_ils/errors.py +119 -6
  86. invenio_app_ils/ext.py +15 -18
  87. invenio_app_ils/facets.py +13 -15
  88. invenio_app_ils/files/receivers.py +1 -1
  89. invenio_app_ils/files/views.py +1 -2
  90. invenio_app_ils/ill/api.py +1 -2
  91. invenio_app_ils/ill/config.py +10 -16
  92. invenio_app_ils/ill/jsonresolvers/borrowing_request_document.py +2 -3
  93. invenio_app_ils/ill/jsonresolvers/borrowing_request_patron.py +1 -3
  94. invenio_app_ils/ill/jsonresolvers/borrowing_request_provider.py +1 -3
  95. invenio_app_ils/ill/loaders/__init__.py +3 -9
  96. invenio_app_ils/ill/loaders/jsonschemas/patron_loan_actions.py +1 -8
  97. invenio_app_ils/ill/loaders/jsonschemas/patron_loan_extension_actions.py +3 -8
  98. invenio_app_ils/ill/mappings/{v6 → os-v1}/__init__.py +1 -1
  99. invenio_app_ils/ill/mappings/os-v1/ill_borrowing_requests/borrowing_request-v1.0.0.json +254 -0
  100. invenio_app_ils/{acquisition/mappings/v6 → ill/mappings/os-v2}/__init__.py +1 -1
  101. invenio_app_ils/ill/mappings/os-v2/ill_borrowing_requests/borrowing_request-v1.0.0.json +254 -0
  102. invenio_app_ils/ill/mappings/v7/ill_borrowing_requests/borrowing_request-v1.0.0.json +14 -0
  103. invenio_app_ils/ill/notifications/api.py +1 -4
  104. invenio_app_ils/ill/search.py +3 -9
  105. invenio_app_ils/ill/serializers/__init__.py +1 -3
  106. invenio_app_ils/ill/views.py +2 -4
  107. invenio_app_ils/internal_locations/api.py +1 -4
  108. invenio_app_ils/internal_locations/mappings/{v6 → os-v1}/__init__.py +1 -1
  109. invenio_app_ils/internal_locations/mappings/os-v1/internal_locations/internal_location-v1.0.0.json +108 -0
  110. invenio_app_ils/internal_locations/mappings/os-v2/__init__.py +8 -0
  111. invenio_app_ils/internal_locations/mappings/os-v2/internal_locations/internal_location-v1.0.0.json +108 -0
  112. invenio_app_ils/internal_locations/search.py +1 -3
  113. invenio_app_ils/items/api.py +18 -15
  114. invenio_app_ils/items/indexer.py +1 -3
  115. invenio_app_ils/items/jsonresolvers/item_document.py +1 -1
  116. invenio_app_ils/items/jsonresolvers/item_internal_location.py +2 -6
  117. invenio_app_ils/items/loaders/jsonschemas/items.py +2 -0
  118. {tests/api/circulation → invenio_app_ils/items/mappings/os-v1}/__init__.py +1 -1
  119. invenio_app_ils/items/mappings/os-v1/items/item-v1.0.0.json +285 -0
  120. invenio_app_ils/items/mappings/os-v1/items/item-v2.0.0.json +326 -0
  121. {tests/api/ill → invenio_app_ils/items/mappings/os-v2}/__init__.py +1 -1
  122. invenio_app_ils/items/mappings/os-v2/items/item-v1.0.0.json +285 -0
  123. invenio_app_ils/items/mappings/os-v2/items/item-v2.0.0.json +326 -0
  124. invenio_app_ils/items/mappings/v7/items/item-v1.0.0.json +11 -0
  125. invenio_app_ils/items/mappings/v7/items/item-v2.0.0.json +326 -0
  126. invenio_app_ils/items/schemas/items/item-v1.0.0.json +22 -0
  127. invenio_app_ils/items/schemas/items/item-v2.0.0.json +172 -0
  128. invenio_app_ils/items/search.py +18 -11
  129. invenio_app_ils/items/serializers/item.py +7 -6
  130. invenio_app_ils/literature/api.py +1 -3
  131. invenio_app_ils/literature/search.py +3 -5
  132. invenio_app_ils/literature/serializers/csv.py +1 -3
  133. invenio_app_ils/literature/serializers/json.py +1 -3
  134. invenio_app_ils/locations/api.py +2 -4
  135. invenio_app_ils/locations/indexer.py +3 -9
  136. invenio_app_ils/locations/loaders/__init__.py +1 -3
  137. invenio_app_ils/locations/loaders/jsonschemas/location.py +4 -11
  138. invenio_app_ils/locations/mappings/{v6 → os-v1}/__init__.py +1 -1
  139. invenio_app_ils/locations/mappings/os-v1/locations/location-v1.0.0.json +90 -0
  140. invenio_app_ils/locations/mappings/os-v2/__init__.py +8 -0
  141. invenio_app_ils/locations/mappings/os-v2/locations/location-v1.0.0.json +90 -0
  142. invenio_app_ils/notifications/messages.py +4 -3
  143. invenio_app_ils/notifications/tasks.py +1 -3
  144. invenio_app_ils/notifications/views.py +2 -2
  145. invenio_app_ils/patrons/anonymization.py +53 -32
  146. invenio_app_ils/patrons/api.py +3 -5
  147. invenio_app_ils/patrons/cli.py +1 -2
  148. invenio_app_ils/patrons/indexer.py +4 -13
  149. invenio_app_ils/patrons/mappings/os-v1/__init__.py +8 -0
  150. invenio_app_ils/patrons/mappings/os-v1/patrons/patron-v1.0.0.json +42 -0
  151. invenio_app_ils/patrons/mappings/os-v2/__init__.py +8 -0
  152. invenio_app_ils/patrons/mappings/os-v2/patrons/patron-v1.0.0.json +42 -0
  153. invenio_app_ils/patrons/views.py +4 -14
  154. invenio_app_ils/permissions.py +93 -35
  155. invenio_app_ils/providers/api.py +2 -6
  156. invenio_app_ils/providers/config.py +11 -19
  157. invenio_app_ils/providers/indexer.py +2 -6
  158. invenio_app_ils/providers/mappings/{v6 → os-v1}/__init__.py +1 -1
  159. invenio_app_ils/providers/mappings/os-v1/providers/provider-v1.0.0.json +57 -0
  160. invenio_app_ils/providers/mappings/os-v2/__init__.py +8 -0
  161. invenio_app_ils/providers/mappings/os-v2/providers/provider-v1.0.0.json +57 -0
  162. invenio_app_ils/providers/mappings/v7/__init__.py +1 -1
  163. invenio_app_ils/providers/proxies.py +1 -3
  164. invenio_app_ils/records/api.py +3 -9
  165. invenio_app_ils/records/loaders/schemas/changed_by.py +1 -3
  166. invenio_app_ils/records/loaders/schemas/identifiers.py +23 -0
  167. invenio_app_ils/records/metadata_extensions.py +1 -4
  168. invenio_app_ils/records/permissions.py +8 -2
  169. invenio_app_ils/records/serializers/__init__.py +1 -4
  170. invenio_app_ils/records/views.py +4 -7
  171. invenio_app_ils/records_relations/api.py +11 -34
  172. invenio_app_ils/records_relations/indexer.py +1 -3
  173. invenio_app_ils/records_relations/retriever.py +14 -9
  174. invenio_app_ils/records_relations/views.py +16 -50
  175. invenio_app_ils/relations/api.py +17 -16
  176. invenio_app_ils/search_permissions.py +24 -24
  177. invenio_app_ils/series/api.py +10 -12
  178. invenio_app_ils/series/loaders/jsonschemas/series.py +3 -2
  179. invenio_app_ils/{items/mappings/v6 → series/mappings/os-v1}/__init__.py +1 -1
  180. invenio_app_ils/series/mappings/os-v1/series/series-v1.0.0.json +324 -0
  181. invenio_app_ils/series/mappings/os-v1/series/series-v2.0.0.json +396 -0
  182. {tests/api/acquisition → invenio_app_ils/series/mappings/os-v2}/__init__.py +1 -1
  183. invenio_app_ils/series/mappings/os-v2/series/series-v1.0.0.json +324 -0
  184. invenio_app_ils/series/mappings/os-v2/series/series-v2.0.0.json +396 -0
  185. invenio_app_ils/series/mappings/v7/series/series-v1.0.0.json +35 -3
  186. invenio_app_ils/series/mappings/v7/series/series-v2.0.0.json +396 -0
  187. invenio_app_ils/series/schemas/series/series-v2.0.0.json +354 -0
  188. invenio_app_ils/stats/aggregations/aggr_file_download/os-v1/aggr-file-download-v1.json +60 -0
  189. invenio_app_ils/stats/aggregations/aggr_file_download/os-v2/__init__.py +9 -0
  190. invenio_app_ils/stats/aggregations/aggr_file_download/os-v2/aggr-file-download-v1.json +60 -0
  191. invenio_app_ils/stats/event_builders.py +73 -0
  192. invenio_app_ils/stats/file_download/os-v1/file-download-v1.json +72 -0
  193. invenio_app_ils/stats/file_download/os-v2/__init__.py +9 -0
  194. invenio_app_ils/stats/file_download/os-v2/file-download-v1.json +72 -0
  195. invenio_app_ils/stats/processors.py +30 -0
  196. invenio_app_ils/stats/templates/aggregations/__init__.py +8 -0
  197. invenio_app_ils/stats/templates/aggregations/ils_record_changes/__init__.py +8 -0
  198. invenio_app_ils/stats/templates/aggregations/ils_record_changes/os-v2/__init__.py +8 -0
  199. invenio_app_ils/stats/templates/aggregations/ils_record_changes/os-v2/aggr-ils-record-changes-v1.json +41 -0
  200. {tests → invenio_app_ils/stats/templates/events}/__init__.py +2 -2
  201. invenio_app_ils/stats/templates/events/ils_record_changes/__init__.py +8 -0
  202. invenio_app_ils/stats/templates/events/ils_record_changes/os-v2/__init__.py +8 -0
  203. invenio_app_ils/stats/templates/events/ils_record_changes/os-v2/ils-record-changes-v1.json +41 -0
  204. invenio_app_ils/templates/logged_out.html +12 -0
  205. invenio_app_ils/views.py +18 -4
  206. invenio_app_ils/vocabularies/api.py +1 -1
  207. invenio_app_ils/vocabularies/cli.py +6 -18
  208. invenio_app_ils/vocabularies/data/acq_order_line_payment_modes.json +5 -0
  209. invenio_app_ils/vocabularies/data/identifier_schemes.json +5 -0
  210. invenio_app_ils/vocabularies/indexer.py +1 -4
  211. invenio_app_ils/vocabularies/jsonresolvers/licenses.py +2 -11
  212. invenio_app_ils/vocabularies/mappings/os-v1/__init__.py +8 -0
  213. invenio_app_ils/vocabularies/mappings/os-v1/vocabularies/vocabulary-v1.0.0.json +23 -0
  214. invenio_app_ils/vocabularies/mappings/os-v2/__init__.py +8 -0
  215. invenio_app_ils/vocabularies/mappings/os-v2/vocabularies/vocabulary-v1.0.0.json +23 -0
  216. invenio_app_ils/vocabularies/sources/base.py +1 -3
  217. invenio_app_ils/webpack.py +27 -0
  218. invenio_app_ils-6.1.0.dist-info/METADATA +627 -0
  219. {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/RECORD +227 -249
  220. {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/WHEEL +1 -1
  221. {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/entry_points.txt +9 -5
  222. {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/top_level.txt +0 -1
  223. invenio_app_ils/acquisition/mappings/v6/acq_orders/order-v1.0.0.json +0 -352
  224. invenio_app_ils/document_requests/mappings/v6/document_requests/document_request-v1.0.0.json +0 -199
  225. invenio_app_ils/documents/mappings/v6/documents/document-v1.0.0.json +0 -843
  226. invenio_app_ils/eitems/mappings/v6/eitems/eitem-v1.0.0.json +0 -131
  227. invenio_app_ils/ill/mappings/v6/ill_borrowing_requests/borrowing_request-v1.0.0.json +0 -242
  228. invenio_app_ils/internal_locations/mappings/v6/internal_locations/internal_location-v1.0.0.json +0 -110
  229. invenio_app_ils/items/mappings/v6/items/item-v1.0.0.json +0 -276
  230. invenio_app_ils/locations/mappings/v6/locations/location-v1.0.0.json +0 -92
  231. invenio_app_ils/notifications/admin.py +0 -57
  232. invenio_app_ils/patrons/mappings/v6/__init__.py +0 -8
  233. invenio_app_ils/patrons/mappings/v6/patrons/patron-v1.0.0.json +0 -44
  234. invenio_app_ils/providers/mappings/v6/providers/provider-v1.0.0.json +0 -59
  235. invenio_app_ils/series/mappings/v6/series/series-v1.0.0.json +0 -298
  236. invenio_app_ils/stats/aggregations/aggr_file_download/v6/aggr-file-download-v1.json +0 -59
  237. invenio_app_ils/stats/file_download/v6/file-download-v1.json +0 -74
  238. invenio_app_ils/version.py +0 -14
  239. invenio_app_ils/vocabularies/mappings/v6/__init__.py +0 -8
  240. invenio_app_ils/vocabularies/mappings/v6/vocabularies/vocabulary-v1.0.0.json +0 -25
  241. invenio_app_ils-1.0.0a54.dist-info/METADATA +0 -95
  242. tests/api/__init__.py +0 -8
  243. tests/api/acquisition/test_acq_orders_crud.py +0 -102
  244. tests/api/acquisition/test_acq_orders_permissions.py +0 -104
  245. tests/api/acquisition/test_acq_providers_permissions.py +0 -83
  246. tests/api/circulation/test_expired_loans.py +0 -88
  247. tests/api/circulation/test_loan_checkout.py +0 -216
  248. tests/api/circulation/test_loan_default_durations.py +0 -57
  249. tests/api/circulation/test_loan_document_resolver.py +0 -18
  250. tests/api/circulation/test_loan_extend.py +0 -132
  251. tests/api/circulation/test_loan_item_permissions.py +0 -139
  252. tests/api/circulation/test_loan_item_resolver.py +0 -26
  253. tests/api/circulation/test_loan_list_permissions.py +0 -104
  254. tests/api/circulation/test_loan_patron_resolver.py +0 -38
  255. tests/api/circulation/test_loan_request.py +0 -234
  256. tests/api/circulation/test_loan_update.py +0 -150
  257. tests/api/circulation/test_notifications.py +0 -229
  258. tests/api/conftest.py +0 -236
  259. tests/api/document_requests/__init__.py +0 -8
  260. tests/api/document_requests/test_document_requests.py +0 -131
  261. tests/api/document_requests/test_document_requests_permissions.py +0 -177
  262. tests/api/document_requests/test_notifications_filter.py +0 -36
  263. tests/api/ill/test_ill_brw_crud.py +0 -84
  264. tests/api/ill/test_ill_brw_reqs_patron_loan_create_action.py +0 -207
  265. tests/api/ill/test_ill_brw_reqs_patron_loan_extension_actions.py +0 -298
  266. tests/api/ill/test_ill_brw_reqs_permissions.py +0 -169
  267. tests/api/ill/test_ill_providers_permissions.py +0 -82
  268. tests/api/ils/__init__.py +0 -8
  269. tests/api/ils/documents/__init__.py +0 -8
  270. tests/api/ils/documents/test_document_crud.py +0 -57
  271. tests/api/ils/documents/test_document_permissions.py +0 -106
  272. tests/api/ils/documents/test_document_resolvers.py +0 -35
  273. tests/api/ils/eitems/__init__.py +0 -8
  274. tests/api/ils/eitems/test_eitems_crud.py +0 -41
  275. tests/api/ils/eitems/test_eitems_permissions.py +0 -84
  276. tests/api/ils/eitems/test_files.py +0 -172
  277. tests/api/ils/items/__init__.py +0 -8
  278. tests/api/ils/items/test_apis.py +0 -43
  279. tests/api/ils/items/test_items_crud.py +0 -60
  280. tests/api/ils/items/test_items_permissions.py +0 -107
  281. tests/api/ils/items/test_items_update.py +0 -47
  282. tests/api/ils/records_relations/__init__.py +0 -8
  283. tests/api/ils/records_relations/helpers.py +0 -115
  284. tests/api/ils/records_relations/test_records_relations_parentchild.py +0 -560
  285. tests/api/ils/records_relations/test_records_relations_sequence.py +0 -302
  286. tests/api/ils/records_relations/test_records_relations_siblings.py +0 -678
  287. tests/api/ils/series/__init__.py +0 -8
  288. tests/api/ils/series/test_series_permissions.py +0 -95
  289. tests/api/ils/test_anonymization.py +0 -189
  290. tests/api/ils/test_apis.py +0 -76
  291. tests/api/ils/test_closures.py +0 -324
  292. tests/api/ils/test_errors.py +0 -126
  293. tests/api/ils/test_facets.py +0 -84
  294. tests/api/ils/test_internal_locations.py +0 -96
  295. tests/api/ils/test_loaders.py +0 -55
  296. tests/api/ils/test_metadata_extensions.py +0 -205
  297. tests/api/ils/test_notifications.py +0 -183
  298. tests/api/ils/test_notifications_mails.py +0 -39
  299. tests/api/ils/test_notifications_permissions.py +0 -55
  300. tests/api/ils/test_patrons.py +0 -106
  301. tests/api/ils/test_record_delete.py +0 -46
  302. tests/api/ils/test_record_permissions.py +0 -135
  303. tests/api/ils/test_resolvers.py +0 -207
  304. tests/api/ils/test_stats.py +0 -160
  305. tests/api/ils/test_tasks.py +0 -211
  306. tests/api/ils/test_vocabularies.py +0 -35
  307. tests/conftest.py +0 -123
  308. tests/data/acq_orders.json +0 -89
  309. tests/data/acq_providers.json +0 -12
  310. tests/data/document_requests.json +0 -77
  311. tests/data/documents.json +0 -237
  312. tests/data/eitems.json +0 -66
  313. tests/data/ill_borrowing_requests.json +0 -77
  314. tests/data/ill_providers.json +0 -12
  315. tests/data/internal_locations.json +0 -22
  316. tests/data/items.json +0 -271
  317. tests/data/loans.json +0 -133
  318. tests/data/loans_most_loaned.json +0 -128
  319. tests/data/locations.json +0 -20
  320. tests/data/series.json +0 -33
  321. tests/helpers.py +0 -104
  322. tests/templates/notifications/title_body.html +0 -8
  323. tests/templates/notifications/title_body_html.html +0 -13
  324. tests/templates/notifications/title_body_html_ctx.html +0 -13
  325. tests/templates/notifications/title_only.html +0 -3
  326. tests/test_version.py +0 -17
  327. /tests/templates/notifications/blank.html → /invenio_app_ils/acquisition/mappings/os-v1/__init__.py +0 -0
  328. /invenio_app_ils/stats/aggregations/aggr_file_download/{v6 → os-v1}/__init__.py +0 -0
  329. /invenio_app_ils/stats/file_download/{v6 → os-v1}/__init__.py +0 -0
  330. {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info/licenses}/AUTHORS.rst +0 -0
  331. {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info/licenses}/LICENSE +0 -0
@@ -49,10 +49,11 @@ class Document(IlsRecordWithRelations):
49
49
  "STANDARD",
50
50
  "SERIAL_ISSUE",
51
51
  "ARTICLE",
52
+ "MULTIMEDIA",
52
53
  ]
53
54
 
54
55
  _pid_type = DOCUMENT_PID_TYPE
55
- _schema = "documents/document-v1.0.0.json"
56
+ _schema = "documents/document-v2.0.0.json"
56
57
  _circulation_resolver_path = (
57
58
  "{scheme}://{host}/api/resolver/documents/{document_pid}/circulation"
58
59
  )
@@ -135,7 +136,7 @@ class Document(IlsRecordWithRelations):
135
136
  """Search for referencing loans."""
136
137
  loan_search_res = search_by_pid(
137
138
  document_pid=self["pid"],
138
- filter_states=current_app.config['CIRCULATION_STATES_LOAN_REQUEST']
139
+ filter_states=current_app.config["CIRCULATION_STATES_LOAN_REQUEST"]
139
140
  + current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"],
140
141
  )
141
142
  return loan_search_res
@@ -143,23 +144,17 @@ class Document(IlsRecordWithRelations):
143
144
  def search_item_references(self):
144
145
  """Search for referencing items."""
145
146
  item_search = current_app_ils.item_search_cls()
146
- return item_search.search_by_document_pid(
147
- document_pid=self["pid"]
148
- )
147
+ return item_search.search_by_document_pid(document_pid=self["pid"])
149
148
 
150
149
  def search_eitem_references(self):
151
150
  """Search for referencing eitems."""
152
151
  eitem_search = current_app_ils.eitem_search_cls()
153
- return eitem_search.search_by_document_pid(
154
- document_pid=self["pid"]
155
- )
152
+ return eitem_search.search_by_document_pid(document_pid=self["pid"])
156
153
 
157
154
  def search_doc_req_references(self):
158
155
  """Search for referencing document requests."""
159
156
  req_search = current_app_ils.document_request_search_cls()
160
- return req_search.search_by_document_pid(
161
- document_pid=self["pid"]
162
- )
157
+ return req_search.search_by_document_pid(document_pid=self["pid"])
163
158
 
164
159
  def search_order_references(self):
165
160
  """Search for referencing orders."""
@@ -177,14 +172,16 @@ class Document(IlsRecordWithRelations):
177
172
 
178
173
  def has_references(self):
179
174
  """Check if record has references."""
180
- return any([
181
- self.search_loan_references().count(),
182
- self.search_item_references().count(),
183
- self.search_eitem_references().count(),
184
- self.search_doc_req_references().count(),
185
- self.search_order_references().count(),
186
- self.search_brw_req_references().count()
187
- ])
175
+ return any(
176
+ [
177
+ self.search_loan_references().count(),
178
+ self.search_item_references().count(),
179
+ self.search_eitem_references().count(),
180
+ self.search_doc_req_references().count(),
181
+ self.search_order_references().count(),
182
+ self.search_brw_req_references().count(),
183
+ ]
184
+ )
188
185
 
189
186
  def delete(self, **kwargs):
190
187
  """Delete Document record."""
@@ -216,8 +213,7 @@ class Document(IlsRecordWithRelations):
216
213
  record_type="Document",
217
214
  record_id=self["pid"],
218
215
  ref_type="EItem",
219
- ref_ids=sorted([res["pid"] for res
220
- in eitem_search_res.scan()]),
216
+ ref_ids=sorted([res["pid"] for res in eitem_search_res.scan()]),
221
217
  )
222
218
 
223
219
  if req_search_res.count():
@@ -233,8 +229,7 @@ class Document(IlsRecordWithRelations):
233
229
  record_type="Document",
234
230
  record_id=self["pid"],
235
231
  ref_type="AcquisitionOrder",
236
- ref_ids=sorted([res["pid"] for
237
- res in orders_refs_search.scan()]),
232
+ ref_ids=sorted([res["pid"] for res in orders_refs_search.scan()]),
238
233
  )
239
234
 
240
235
  if brw_req_refs_search.count():
@@ -242,8 +237,7 @@ class Document(IlsRecordWithRelations):
242
237
  record_type="Document",
243
238
  record_id=self["pid"],
244
239
  ref_type="BorrowingRequest",
245
- ref_ids=sorted([res["pid"] for
246
- res in brw_req_refs_search.scan()]),
240
+ ref_ids=sorted([res["pid"] for res in brw_req_refs_search.scan()]),
247
241
  )
248
242
  return super().delete(**kwargs)
249
243
 
@@ -15,6 +15,7 @@ from invenio_circulation.pidstore.pids import CIRCULATION_LOAN_PID_TYPE
15
15
  from invenio_circulation.proxies import current_circulation
16
16
  from invenio_circulation.search.api import search_by_pid as search_loans_by_pid
17
17
  from invenio_indexer.api import RecordIndexer
18
+ from invenio_pidstore.errors import PIDDeletedError
18
19
 
19
20
  from invenio_app_ils.acquisition.api import ORDER_PID_TYPE
20
21
  from invenio_app_ils.acquisition.proxies import current_ils_acq
@@ -35,9 +36,7 @@ def get_items(document_pid):
35
36
  item_search_cls = current_app_ils.item_search_cls
36
37
  item_record_cls = current_app_ils.item_record_cls
37
38
  for item in (
38
- item_search_cls()
39
- .search_by_document_pid(document_pid=document_pid)
40
- .scan()
39
+ item_search_cls().search_by_document_pid(document_pid=document_pid).scan()
41
40
  ):
42
41
  item = item_record_cls.get_record_by_pid(item["pid"])
43
42
  referenced.append(dict(pid_type=ITEM_PID_TYPE, record=item))
@@ -50,9 +49,7 @@ def get_eitems(document_pid):
50
49
  eitem_search_cls = current_app_ils.eitem_search_cls
51
50
  eitem_record_cls = current_app_ils.eitem_record_cls
52
51
  for eitem in (
53
- eitem_search_cls()
54
- .search_by_document_pid(document_pid=document_pid)
55
- .scan()
52
+ eitem_search_cls().search_by_document_pid(document_pid=document_pid).scan()
56
53
  ):
57
54
  eitem = eitem_record_cls.get_record_by_pid(eitem["pid"])
58
55
  referenced.append(dict(pid_type=EITEM_PID_TYPE, record=eitem))
@@ -63,9 +60,13 @@ def get_related_records(document_pid):
63
60
  """Get referenced records via relations."""
64
61
  referenced = []
65
62
  doc_record_cls = current_app_ils.document_record_cls
66
- record = doc_record_cls.get_record_by_pid(document_pid)
63
+ try:
64
+ record = doc_record_cls.get_record_by_pid(document_pid)
65
+ except PIDDeletedError:
66
+ # Document might have been deleted while reindexing asynchronously.
67
+ return referenced
67
68
  relations = record.relations
68
- for relation_type, related_records in relations.items():
69
+ for _, related_records in relations.items():
69
70
  for obj in related_records:
70
71
  rec = IlsRecord.get_record_by_pid(
71
72
  obj["pid_value"], pid_type=obj["pid_type"]
@@ -80,14 +81,10 @@ def get_document_requests(document_pid):
80
81
  docreq_search_cls = current_app_ils.document_request_search_cls
81
82
  docreq_record_cls = current_app_ils.document_request_record_cls
82
83
  for request in (
83
- docreq_search_cls()
84
- .search_by_document_pid(document_pid=document_pid)
85
- .scan()
84
+ docreq_search_cls().search_by_document_pid(document_pid=document_pid).scan()
86
85
  ):
87
86
  docreq = docreq_record_cls.get_record_by_pid(request["pid"])
88
- referenced.append(
89
- dict(pid_type=DOCUMENT_REQUEST_PID_TYPE, record=docreq)
90
- )
87
+ referenced.append(dict(pid_type=DOCUMENT_REQUEST_PID_TYPE, record=docreq))
91
88
  return referenced
92
89
 
93
90
 
@@ -97,9 +94,7 @@ def get_loans(document_pid):
97
94
  loan_record_cls = current_circulation.loan_record_cls
98
95
  for loan in search_loans_by_pid(document_pid=document_pid).scan():
99
96
  loan = loan_record_cls.get_record_by_pid(loan["pid"])
100
- referenced.append(
101
- dict(pid_type=CIRCULATION_LOAN_PID_TYPE, record=loan)
102
- )
97
+ referenced.append(dict(pid_type=CIRCULATION_LOAN_PID_TYPE, record=loan))
103
98
  return referenced
104
99
 
105
100
 
@@ -123,9 +118,7 @@ def get_ill_borrowing_requests(document_pid):
123
118
  search = brw_req_search_cls().search_by_document_pid(document_pid)
124
119
  for hit in search.scan():
125
120
  brw_req = brw_req_record_cls.get_record_by_pid(hit["pid"])
126
- referenced.append(
127
- dict(pid_type=BORROWING_REQUEST_PID_TYPE, record=brw_req)
128
- )
121
+ referenced.append(dict(pid_type=BORROWING_REQUEST_PID_TYPE, record=brw_req))
129
122
  return referenced
130
123
 
131
124
 
@@ -8,7 +8,6 @@
8
8
  """Resolve the circulation status referenced in the Document."""
9
9
 
10
10
  import jsonresolver
11
- from elasticsearch import VERSION as ES_VERSION
12
11
  from werkzeug.routing import Rule
13
12
 
14
13
  from invenio_app_ils.circulation.search import (
@@ -19,9 +18,6 @@ from invenio_app_ils.circulation.search import (
19
18
  from invenio_app_ils.ill.api import BORROWING_REQUEST_PID_TYPE
20
19
  from invenio_app_ils.items.search import get_items_aggregated_by_statuses
21
20
 
22
- lt_es7 = ES_VERSION[0] < 7
23
-
24
-
25
21
  # Note: there must be only one resolver per file,
26
22
  # otherwise only the last one is registered
27
23
 
@@ -43,41 +39,26 @@ def jsonresolver_loader(url_map):
43
39
  past_loans_count = 0
44
40
  active_loans_count = 0
45
41
  pending_loans_count = 0
46
- loans_search = get_loans_aggregated_by_states(
47
- document_pid, loan_states
48
- )
42
+ loans_search = get_loans_aggregated_by_states(document_pid, loan_states)
49
43
 
50
44
  loans_result = loans_search.execute()
51
45
 
52
46
  for bucket in loans_result.aggregations.states.buckets:
53
- if (
54
- bucket["key"]
55
- in current_app.config["CIRCULATION_STATES_LOAN_COMPLETED"]
56
- ):
47
+ if bucket["key"] in current_app.config["CIRCULATION_STATES_LOAN_COMPLETED"]:
57
48
  past_loans_count += bucket["doc_count"]
58
- elif (
59
- bucket["key"]
60
- in current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]
61
- ):
49
+ elif bucket["key"] in current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]:
62
50
  active_loans_count += bucket["doc_count"]
63
- elif (
64
- bucket["key"]
65
- in current_app.config["CIRCULATION_STATES_LOAN_REQUEST"]
66
- ):
51
+ elif bucket["key"] in current_app.config["CIRCULATION_STATES_LOAN_REQUEST"]:
67
52
  pending_loans_count += bucket["doc_count"]
68
53
 
69
- overdue_loans_count = get_overdue_loans_by_doc_pid(
70
- document_pid
71
- ).count()
54
+ overdue_loans_count = get_overdue_loans_by_doc_pid(document_pid).count()
72
55
 
73
56
  # items
74
57
  unavailable_items_count = 0
75
58
  items_for_reference_count = 0
76
59
  item_statuses = get_items_aggregated_by_statuses(document_pid)
77
60
  item_result = item_statuses.execute()
78
- items_count = (
79
- item_result.hits.total if lt_es7 else item_result.hits.total.value
80
- )
61
+ items_count = item_result.hits.total.value
81
62
  for bucket in item_result.aggregations.statuses.buckets:
82
63
  if bucket["key"] not in "CAN_CIRCULATE":
83
64
  unavailable_items_count += bucket["doc_count"]
@@ -90,9 +71,10 @@ def jsonresolver_loader(url_map):
90
71
  loan = hit.to_dict()
91
72
  loan_item_type = loan.get("item_pid", {}).get("type")
92
73
  is_brw_req = loan_item_type == BORROWING_REQUEST_PID_TYPE
93
- if loan["state"] in \
94
- current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"] \
95
- and is_brw_req:
74
+ if (
75
+ loan["state"] in current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]
76
+ and is_brw_req
77
+ ):
96
78
  active_ill_loans_count += 1
97
79
 
98
80
  active_ils_loans_count = active_loans_count - active_ill_loans_count
@@ -120,11 +102,7 @@ def jsonresolver_loader(url_map):
120
102
  next_available_loans = (
121
103
  get_loan_next_available_date(document_pid).execute().hits
122
104
  )
123
- total = (
124
- next_available_loans.total
125
- if lt_es7
126
- else next_available_loans.total.value
127
- )
105
+ total = next_available_loans.total.value
128
106
  if total > 0:
129
107
  next_date = next_available_loans[0].end_date
130
108
  circulation["next_available_date"] = next_date
@@ -31,6 +31,7 @@ def jsonresolver_loader(url_map):
31
31
  eitems.append(
32
32
  {
33
33
  "pid": eitem.get("pid"),
34
+ "eitem_type": eitem.get("eitem_type"),
34
35
  "description": eitem.get("description"),
35
36
  "identifiers": eitem.get("identifiers", []),
36
37
  "internal_notes": eitem.get("internal_notes"),
@@ -37,12 +37,15 @@ def jsonresolver_loader(url_map):
37
37
  "status": item.get("status"),
38
38
  "description": item.get("description"),
39
39
  "shelf": item.get("shelf"),
40
+ "identifiers": item.get("identifiers"),
40
41
  "internal_location": {
41
42
  "name": item.get("internal_location", {}).get("name", ""),
42
43
  "location": {
43
- "name": item.get("internal_location", {})
44
- .get("location", {})
45
- .get("name", "")
44
+ "name": (
45
+ item.get("internal_location", {})
46
+ .get("location", {})
47
+ .get("name", "")
48
+ )
46
49
  },
47
50
  },
48
51
  }
@@ -55,13 +58,9 @@ def jsonresolver_loader(url_map):
55
58
 
56
59
  # grouping by location (can circulate and not on loan)
57
60
  location_name = (
58
- item.get("internal_location", {})
59
- .get("location", {})
60
- .get("name", "")
61
- )
62
- internal_location_name = item.get("internal_location", {}).get(
63
- "name", ""
61
+ item.get("internal_location", {}).get("location", {}).get("name", "")
64
62
  )
63
+ internal_location_name = item.get("internal_location", {}).get("name", "")
65
64
  if location_name not in by_location:
66
65
  by_location[location_name] = {
67
66
  internal_location_name: [],
@@ -10,6 +10,7 @@
10
10
  import jsonresolver
11
11
  from werkzeug.routing import Rule
12
12
 
13
+ from invenio_app_ils.eitems.api import EItem
13
14
  from invenio_app_ils.proxies import current_app_ils
14
15
 
15
16
  # Note: there must be only one resolver per file,
@@ -30,14 +31,13 @@ def jsonresolver_loader(url_map):
30
31
  search.aggs.bucket("mediums", "terms", field="medium")
31
32
  search_response = search.execute()
32
33
  mediums = [
33
- bucket.key
34
- for bucket in search_response.aggregations.mediums.buckets
34
+ bucket.key for bucket in search_response.aggregations.mediums.buckets
35
35
  ]
36
- eitems_count = eitem_search.search_by_document_pid(
37
- document_pid
38
- ).count()
39
- if eitems_count > 0:
40
- mediums.append("E-BOOK")
36
+ eitems = eitem_search.search_by_document_pid(document_pid)
37
+ for type in EItem.EITEM_TYPES:
38
+ type_count = eitems.filter("term", eitem_type=type).count()
39
+ if type_count > 0:
40
+ mediums.append(type)
41
41
  return {
42
42
  "mediums": mediums,
43
43
  }
@@ -16,24 +16,12 @@ from invenio_app_ils.records.loaders.schemas.changed_by import (
16
16
  ChangedBySchema,
17
17
  set_changed_by,
18
18
  )
19
+ from invenio_app_ils.records.loaders.schemas.identifiers import IdentifierSchema
19
20
  from invenio_app_ils.records.loaders.schemas.preserve_cover_metadata import (
20
21
  preserve_cover_metadata,
21
22
  )
22
23
 
23
24
 
24
- class IdentifierSchema(Schema):
25
- """Identifier schema."""
26
-
27
- class Meta:
28
- """Meta attributes for the schema."""
29
-
30
- unknown = EXCLUDE
31
-
32
- material = fields.Str()
33
- scheme = fields.Str(required=True)
34
- value = fields.Str(required=True)
35
-
36
-
37
25
  class AffiliationSchema(Schema):
38
26
  """Affiliation schema."""
39
27
 
@@ -241,6 +229,7 @@ class DocumentSchemaV1(RecordMetadataSchemaJSONV1):
241
229
  internal_notes = fields.List(fields.Nested(InternalNoteSchema))
242
230
  keywords = fields.List(fields.Nested(KeywordSchema))
243
231
  languages = fields.List(fields.Str())
232
+ legacy_recid = fields.Int()
244
233
  licenses = fields.List(fields.Nested(LicenseSchema))
245
234
  note = fields.Str()
246
235
  number_of_pages = fields.Str()
@@ -248,7 +237,7 @@ class DocumentSchemaV1(RecordMetadataSchemaJSONV1):
248
237
  physical_description = fields.Str()
249
238
  publication_info = fields.List(fields.Nested(PublicationInfoSchema))
250
239
  publication_year = fields.Str(required=True)
251
- restricted = fields.Bool(missing=False)
240
+ restricted = fields.Bool(load_default=False)
252
241
  source = fields.Str()
253
242
  subjects = fields.List(fields.Nested(SubjectSchema))
254
243
  table_of_content = fields.List(fields.Str())
@@ -5,4 +5,4 @@
5
5
  # invenio-app-ils is free software; you can redistribute it and/or modify it
6
6
  # under the terms of the MIT License; see LICENSE file for more details.
7
7
 
8
- """ILS ES v6 document mappings."""
8
+ """ILS ES v7 document mappings."""