[Instance, Holdings, Item Audit] Calculate entity diff on event consumption

Description

Entity diff should be calculate on event consumption for instance, holings, item records and populated into appropriate database column.

  1. Entity diff object should contain "added", "removed", and "modified" lists with old-new values for any affected field (will be implemented in https://folio-org.atlassian.net/browse/MODAUD-219 )

  2. Changes in metadata should be ignored

  3. Audit records related to the "create" event should contain only "added" sub-object without previous values

  4. Audit records related to "delete" events should contain no body

Addititional notes:
Investigate https://javers.org/documentation/ library for diff calculation.

Environment

None

Potential Workaround

None

Attachments

41
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 18 Feb 2025, 08:11 AM
  • 13 Feb 2025, 11:02 AM

Checklist

hide

Activity

Show:

Valery_Pilko February 18, 2025 at 8:11 AM

Re-tested on https://folio-etesting-snapshot2-diku.ci.folio.org/:
Issue 1 - Fixed

image-20250218-070709.png

Issue - 2 - Fixed.
Only updates of the following Holdings fields are tracked in Item record:
- Holdings location (Permanent and Temporary)
- Call number type
- Call number prefix
- Call number
- Call number suffix

Issue - 3 - Fixed.

image-20250218-080153.png
image-20250218-080226.png

Issue 4 - Fixed.

image-20250218-080346.png
image-20250218-080413.png

Issue 5 - Fixed.

image-20250218-080728.png
image-20250218-080746.png
image-20250218-080759.png

Issue 6 - Fixed.

image-20250218-080959.png
image-20250218-081023.png
image-20250218-081039.png

Valery_Pilko February 13, 2025 at 12:06 PM

Hi - thank you!
let question that I’ve asked Christine be
Issue 6 - Change of “Preceding titles” / “Succeeding titles” / “Child instances” / “Parent instances” of Instance is tracked in audit log

Christine Schultz-Richert February 13, 2025 at 11:52 AM

Hey - related to the preceding/succeeding/parent/child instance relationships - it is okay that we don’t show these changes in the audit log.

Valery_Pilko February 13, 2025 at 11:02 AM
Edited

Verified on Eureka Sprint testing envs, following cases are verified and works as expected:

  1. Created Instance:

    image-20250213-072438.png

     

  2. Update not repeatable field of Instance:

    image-20250213-072633.png

     

  3. Add a field:

    image-20250213-072923.png

     

  4. 3 repeatable fields are added (contributors):

    image-20250213-073207.png

     

  5. Update 1 repeatable field (contributor):

    image-20250213-073401.png

     

  6. Cleared/Removed field:

    image-20250213-073739.png

     

  7. Add/remove tags:

    image-20250213-080154.png

     

  8. Adding/editing/removing Holdings and Items are not tracked in Instance audit log.

  9. Holdings create:

    image-20250213-080722.png

     

  10. Holdings field update:

    image-20250213-080817.png

     

  11. Holdings repeatable field update:

    image-20250213-080951.png

     

  12. Item create:

    image-20250213-094152.png

     

  13. Item move to other holdings is tracked in Item:

    image-20250213-100815.png

     

  14. Holdings move to other Instance is tracked in Holdings:

    image-20250213-101006.png

     

  15. Update ownership ECS - item from tenant 1 is deleted, item in tenant 2 is created:

    image-20250213-104004.png
    image-20250213-103945.png

     

  16. Create of Instance/Holdings/Item via Orders app is tracked.
    Status of Item change by Receiving app is tracked:

    image-20250213-105141.png



    image-20250213-105117.png

     

  17. Status if Item record change by Requests app is logged:

    image-20250213-110150.png

     

    image-20250213-110023.png



    Hey - could you please review and answer the following questions?
    1. Should adding/removing of “Preceding titles” / “Succeeding titles” / “Child instances” / “Parent instances” in Instance be tracked by audit log?
    Note: Right now we track update but don’t show details, see screenshots:

    image-20250213-074407.png
    image-20250213-080022.png


    Hey following issues found:
    Issue 1 - “Add” action of “Date type” fields (Date type, Date 1 and Date 2) is not tracked. Edit and Delete actions are tracked as expected.

    image-20250213-075430.png

    Issue 2 - Update of any field of “Holdings” record is tracked by “Item” audit log.
    For example: update of “Former holdings ID” field if holdings record - updates “Item’s” version.

    image-20250213-094309.png

    NOTE: call number fields and location added/updated/deleted in Holdings record are tracked in Item’s audit log as expected:

    image-20250213-094631.png

    Issue 3 - When Item has filled call number and location fields update of Holding’s call number or location fields is tracked in item’s audit log.
    For example Item has filled following fields:

    image-20250213-095206.png

    And user editing same fields but in Holdings record:

    image-20250213-095255.png

    This change (in Holdings record) is tracked by Item’s audit log

    image-20250213-095328.png

    Issue 4 - Bound with action is tracked in Item

    image-20250213-100559.png
    image-20250213-100507.png

    Issue 5 - When holdings is moved to another Instance this change is tracked in Item’s audit log (probably it’s the same issue as issue 2):

    image-20250213-101107.png

Pavlo Smahin January 29, 2025 at 10:38 AM

Blocked by requirements finalizing.

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Spitfire

Fix versions

Release

Sunflower (R1 2025)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created January 10, 2025 at 9:42 AM
Updated March 14, 2025 at 3:51 AM
Resolved February 18, 2025 at 6:41 PM
TestRail: Cases
TestRail: Runs

Flag notifications