package model import "time" // TaskDetail stores a single operation within a task execution. // Every search query, URL crawl, snippet extraction, and merchant callback is recorded, // making the entire task fully reproducible and debuggable. // // Key fields for traceability: // - Depth: 0 = serper result, 1 = crawled from serper link, 2 = sub-page from depth-1, etc. // - ParentURL: which page led to this operation (trace the discovery chain) // - Input: raw content received (snippet text, page HTML summary, message text) // - Output: what was extracted/decided (usernames, classification, cleaned data) type TaskDetail struct { ID uint `gorm:"primaryKey;autoIncrement" json:"id"` TaskID uint `gorm:"index;not null" json:"task_id"` Seq int `gorm:"not null" json:"seq"` Action string `gorm:"size:50;not null;index" json:"action"` URL string `gorm:"size:2048" json:"url"` ParentURL string `gorm:"size:2048" json:"parent_url"` Depth int `gorm:"default:0" json:"depth"` Input string `gorm:"type:mediumtext" json:"input"` Output string `gorm:"type:mediumtext" json:"output"` Status string `gorm:"size:20;not null;default:'ok'" json:"status"` Duration int `gorm:"default:0" json:"duration_ms"` Extra string `gorm:"type:text" json:"extra"` CreatedAt time.Time `json:"created_at"` }