package ticket

import (
	"time"

	modbase "github.com/tidbcloud/aisupport/services/ticket-manager/models/base"
)

type TimelineEvent struct {
	ID           modbase.ID `gorm:"primary_key;not null"`
	TicketID     modbase.ID `gorm:"column:ticket_id;type:int;not null"`
	EventType    string     `gorm:"column:event_type;type:varchar(128);not null"`
	OccurredAt   time.Time  `gorm:"column:occurred_at;type:datetime(3);not null"`
	ActorType    string     `gorm:"column:actor_type;type:varchar(64);not null"`
	ActorID      string     `gorm:"column:actor_id;type:varchar(255);not null"`
	Source       string     `gorm:"column:source;type:varchar(64);not null"`
	Summary      string     `gorm:"column:summary;type:text;not null"`
	DetailsURL   string     `gorm:"column:details_url;type:text;not null"`
	MetadataJSON string     `gorm:"column:metadata_json;type:json;not null"`
}

func (TimelineEvent) TableName() string {
	return "timeline_events"
}
