0e7890a465
Run gofmt -w across the backend, normalising the manually-aligned := blocks to the gofmt standard. No code behaviour changes. Add Prettier (+ prettier-plugin-svelte) to the frontend with the SvelteKit default config (tabs, single quotes) so formatting is reproducible, then run it over the whole tree. Add format / format:check npm scripts and a .prettierignore (build output, generated schema.ts, static assets). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
47 lines
896 B
Go
47 lines
896 B
Go
package domain
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// ActionType is a reference entity for auditable user actions.
|
|
type ActionType struct {
|
|
ID int16
|
|
Name string
|
|
}
|
|
|
|
// AuditEntry is a single audit log record.
|
|
type AuditEntry struct {
|
|
ID int64
|
|
UserID int16
|
|
UserName string // denormalized
|
|
Action string // action type name, e.g. "file_create"
|
|
ObjectType *string
|
|
ObjectID *uuid.UUID
|
|
Details json.RawMessage
|
|
PerformedAt time.Time
|
|
}
|
|
|
|
// AuditPage is an offset-based page of audit log entries.
|
|
type AuditPage struct {
|
|
Items []AuditEntry
|
|
Total int
|
|
Offset int
|
|
Limit int
|
|
}
|
|
|
|
// AuditFilter holds filter parameters for querying the audit log.
|
|
type AuditFilter struct {
|
|
UserID *int16
|
|
Action string
|
|
ObjectType string
|
|
ObjectID *uuid.UUID
|
|
From *time.Time
|
|
To *time.Time
|
|
Offset int
|
|
Limit int
|
|
}
|