package models

import "time"

// AuditLog records every state-mutating HTTP request made by an authenticated user.
type AuditLog struct {
	ID           int64     `xorm:"'id' pk autoincr"               json:"id"`
	ActorID      int64     `xorm:"'actor_id' index"               json:"actorId"`
	ActorName    string    `xorm:"'actor_name' varchar(64)"       json:"actorName"`
	Method       string    `xorm:"'method' varchar(10)"           json:"method"`
	Path         string    `xorm:"'path' varchar(500)"            json:"path"`
	StatusCode   int       `xorm:"'status_code'"                  json:"statusCode"`
	IPAddress    string    `xorm:"'ip_address' varchar(45)"       json:"ipAddress"`
	UserAgent    string    `xorm:"'user_agent' varchar(500)"      json:"userAgent"`
	OccurredAt   time.Time `xorm:"'occurred_at' index"            json:"occurredAt"`
}
