task_log.go 887 B

123456789101112131415161718
  1. package model
  2. import "time"
  3. // TaskLog records the execution of a plugin or processor run.
  4. type TaskLog struct {
  5. ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
  6. TaskType string `gorm:"size:50;not null;index" json:"task_type"` // collect / clean
  7. PluginName string `gorm:"size:100" json:"plugin_name"`
  8. Status string `gorm:"size:20;default:'pending';index" json:"status"` // pending / running / completed / failed / stopped
  9. ItemsProcessed int `gorm:"default:0" json:"items_processed"`
  10. MerchantsAdded int `gorm:"default:0" json:"merchants_added"`
  11. ErrorsCount int `gorm:"default:0" json:"errors_count"`
  12. StartedAt *time.Time `json:"started_at"`
  13. FinishedAt *time.Time `json:"finished_at"`
  14. Detail string `gorm:"type:text" json:"detail"`
  15. CreatedAt time.Time `json:"created_at"`
  16. }