Entity Audit

The entity audit add-on allows developers to track changes to entities. fastCode has leveraged Javers (https://www.javers.org), an object auditing and diff framework for Java, to build this add-on.

Changes that are captured include the creation, updates, and delete operations. The previous state and the current state are tracked and stored in the application's database tables. This module helps developers better debug an enterprise application that has been deployed to production.

Each entity that needs to be audited is specified in the AuditController.java file. Additionally, the Spring Data repository for that entity is annotated with @JaversSpringDataAuditable annotation.

The entity audit add-on has both a back-end ReST API and a front-end Angular client.

Back-end ReST API

At a high-level, there are only two distinct operations, one to fetch the changes for a specific entity and another to fetch changes to all entities.

Front-end Client

fastCode provides a front-end UI to easily track the changes to entities. The front-end UI calls the back-end ReST API methods of entity audit to fetch data. The screenshot below shows the entity audit screen located under the Administration category of the UI.

The columns of the screen are as follows:

Entity: Name of the entity that was changed

Entity Id: The Id for the specific entity that was changed

Change Type: The type of change on the entity.

There are three main types of Changes:

PropertyChange — most common — a changed property (field or getter).

PropertyChange has the following subtypes:

ContainerChange — list of changed items in Set, List or Array,
MapChange — list of changed Map entries,
ReferenceChange — changed Entity reference,
ValueChange — changed Primitive or Value

Change Author: The user that made the change

Change Date: The timestamp when the change was made

Property Name: If a property was changed, the name of the property

Previous Value: If a property was changed, the previous value of the property

Current Value: If a property was changed, the current value of the property