package model

import (
	"time"

	"github.com/google/uuid"
)

type Tweet struct {
	ID            uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
	XTweetID      string    `gorm:"type:varchar(255);uniqueIndex:idx_tweets_x_tweet_id;not null" json:"x_tweet_id"`
	AuthorID      string    `gorm:"type:varchar(255)" json:"author_id"`
	AuthorHandle  string    `gorm:"type:varchar(255)" json:"author_handle"`
	Content       string    `gorm:"type:text;not null" json:"content"`
	PostedAt      time.Time `json:"posted_at"`
	LikeCount     int       `gorm:"default:0" json:"like_count"`
	RetweetCount  int       `gorm:"default:0" json:"retweet_count"`
	ReplyCount    int       `gorm:"default:0" json:"reply_count"`
	HeatScore     float64   `gorm:"default:0.0;index:idx_tweets_heat_score" json:"heat_score"`
	CrawlQueue    string    `gorm:"type:varchar(20);default:'normal';index:idx_tweets_crawl_queue" json:"crawl_queue"`
	IsProcessed   bool      `gorm:"default:false" json:"is_processed"`
	LastCrawledAt time.Time `gorm:"index:idx_tweets_crawl_queue" json:"last_crawled_at"`
	CreatedAt     time.Time `json:"created_at"`
}
