Audit Logging Blueprint
Immutable tamper-evident event log structure — every state change recorded with full before/after context
AuditEvent Schema
| Field | Type | Required | Description |
|---|---|---|---|
| id | uuid | Unique audit event identifier | |
| actor_id | string | User ID who performed the action | |
| actor_name | string | Display name of the actor at time of action | |
| action | enum | create | update | delete | import | export | approve | reject | login | logout | rollback | bulk_update | stock_movement | settings_change | |
| entity_type | string | Entity class affected (Product, Order, ImportBatch, etc.) | |
| entity_id | string | optional | ID of the specific entity instance affected |
| before_json | string (JSON) | optional | Serialized state before the change — null for creates |
| after_json | string (JSON) | optional | Serialized state after the change — null for deletes |
| ip_address | string | optional | IP address of the request origin |
| user_agent | string | optional | Browser/client user agent string |
| status | enum | success | failed | partial | |
| notes | string | optional | Optional human-readable context or reason code |
| created_date | datetime (auto) | Immutable creation timestamp — set by platform |
Example Audit Events— click to expand before/after state
Immutability Guarantee
AuditEvent records are write-once. No update or delete operations are permitted on this entity. The Base44 entity layer enforces this via role-restricted operations — only create is permitted for any role. Rollback operations create new corrective AuditEvent records rather than modifying existing ones.