...
...
...
Jira Legacy | ||||||||
---|---|---|---|---|---|---|---|---|
|
Jira Legacy | ||
---|---|---|
|
...
|
Requirements
Purpose: MARC Bibliographic records can be updated in a variety of ways - through an Import that updates it, or through quickMARC, or through MARCcat. Whenever/however Required to enable quickMarc updates.
Whenever an SRS MARC Bib record is updated, then the corresponding changes need to be made in the Instance fields that are controlled by the tenant's default map
...
As a staff person
I want to see an updated Instance when the underlying SRS MARC Bib has been updated
So that I can have access to that updated information
Scenarios
- Scenario 1
- Given the Inventory Instance View/Edit screens
- When the underlying SRS MARC record is updated
- And the updates affect fields that are part of the Tenant's default MARC Bib-Inventory Instance map
- Then make the corresponding updates to the affected fields of the Instance automatically
- NOTE: Changes could be adding fields, changing data in an existing field, or removing fields.
- Scenario 2
- Ensure automated testing coverage for this new code is 80% plus
Acceptance testing:
...
.
...
...
NOTE: The default MARC Bib-Inventory Instance map may vary from tenant to tenant. Updates should be made based on the Instance fields mapped/controlled by the specific Tenanttenant's default map.
The FOLIO-supplied default MARC-Instance map: https://github.com/folio-org/mod-source-record-manager/blob/master/mod-source-record-manager-server/src/main/resources/rules/rules.json
Approach & Design
...
Info | ||
---|---|---|
| ||
SRS is short for mod-source-record-storage SRM or CM (Change Manager) can be used interchangeably and refer to mod-source-record-manager |
SRM exposes the following endpoints for quickMarc to retrieve the MARC record by instanceId and to save the updated MARC record:
Method | Path |
---|
Permissions | Request | Response | Description | Notes |
---|
GET |
change-manager/parsedRecords |
?instanceId={ |
instanceId} | change-manager. |
parsedrecords.get | NA | 200 OK | (A) GET MARC record | {instanceId} - corresponding Instance id |
PUT | /change-manager/parsedRecords/{id} |
change- |
manager.parsed-records. |
put | Updated | 202 ACCEPTED | (B) Update MARC record | {id} - record id |
Tickets for implementing endpoints which are not exists yet:
- PUT /change-manager/parsedRecords/{id} -
Jira Legacy server System Jira serverId 01505d01-b853-3c2e-90f1-ee9b165564fc key MODSOURMAN-268 - GET /source-storage/records/{id} -
Jira Legacy server System Jira serverId 01505d01-b853-3c2e-90f1-ee9b165564fc key MODSOURCE-115 - POST /inventory/handlers/quick-mark -
Jira Legacy server System Jira serverId 01505d01-b853-3c2e-90f1-ee9b165564fc key MODINV-207
Schema:
Step-by-step guide:
...
...
Drawio | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Info | ||
---|---|---|
| ||
SRS/SRM do not perform any validation of the updated MARC record, MARC Leader value should be recalculated on the quickMarc side |
The actual update of the SRS MARC Record and the corresponding inventory Instance happens using pub-sub approach.
Drawio border true diagramName QM events simpleViewer false width 500 links auto tbstyle top diagramDisplayName QM events going through pubsub lbox true diagramWidth 531 revision 1
1) Upon receiving the request for update of the MARC record, a new QM_RECORD_UPDATED event is formed and published to mod-pubsub. Event payload contains the following data
- PARSED_RECORD_DTO - received ParsedRecordDto containing updated MARC record
- MAPPING_RULES - MARC-to-Instance default mapping rules
- MAPPING_PARAMS - mapping parameters for populating reference data
- SNAPSHOT_ID (optional) - new Snapshot id to which the updated MARC record will be linked
2) SRS is subscribed to QM_RECORD_UPDATED eventType. When SRS receives the event the following operations are performed:
- a new Snapshot is created
- a new Record is created with incremented generation value and state ACTUAL
- state of the original Record is set to OLD
Steps 2 and 3 are executed in transaction.
3) After the Record is successfully “updated” (records in SRS are not overwritten, new Record is being saved with higher generation, and all the others are marked as OLD), a new QM_SRS_MARC_BIB_RECORD_UPDATED
...
event is published to mod-pubsub with payload:
- MAPPING_RULES (received from SRM) - MARC-to-Instance default mapping rules
- MAPPING_PARAMS (received from SRM)- mapping parameters for populating reference data
- MARC - updated SRS MARC Record
4) mod-inventory is subscribed to QM_SRS_MARC_BIB_RECORD_UPDATED event. When event is received, a new Instance entity is mapped from MARC record using Mapper from data-import-processing-core
...
library. The original Instance is retrieved from mod-inventory
...
-storage, compared to the newly mapped one and updated accordingly.