[Instance, Holdings, Item Audit] Calculate entity diff on event consumption
Description
Environment
Potential Workaround
Attachments
- 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
blocks
has to be done after
relates to
Checklist
hideActivity
Valery_Pilko February 18, 2025 at 8:11 AM
Re-tested on https://folio-etesting-snapshot2-diku.ci.folio.org/:
Issue 1 - Fixed
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.
Issue 4 - Fixed.
Issue 5 - Fixed.
Issue 6 - Fixed.
Valery_Pilko February 13, 2025 at 12:06 PM
Hi @Christine Schultz-Richert - thank you!
@Pavlo Smahin 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 @Valery_Pilko - 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 AMEdited
Verified on Eureka Sprint testing envs, following cases are verified and works as expected:
Created Instance:
Update not repeatable field of Instance:
Add a field:
3 repeatable fields are added (contributors):
Update 1 repeatable field (contributor):
Cleared/Removed field:
Add/remove tags:
Adding/editing/removing Holdings and Items are not tracked in Instance audit log.
Holdings create:
Holdings field update:
Holdings repeatable field update:
Item create:
Item move to other holdings is tracked in Item:
Holdings move to other Instance is tracked in Holdings:
Update ownership ECS - item from tenant 1 is deleted, item in tenant 2 is created:
Create of Instance/Holdings/Item via Orders app is tracked.
Status of Item change by Receiving app is tracked:Status if Item record change by Requests app is logged:
Hey @Christine Schultz-Richert - 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:
Hey @Pavlo Smahin 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.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.NOTE: call number fields and location added/updated/deleted in Holdings record are tracked in Item’s audit log as expected:
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:And user editing same fields but in Holdings record:
This change (in Holdings record) is tracked by Item’s audit log
Issue 4 - Bound with action is tracked in Item
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):
Pavlo Smahin January 29, 2025 at 10:38 AM
Blocked by requirements finalizing.
Entity diff should be calculate on event consumption for instance, holings, item records and populated into appropriate database column.
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 )
Changes in metadata should be ignored
Audit records related to the "create" event should contain only "added" sub-object without previous values
Audit records related to "delete" events should contain no body
Addititional notes:
Investigate https://javers.org/documentation/ library for diff calculation.