package database import "time" // User represents a user in the system type User struct { ID int `json:"id"` GithubID int `json:"github_id"` Username string `json:"username"` Email string `json:"email"` AvatarURL string `json:"avatar_url"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` LastRepo string `json:"last_repo"` } // UserRepo represents a repository associated with a user type UserRepo struct { ID int `json:"id"` UserID int `json:"user_id"` RepoName string `json:"repo_name"` RepoLink string `json:"repo_link"` LastUsedAt time.Time `json:"last_used_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } // AuthToken represents an OAuth token for a provider type AuthToken struct { ID int `json:"id"` UserID int `json:"user_id"` Provider string `json:"provider"` AccessToken string `json:"-"` // Never expose in JSON RefreshToken string `json:"-"` // Never expose in JSON ExpiresAt time.Time `json:"expires_at"` CreatedAt time.Time `json:"created_at"` } // BranchState tracks the state of a user's branch for a repository type BranchState struct { ID int `json:"id"` UserID int `json:"user_id"` RepoFullName string `json:"repo_full_name"` BranchName string `json:"branch_name"` BaseBranch string `json:"base_branch"` LastPushAt time.Time `json:"last_push_at"` HasUncommittedChanges bool `json:"has_uncommitted_changes"` FilePaths string `json:"file_paths"` // JSON array CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } // DraftContent represents auto-saved content type DraftContent struct { ID int `json:"id"` UserID int `json:"user_id"` RepoFullName string `json:"repo_full_name"` FilePath string `json:"file_path"` Content string `json:"content"` ChangeType string `json:"change_type"` // 'edit', 'new_file', 'new_folder', 'rename' OriginalPath string `json:"original_path"` // For renames: old path LastSavedAt time.Time `json:"last_saved_at"` } // CacheStat represents a cache statistics entry type CacheStat struct { ID int `json:"id"` CacheKey string `json:"cache_key"` CacheType string `json:"cache_type"` EventType string `json:"event_type"` UserID *int `json:"user_id,omitempty"` ResponseTimeMs int `json:"response_time_ms"` CreatedAt time.Time `json:"created_at"` }