package models import "time" type User struct { ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` CreatedAt time.Time `json:"created_at"` // NtfyTopic is where this user's push notifications go. Nil means they get // none of their own; incidents assigned to them fall back to the configured // fallback topic instead. NtfyTopic *string `json:"ntfy_topic,omitempty"` // IsAdmin is the system administrator flag: managing users and API keys. // Not omitempty — a client has to be able to tell "false" from "this server // is too old to have the field", and the web UI decides what to show from // it. IsAdmin bool `json:"is_admin"` } type APIKey struct { ID int64 `json:"id"` UserID int64 `json:"user_id"` Name string `json:"name"` CreatedAt time.Time `json:"created_at"` LastUsedAt *time.Time `json:"last_used_at,omitempty"` Key string `json:"key,omitempty"` // populated only on creation, never stored }