Skip to content

Commit 5f4818e

Browse files
committed
internal location: add field accessible_by_patrons
1 parent 48b3c7a commit 5f4818e

File tree

26 files changed

+107
-11
lines changed

26 files changed

+107
-11
lines changed

invenio_app_ils/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2018-2020 CERN.
3+
# Copyright (C) 2018-2025 CERN.
44
#
55
# invenio-app-ils is free software; you can redistribute it and/or modify it
66
# under the terms of the MIT License; see LICENSE file for more details.
@@ -202,6 +202,7 @@ def generate(self):
202202
"notes": lorem.sentence(),
203203
"physical_location": lorem.sentence(),
204204
"location_pid": location_pid_value,
205+
"accessible_by_patrons": True,
205206
}
206207
for pid in range(1, size + 1)
207208
]

invenio_app_ils/documents/jsonresolvers/document_item.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2019-2020 CERN.
3+
# Copyright (C) 2019-2025 CERN.
44
#
55
# invenio-app-ils is free software; you can redistribute it and/or modify it
66
# under the terms of the MIT License; see LICENSE file for more details.
@@ -40,6 +40,9 @@ def items_resolver(document_pid):
4040
"identifiers": item.get("identifiers"),
4141
"internal_location": {
4242
"name": item.get("internal_location", {}).get("name", ""),
43+
"accessible_by_patrons": item.get("internal_location", {}).get(
44+
"accessible_by_patrons", True
45+
),
4346
"location": {
4447
"name": (
4548
item.get("internal_location", {})

invenio_app_ils/documents/mappings/os-v1/documents/document-v1.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@
407407
},
408408
"name": {
409409
"type": "keyword"
410+
},
411+
"accessible_by_patrons": {
412+
"type": "boolean"
410413
}
411414
},
412415
"type": "object"

invenio_app_ils/documents/mappings/os-v1/documents/document-v2.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@
492492
},
493493
"name": {
494494
"type": "keyword"
495+
},
496+
"accessible_by_patrons": {
497+
"type": "boolean"
495498
}
496499
},
497500
"type": "object"

invenio_app_ils/documents/mappings/os-v2/documents/document-v1.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@
407407
},
408408
"name": {
409409
"type": "keyword"
410+
},
411+
"accessible_by_patrons": {
412+
"type": "boolean"
410413
}
411414
},
412415
"type": "object"

invenio_app_ils/documents/mappings/os-v2/documents/document-v2.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@
492492
},
493493
"name": {
494494
"type": "keyword"
495+
},
496+
"accessible_by_patrons": {
497+
"type": "boolean"
495498
}
496499
},
497500
"type": "object"

invenio_app_ils/documents/mappings/v7/documents/document-v1.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@
407407
},
408408
"name": {
409409
"type": "keyword"
410+
},
411+
"accessible_by_patrons": {
412+
"type": "boolean"
410413
}
411414
},
412415
"type": "object"

invenio_app_ils/documents/mappings/v7/documents/document-v2.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@
492492
},
493493
"name": {
494494
"type": "keyword"
495+
},
496+
"accessible_by_patrons": {
497+
"type": "boolean"
495498
}
496499
},
497500
"type": "object"

invenio_app_ils/internal_locations/loaders/jsonschemas/internal_location.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2018 CERN.
3+
# Copyright (C) 2018-2025 CERN.
44
#
55
# invenio-app-ils is free software; you can redistribute it and/or modify it
66
# under the terms of the MIT License; see LICENSE file for more details.
@@ -24,3 +24,4 @@ class Meta:
2424
legacy_ids = fields.List(fields.Str())
2525
notes = fields.Str()
2626
physical_location = fields.Str()
27+
accessible_by_patrons = fields.Boolean(required=True)

invenio_app_ils/internal_locations/mappings/os-v1/internal_locations/internal_location-v1.0.0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
},
103103
"pid": {
104104
"type": "keyword"
105+
},
106+
"accessible_by_patrons": {
107+
"type": "boolean"
105108
}
106109
}
107110
}

0 commit comments

Comments
 (0)