You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/mapping_file_based_mapping.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -296,3 +296,50 @@ This rule allows you to map codes to strings. Given the following mapping:
296
296
297
297
If the STATUS field contains *0*, then the resulting value in the note title will be *Graduate*.
298
298
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.
Copy file name to clipboardExpand all lines: docs/source/mapping_files_inventory.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ temp_loan_types.tsv | no | no | no | optional | no | no
16
16
call_number_type_mapping.tsv | no | no | optional | optional | no | no
17
17
statcodes.tsv | optional | optional | optional | optional | no | no
18
18
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
19
21
post_loan_migration_statuses.tsv | no | no | no | no | optional | no
20
22
patron_types.tsv | no | no | no | no | no | yes
21
23
user_mapping.json | no | no | no | no | no | yes
@@ -156,3 +158,30 @@ lost | Aged to lost
156
158
```{attention}
157
159
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.
158
160
```
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.
0 commit comments