Skip to end of banner
Go to start of banner

MODQM-311 Spike: Investigate feasibility of local authority source support

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

MODQM-311 - Getting issue details... STATUS

Goals

  1. Determine complexity of allowing for configuration of 001 generation (prefix + starting value) 
  2. Adding the ability to select the desired authority source file at point of creation of new record (so the system would know how to generate the 001 per the configuration)

Approach 

  1. Create new endpoint to retrieve HRID by authority file id 
  2. Implement sequence number generation mechanism for authority local files
  3. On the UI user will select file name. And before creation UI should put to 001 field value from the HRID endpoint. 

Ability to store authority local files

Settings application UI preview:

localauthoritydefinition.PNG

Endpoints:

GET: /authority-source-files/{id}/hrid
Description:  Endpoint returns current hrid value and increment it. Should be called once user clicked on the "create" button to put value in the 001 field.

Authority Source File HRID Example
{
    "id": "cb58492d-018e-442d-9ce3-35aabfc524aa",
    "prefix": "loc",
    "hrid": "000000001"
}

POST: /authority-source-files
New query parameter: startNumber (default = 1)

startNumber parameter schema
"startNumber": {
  "description": "The number from which to start generating HRIDs",
  "type": "integer",
  "minimum": 1,
  "maximum": 99999999999
}


Sequence number generation mechanism for authority local files

Sequences Approach

There is a similar approach that works already in the mod-inventory-storage. It generates Hrid numbers for Instances, Holdings, and Item records, and can be configured from UI (Settings → Inventory → Hrid handling);
The problem here is that we will create new sequences in Runtime for each new authority file. (format: "hrid_authority_local_file_{prefix}_seq") 

Table with counter Approach

New table should be presented

hrid_authority_source_file
CREATE TABLE IF NOT EXISTS hrid_authority_source_file
(
  authorityFileId UUID NOT NULL,
  hridSeq         INT  NOT NULL,
  CONSTRAINT hrid_authority_source_file_pkey PRIMARY KEY (authorityFileId),
  CONSTRAINT hrid_authority_source_file_fkey FOREIGN KEY (authorityFileId)
    REFERENCES authority_source_file (id)
);


To work with table it's better to use
SERIALIZABLE Isolation:
@Transactional(isolation = Isolation.SERIALIZABLE)

Select local authority file on the UI

  • User should select local file for 001 field
  • We also need to warn the user that field 001 may be overwritten by field 010.




  • No labels