AuditLog.Event (AuditLog v0.1.0)

Copy Markdown View Source

The stored representation of one semantic audit event.

Construct events through AuditLog.record/5 or AuditLog.record!/5.

occurred_at is PostgreSQL's transaction start time. Events written in one transaction therefore share it. The field is not the insertion time, commit time, or proof of causal order.

Actor and subject identities are durable text snapshots without foreign keys. correlation_id groups one operation; causation_id identifies a direct cause when known. subject_version_at may identify an exact temporal row version and has a different meaning from occurred_at.

Summary

Types

t()

@type t() :: %AuditLog.Event{
  __meta__: term(),
  action: String.t(),
  actor_id: String.t(),
  actor_label: String.t() | nil,
  actor_type: String.t(),
  causation_id: Ecto.UUID.t() | nil,
  correlation_id: Ecto.UUID.t(),
  id: Ecto.UUID.t(),
  metadata: map(),
  occurred_at: DateTime.t(),
  reason: String.t() | nil,
  subject_id: String.t(),
  subject_type: String.t(),
  subject_version_at: DateTime.t() | nil
}