User Audit Log / Version History
Status | dRaft |
|---|---|
Prod-Ticket |
Summary
Staff users should be able to track changes that have been made to User records, so that they can search for explanations in previous changes in the event of any irregularities or queries.
FOLIO already provides an implementation of a version history in Acquisitions (Orders, Invoices, Organizations) and Inventory. The Users SIG agreed on February 19, 2025, that such functionality is also desired for the Users App. The implementation should be based on the implementation of the inventory audit log.
Functional Requirements
Architecture
Current
Target
Implementation
Summary
The implementation will be based on the inventory audit log. The inventory audit log does not store the whole objects as version history but instead stores only the edited attributes with their previous and new value.
mod-usersalready publishes domain events to Kafka when a user record is editedmod-auditis responsible for consuming events and storing audit logsAdd consumer for domain events
Add configurations for user audit logs
Implement API endpoint for the retrieval of user audit logs
ui-usersdisplays the user UIAdd version history to user
Add audit log configurations to settings page
Assumptions
User Objects are rarely changed (in contrast to inventory entities), therefore there is no need for partitioning of the database table by months
Version History Database Table
CREATE TABLE IF NOT EXISTS user_audit (
event_id UUID PRIMARY KEY,
event_date TIMESTAMP NOT NULL,
user_id UUID NOT NULL,
action VARCHAR NOT NULL,
performed_by UUID,
diff JSONB
);
CREATE INDEX IF NOT EXISTS idx_user_audit_user_id ON user_audit USING BTREE (user_id);Work Breakdown Structure
Mod Stories
Title / Ticket | Description | Module |
|---|---|---|
Implement User Event Consumer |
|
|
Add user audit log retention period |
|
|
Add GET endpoint for user audit logs |
|
|
Add anonymization of editing person |
|
|
Add exclusion of specific fields |
|
|
UI Stories
Title / Ticket | Description | Module |
|---|---|---|
Add user version history view |
|
|
Add user version history retention settings |
|
|
Add setting to enable anonymization of the editing person |
|
|
Add setting to enable exclusion of specific fields |
|
|