Need to implement approach to generate different UUIDs for Marc Authorities, and at the same to prevent duplicates processing.
The approach has been designed in scope of spike:
MODDATAIMP-500 and needs the creation of new table for deduplication purposes. This story need to be started after story: MODINV-588 because in MODINV-588 new DB schema for mod-inventory module should be created.
Currently data-import supports 1 to 1 mapping between record and marc authority. In future when we need to support 1 to many mapping - table records_authorities can be extended with additional column that identifies particular authority such as sequence number.
The working flow described in the diagrams below.
Diagram of item id generation logic:
What needs to be done:
1. Add db schema change, that includes creating of new table records_authorities
3. Add new AuthorityIdStorageService class and DAO layer for it, that calls newly added table records_authorities
4. Modify CreateMarcAuthorityEventHandler class to call new AuthorityIdStorageService for checking UUIDs.
5. Add unit/integration tests.