package entity

import (
	"campaign-pool-be/app/database/entity/users"
	"time"
)

type AIChatSessions struct {
	ID           uint         `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	SessionID    string       `json:"session_id" gorm:"type:varchar;not null;unique;index"`
	UserID       uint         `json:"user_id" gorm:"type:int4;not null;index"`
	AgentID      string       `json:"agent_id" gorm:"type:varchar;not null"`
	Title        string       `json:"title" gorm:"type:varchar;not null"`
	MessageCount int          `json:"message_count" gorm:"type:int4;default:0"`
	IsActive     bool         `json:"is_active" gorm:"type:bool;default:true"`
	CreatedAt    time.Time    `json:"created_at" gorm:"default:now()"`
	UpdatedAt    time.Time    `json:"updated_at" gorm:"default:now()"`
	User         *users.Users `json:"user" gorm:"foreignKey:UserID;references:ID"`
}
