Skip to content

Commit bacde5b

Browse files
committed
Update field mapping documentation for holdings and and item note types
1 parent f22b29d commit bacde5b

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

docs/source/mapping_file_based_mapping.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,50 @@ This rule allows you to map codes to strings. Given the following mapping:
296296

297297
If the STATUS field contains *0*, then the resulting value in the note title will be *Graduate*.
298298
If no match is made, the original string will be returned. So if STATUS is *1*, then the note title will be *1*.
299+
300+
## Validation of Hardcoded Note Type Values
301+
302+
When mapping item or holdings note types (`itemNoteTypeId` or `holdingsNoteTypeId` fields), any hardcoded values specified in the `value` or `fallback_value` properties are validated at mapper initialization. This ensures that mapping files are correct before data transformation begins.
303+
304+
### Validation Rules
305+
306+
Each hardcoded note type value is validated against the FOLIO tenant's available note types:
307+
- **Empty values** are allowed and skipped
308+
- **UUID values** must exist in FOLIO's note type repository
309+
- **Name values** must match a valid FOLIO note type name (case-insensitive)
310+
311+
### Error Handling
312+
313+
If any hardcoded note type value is invalid, a comprehensive error is raised listing all invalid values with their locations in the mapping file:
314+
315+
```
316+
Invalid note type values found in field mapping:
317+
- 'invalid-type-1' (in field: notes[0].itemNoteTypeId, value) - name not found in FOLIO
318+
- '99999999-9999-9999-9999-999999999999' (in field: notes[1].itemNoteTypeId, value) - UUID not found in FOLIO
319+
- 'unknown-note' (in field: notes[2].holdingsNoteTypeId, fallback_value) - name not found in FOLIO
320+
321+
Available note types: action-note, public-note, staff-note, ...
322+
323+
Please update your mapping file with valid note type names or UUIDs.
324+
```
325+
326+
### Example: Valid Configuration
327+
328+
```json
329+
{
330+
"folio_field": "notes[0].itemNoteTypeId",
331+
"legacy_field": "",
332+
"value": "staff-note",
333+
"description": "Always use staff note type",
334+
"fallback_value": ""
335+
},
336+
{
337+
"folio_field": "notes[1].itemNoteTypeId",
338+
"legacy_field": "NOTE_TYPE",
339+
"value": "",
340+
"description": "Map from legacy data, fallback to public-note",
341+
"fallback_value": "public-note"
342+
}
343+
```
344+
345+
This validation ensures that mapping configuration errors are caught immediately, rather than during data processing when iteration is more costly.

docs/source/mapping_files_inventory.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ temp_loan_types.tsv | no | no | no | optional | no | no
1616
call_number_type_mapping.tsv | no | no | optional | optional | no | no
1717
statcodes.tsv | optional | optional | optional | optional | no | no
1818
item_statuses.tsv | no | no | no | optional | no | no
19+
item_note_types.tsv | no | no | no | optional | no | no
20+
holdings_note_types.tsv | no | optional | optional | no | no | no
1921
post_loan_migration_statuses.tsv | no | no | no | no | optional | no
2022
patron_types.tsv | no | no | no | no | no | yes
2123
user_mapping.json | no | no | no | no | no | yes
@@ -156,3 +158,30 @@ lost | Aged to lost
156158
```{attention}
157159
If the item status you are mapping is the result of a circulation transaction (i.e. "Checked out", "Paged", "Aged to lost", "Declared lost", "Claimed returned"), we recommend using an item status mapping of Available for these items, instead. You can set the `next_item_status` in your loans data migration to ensure that loan-related statuses are appropriately set after the migrated loan is created.
158160
```
161+
162+
### 📄 item_note_types.tsv
163+
Optional mapping file for translating legacy item note type codes to FOLIO item note types. This file allows you to map custom or legacy note type codes to FOLIO note type names before they are resolved to their corresponding UUIDs.
164+
165+
The file should be structured with `legacy_note_type` and `folio_name` columns:
166+
167+
legacy_note_type | folio_name
168+
------------ | -------------
169+
LOCAL_NOTE | Local note
170+
INTERNAL_NOTE | Staff note
171+
PUBLIC_NOTE | Public note
172+
* | Public note
173+
174+
When this file is not provided, note type values are resolved directly as FOLIO note type names or UUIDs. If a value cannot be resolved, an error is recorded.
175+
176+
### 📄 holdings_note_types.tsv
177+
Optional mapping file for translating legacy holdings note type codes to FOLIO holdings note types. This file allows you to map custom or legacy note type codes to FOLIO note type names before they are resolved to their corresponding UUIDs.
178+
179+
The file should be structured with `legacy_note_type` and `folio_name` columns:
180+
181+
legacy_note_type | folio_name
182+
------------ | -------------
183+
SUPPLEMENTAL_HOLDINGS | Binding information
184+
PRESERVATION_NOTE | Action note
185+
* | Action note
186+
187+
When this file is not provided, note type values are resolved directly as FOLIO note type names or UUIDs. If a value cannot be resolved, an error is recorded.

docs/source/reference_data_mapping.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ The FOLIO column name depends on the type of reference data being mapped:
6868
| Material Types | `folio_name` | Material type **name** |
6969
| Loan Types | `folio_name` | Loan type **name** |
7070
| Call Number Types | `folio_name` | Call number type **name** |
71+
| Item Note Types | `folio_name` | Item note type **name** |
72+
| Holdings Note Types | `folio_name` | Holdings note type **name** |
7173
| Patron Groups | `folio_name` | Patron group **name** (the `group` field) |
7274
| Departments | `folio_name` | Department **name** |
7375
| Statistical Codes | `folio_code` | Statistical code **code** |

0 commit comments

Comments
 (0)