Versions Compared

Key

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

Jira Legacy
serverSystem Jira
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyMODQM-311

...

  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. 

Tickets

OverviewApproachModuleStory Points
Ticket
Jira ticket
Validation for authority local files
  1. Implement AuthoritySourceFileHridManager with Validation:
      - (if source = 'local' then codes.size = 1) else throw exception
      - (if source = 'local' and startNumber = null) set startValue = 1
mod-inventory-storage2 sp
Implement sequence number generation mechanism for authority local files (Sequences Approach)
  1. New endpoint to catch-up authority current hrid information is presented
  2. Extend AuthoritySourceFileHridManager to work with sequences
      - Create sequence for authority local file after validation
      - Update sequence name for authority local file if prefix was updated
      - Drop sequence for authority local file after deletion
  3. Return hrid on request 
      - Retrieve next value from localFile sequence 
      - Format next value to NaturalId(HRID) format
mod-inventory-storage5 sp
Implement sequence number generation mechanism for authority local files (Table with counter Approach)
  1. New endpoint to catch-up authority current hrid information is presented
  2. New table to work with authority files HRID presented
  3. Extend AuthoritySourceFileHridManager to work with table
      - All transactions should be done with SERIALIZABLE isolation
      - On request return current hrid value and increment it. 
      - Format value to NaturalId(HRID) format
mod-inventory-storage5 sp
Authority file id validation
  1. mod-quick-marc in scope of authority creation should convert 001 field value to UUID and retrieve available hrid for source file id.
  2. Replace 001 field value from authorityFileId to "prefix + hrid"
mod-quick-marc2 sp
Local authority file selection
  1. User should have the ability to look-up for local authority file
    (As permanent-location look-up for Holdings)
After user click "create" button,

  1. UI should
call endpoint to retrieve current hrid value.
And put it
  1. put authorityFileId to 001 field
ui-inventory

Ability to store authority local files

Settings application UI preview:

localauthoritydefinition.PNG

Endpoints:

...

POST: /authority-source-files/{id}/hrid
Description:  Endpoint returns current hrid value and increment it.

...

 

Code Block
themeDJango
borderStyledashed
titleAuthority Source File HRID Example
collapsetrue
{
    "id": "cb58492d-018e-442d-9ce3-35aabfc524aa",
    "prefix": "loc",
    "hrid": "000000001"
}

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

...

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") 

Status
colourGreen
titlePros

Status
colourRed
titleCons

Auto increment Separate sequence should be created for each authority file
Atomic transaction. Safety works with asynchronous work



Table with counter Approach

...


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

Status
colourGreen
titlePros

Status
colourRed
titleCons

One table for all authority filesAll work with select and increment should be done manually.

Harder work with transactions. 
All transactions should be fulfilled in SERIALIZABLE Isolation level. So it can reduce performance



Select local authority file on the UI

...