ChangeHistory

Universal audit trail tracking all field-level modifications with before/after values for any entity type. Supports regulatory compliance (GDPR Article 30, SOX, HIPAA) across all business entities.

10 properties
Schema

Properties

PropertyTypeModeDescriptionRequired
entityKernelModel
stored

Reference to the model/entity type that was modified

Required
entityIdstring
stored

Unique identifier of the entity instance that was modified

Example: "CUST-2024-00123"

Required
fieldNamestring
stored

Name of the field that was modified

Example: "status"

Required
oldValuestring
stored

Previous value before the change (serialized as string)

Example: "active"

Optional
newValuestring
stored

New value after the change (serialized as string)

Example: "inactive"

Required
changeReasonstring
stored

Business reason or justification for the change

Example: "Customer requested account suspension"

Optional
changeTypestring
enum

Type of change operation

Values: create, update, delete

Example: "update"

Required
ipAddressstring
stored

IP address from which the change was made

Example: "192.168.1.100"

Optional
userAgentstring
stored

Browser/client user agent string for additional context

Example: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"

Optional
sessionIdstring
stored

Session identifier for grouping related changes

Example: "sess_abc123xyz"

Optional

Examples

Example 1

{
  "@type": "ChangeHistory",
  "entity": {
    "@type": "KernelModel",
    "name": "Customer"
  },
  "entityId": "CUST-2024-00123",
  "fieldName": "status",
  "oldValue": "active",
  "newValue": "suspended",
  "changeReason": "Customer requested temporary account suspension",
  "changeType": "update",
  "ipAddress": "192.168.1.100",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
  "sessionId": "sess_abc123xyz"
}

Example 2

{
  "@type": "ChangeHistory",
  "entity": {
    "@type": "KernelModel",
    "name": "Customer"
  },
  "entityId": "CUST-2024-00789",
  "fieldName": "creditLimit",
  "oldValue": "50000.00",
  "newValue": "100000.00",
  "changeReason": "Credit review approved - increased limit for enterprise customer",
  "changeType": "update",
  "ipAddress": "10.0.0.50",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/119.0.0.0",
  "sessionId": "sess_xyz789abc"
}

Example 3

{
  "@type": "ChangeHistory",
  "entity": {
    "@type": "KernelModel",
    "name": "Product"
  },
  "entityId": "PROD-2024-05678",
  "fieldName": "price",
  "oldValue": "99.99",
  "newValue": "79.99",
  "changeReason": "Black Friday promotion - 20% discount applied",
  "changeType": "update",
  "ipAddress": "10.0.0.25",
  "userAgent": "PostmanRuntime/7.35.0",
  "sessionId": "api_batch_001"
}

Example 4

{
  "@type": "ChangeHistory",
  "entity": {
    "@type": "KernelModel",
    "name": "Employee"
  },
  "entityId": "EMP-2024-0042",
  "fieldName": "department",
  "oldValue": "Sales",
  "newValue": "Marketing",
  "changeReason": "Internal transfer approved by HR",
  "changeType": "update",
  "ipAddress": "192.168.10.50",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Edge/119.0.0.0",
  "sessionId": "sess_hr_transfer_123"
}