Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

Jira Legacy
serverSystem JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyUXPROD-2273

Jira Legacy
serverSystem

...

JIRA
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyMODSOURMAN-262

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

...

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

...

's default

...

map

...

.

...

  • Ensure automated testing coverage for this new code is 80% plus

Acceptance testing:

  • Add some fields to an existing SRS MARC (e.g. add a 7xx contributor, or a 6xx subject heading, or a 5xx note), and check the related Instance to see if the new fields show up.
  • Change the data in some fields in an existing SRS MARC (e.g. change the 245 title, or change the publication date in 260/264 c, or change the 336 $b), and check the related Instance to see if the update data shows
  • Remove some fields from an existing SRS MARC (e.g. remove a 6xx subject heading, or a 5xx note, or 336/337/338), and check the related Instance to see if the removed data has disappeared
  • Add, change, and remove some fields in an existing SRS MARC record, and check the related Instance to ensure all corresponding changes have been made

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
iconfalse

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:

MethodPath
Provided permissions
PermissionsRequestResponseDescriptionNotes
PUT
GET
/

change-manager/parsedRecords

/

?instanceId={

id

instanceId}

change-manager.
parsed-records.putcompatible parsed record204 UPDATED (compatible-parsed-record)Update parsed record{id} - parsed record idGET/source-storage/records
parsedrecords.getNA

200 OK

(ParsedRecordDto)

(A) GET MARC record{instanceId} - corresponding Instance id
PUT/change-manager/parsedRecords/{id}
source
change-
storage
manager.parsed-records.
getNA200 OK (compatible-record)Retrieve rcord by id
put

Updated 

ParsedRecordDto

202 ACCEPTED (B) Update MARC record{id} - record id
POST/source-storrage/snapshotssource-storage.snapshots.postcompatible snapshot201 CREATEDCreate new snapshotPOST/source-storage/recordssource-storage.records.postcompatible record201 CREATEDCreate new recordPOST/inventory/handlers/quick-markinventory.events.postevent200 OKEvent handler

Tickets for implementing endpoints which are not exists yet:

  1. PUT /change-manager/parsedRecords/{id} - 
    Jira Legacy
    serverSystem Jira
    serverId01505d01-b853-3c2e-90f1-ee9b165564fc
    keyMODSOURMAN-268
  2. GET /source-storage/records/{id} - 
    Jira Legacy
    serverSystem Jira
    serverId01505d01-b853-3c2e-90f1-ee9b165564fc
    keyMODSOURCE-115
  3. POST /inventory/handlers/quick-mark - 
    Jira Legacy
    serverSystem Jira
    serverId01505d01-b853-3c2e-90f1-ee9b165564fc
    keyMODINV-207

Schema:

Image Removed

Step-by-step guide:

...


...

Drawio
bordertrue
diagramNameChange Manager functionality triggered by quickMarc
simpleViewerfalse
width800
linksauto
tbstyletop
diagramDisplayNameChange Manager functionality triggered by quickMarc
lboxtrue
diagramWidth1071
revision3

Info
iconfalse

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
bordertrue
diagramNameQM events
simpleViewerfalse
width500
linksauto
tbstyletop
diagramDisplayNameQM events going through pubsub
lboxtrue
diagramWidth531
revision1

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:  

  1. a new Snapshot is created 
  2. a new Record is created with incremented generation value and state ACTUAL
  3. 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.