Broadleaf Microservices
  • v1.0.0-latest-prod

Audit Services Data Model

Data Model

Audit Services Data Model
Figure 1. The following model shows the key tables and their relationships within the Audit Service.

AuditHeaders

AuditHeaders contain summary information for an audit record.

BLC_AUDIT_HEADER

Field Definition

CONTEXT_ID

Logical ID. Allows for sandbox versions.

CREATED_DATE

The time at which the change was reported to the system. Required.

EVENT_TYPE_NAME

In the case of Trackable entity change, The name of the top-level entity that changed, which is typically snake-cased and capitalized, i.e., "PRODUCT". Arbitrary audit events may use this field to represent the type of event. Required.

ENTITY_TYPE

Fully qualified class name of the top-level entity being changed. Optional. For audit changes to a particular entity.

ENTITY_REF

Identifying reference to the entity. Usually a contextId for Trackable domain. Optional. For audit changes to a particular entity.

CONTAINER_EVENT_TYPE_NAME

In the case of Trackable entity change, The name of the containing entity, which is typically snake-cased and capitalized, i.e., "PRODUCT". This is a grouping concept for correlating multiple related changes to a singular concept. For example, a marketing message change, which from the admin perspective looks like a change to an offer. Optional.

CONTAINER_REF

Identifying reference to the containing entity. Usually a contextId for Trackable domain. Optional.

CUSTOMER_ID

Identifier for a customer entity. Useful for identifying a customer related to the change. Optional. For audit events related to a customer.

ACCOUNT_ID

Identifier for an account entity. Useful for identifying an account related to the change. Optional. For audit events related to an account.

DETAIL_TYPE

The type of detail information associated with this audit event. Default is DetailType#NONE.

EXPIRY_DATE

Date on which the header reader is set to expire. Optional.

TENANT_ID

The tenant to whom this audit record belongs. Required.

CATALOG_ID

The catalog to which this audit record belongs. Optional. For audit events related to a catalog discriminated entity.

APPLICATION_ID

The application to which this audit record belongs. Optional. For audit events related to an application discriminated entity.

ATTRIBUTES

Any additional information, possibly required in extension scenarios. Optional.

PRIMARY_AUTHOR

The primary author of the change. Optional. For DetailType#CHANGE_DETAIL events, this field generally represents the approver of the overall entity change. See AuditEventDetail#getAuthor() for more specific ownership of field-level changes. For non-CHANGE_DETAIL events, this field represents the user driving the event.

SECONDARY_AUTHOR

Any additional author for the change. Optional. For {@link DetailType#CHANGE_DETAIL} events, this field generally represents the user engaged the deployment.

AuditDetails

AuditDetails contain Details about a specific change.

BLC_AUDIT_DETAIL

Field Definition

CONTEXT_ID

Logical ID. Allows for sandbox versions.

HEADER_ID

The id of the related header record. Required.

CUSTOMER_ID

Identifier for a customer entity. Useful for identifying a customer related to the change. Optional. For audit events related to a customer.

ACCOUNT_ID

Identifier for an account entity. Useful for identifying an account related to the change. Optional. For audit events related to an account.

CREATED_DATE

The timestamp at which the field change took place

AUTHOR

The author of the change. May be an admin user, or an identifier noting an automated system process.

BEFORE_VAL

The value for the field before the change was made. Json representation. May be simple, or a more complex structure - like a list.

AFTER_VAL

The value for the field after the change was made. Json representation. May be simple, or a more complex structure - like a list.

RAW_DETAIL_VAL

Raw information about the change.

REPOSITORY_FIELD

The name of the field on the repository domain. This is generally the name of a field in a JPA domain class.

PROJECTION_FIELD

The name of the field in a projection domain. This is generally the name of the field from domain serialized to and deserialized from JSON at the microservice endpoint API. Often this is the same as the repositoryField, but is not required to be.

JAVA_TYPE

The fully qualified classname of the Java type for this field.

CHANGE_TYPE

The operation type that mutated this field value. Maps to com.broadleafcommerce.data.tracking.core.type.OperationType.

MESSAGE

Optional message included giving more information about the change. When included, usually noted by the admin user making the change.

ATTRIBUTES

Any additional information, possibly required in extension scenarios