Investigate the existing solution and provide a design for duplication of existing MARC record.
'mod-quick-marc'
is used as a proxy between User and 'mod-source-record-manager'
(which inside use 'mod-source-record-storage'
and 'mod-inventory'
) and can work only with existing records.
Lest have a look on 'get-by-id' flow
From the picture above we can see that 'mod-quick-marc'
and 'mod-source-record-manager'
operate with QuickMarcJson ↔ ParsedRecordDto models. Communication takes place thought
"source-manager-parsed-records"
interface of 'mod-source-record-manager'
| GET |
|
PUT |
|
On the other side Folio has an ability to create a new Record inside 'mod-source-record-storage'
and Instance in 'mod-inventory'
using 'mod-data-import'
module.
'mod-source-record-manager'
currently supports two ways to import MARC records : event-driven and REST approaches. As module will be moving to event-driven model we will focus on it.
Some parts of the process such as post-process-after-instance-creation, Journal updates, JobExecution status updates and initial call of import are omitted in the digram to simplify process. From the diagram it is clearly understandable that process of creation Records and Instances is quite complex and we can use some parts of that flow.
'mod-source-record-manager'
works with RawRecordDto model which then converted into Record and then start the flow of creation.
Record model has several required fields to be filled:
Field name | Description |
---|---|
snapshotId | a UUID of the executionJob |
matchedId | a UUID of a record |
recordType | MARC |
rawRecord | raw content of the record |
So, to be able to use flow for importing we need to provide a Record for 'mod-source-record-manager'.
'mod-quick-marc'
works with ParsedRecordDto but 'mod-source-manager'
needs to have Record model.One of the required field of Record is 'rawRecord'. So, there is need to convert ParsedRecordDto to RawRecord or get the existing entity from 'mod-source-record-storage'
module.
Next required field of Record is 'snapshotId'. 'mod-source-record-storage'
may contain a STUB_SNAPSHOT entry that might be used. If not - Snapshot should be created
URL | Note |
---|---|
GET /source-storage/snapshots/{jobExecutionId} | where {jobExecutionId} = "00000000-0000-0000-0000-000000000000" |
POST /source-storage/snapshots | sample body } |
There is a simple solution exist to delegate whole work of creating a new Record and Instance based on 'mod-source-record-manager'
at README file.
According to it the clone record flow will be simplified to:
Based on the diagram we can divide flow to 3 stages:
'mod-quick-marc'
side 'mod-source-record-manager'
Module 'mod-quick-marc'
has to support a new endpoint to accept a QuickMarcJson payload. Here is the endpoint definition:
Method | URL | Permissions | Payload |
---|---|---|---|
POST | /records-editor/records | endpoint permission - "records-editor.records.item.clone" module permissions - "source-manager-job-executions", "source-manager-records" |
'mod-source-record-manager'
'mod-source-record-manager'
provides endpoints to initialize import process. On this step we completely rely on execution of following three endpoints:
Method | URL | Body | Checked | ||
---|---|---|---|---|---|
1 | POST |
| ![]() | ||
2 | POST | /change-manager/jobExecutions/{jobExecutionId}/records?defaultMapping=true |
| ![]() | |
3 | POST |
|
|
To provide an ability for User to be notified about the creation of the Instance 'mod-quick-marc'
should, one the one hand
and on the other hand -
'mod-source-record-manager'
that process of Instance and Record creation has beed finished. For this being said, 'mod-quick-marc'
has to publish an endpoint with following description:
Method | URL | Permissions |
---|---|---|
GET | /records-editor/records/status?qmRecordId=<id> |
|
with the sample of the payload
Sample payload | Notes |
---|---|
| Proposed values for the status:
|
'mod-quick-marc'
has to
| |
| |
user notification about created entries |
'mod-quick-marc'
get by id schema - quick-marc-to-srm-get.puml