31 lines
733 B
Go
31 lines
733 B
Go
package entities
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/json"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"github.com/google/uuid"
|
||
|
|
)
|
||
|
|
|
||
|
|
// AuditLog is one change to EnakGame configuration or state: who made it, to what,
|
||
|
|
// from what, to what (docs/rfc-enakgame.md §5.9, §13). Append-only.
|
||
|
|
type AuditLog struct {
|
||
|
|
ID uuid.UUID
|
||
|
|
OrganizationID uuid.UUID
|
||
|
|
// USER or SYSTEM.
|
||
|
|
ActorType string
|
||
|
|
// The admin for USER; nil for SYSTEM.
|
||
|
|
ActorID *uuid.UUID
|
||
|
|
EntityType string
|
||
|
|
EntityID uuid.UUID
|
||
|
|
Action string
|
||
|
|
// JSON snapshots of the entity; nil when there was nothing before (a create) or
|
||
|
|
// after (a delete).
|
||
|
|
Before json.RawMessage
|
||
|
|
After json.RawMessage
|
||
|
|
Reason *string
|
||
|
|
// admin_api, budget_controller, session_job, ...
|
||
|
|
Source string
|
||
|
|
CreatedAt time.Time
|
||
|
|
}
|