narasiahli-be/app/database/entity/chat_schedules.entity.go

28 lines
1.4 KiB
Go

package entity
import (
"narasi-ahli-be/app/database/entity/users"
"time"
)
type ChatSchedules struct {
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
ChatSessionID uint `json:"chat_session_id" gorm:"type:int4;not null;index"`
Title string `json:"title" gorm:"type:varchar(255);not null"`
Description string `json:"description" gorm:"type:text"`
Summary string `json:"summary" gorm:"type:text"`
ScheduledAt time.Time `json:"scheduled_at" gorm:"not null"`
Duration int `json:"duration" gorm:"type:int4;default:60"` // duration in minutes
Status string `json:"status" gorm:"type:varchar(20);not null;default:'scheduled';check:status IN ('scheduled', 'ongoing', 'completed', 'cancelled')"`
IsReminderSent bool `json:"is_reminder_sent" gorm:"default:false"`
ReminderSentAt *time.Time `json:"reminder_sent_at"`
CreatedBy uint `json:"created_by" gorm:"type:int4;not null;index"`
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
// Relationships
ChatSession *ChatSessions `json:"chat_session" gorm:"foreignKey:ChatSessionID;references:ID"`
Creator *users.Users `json:"creator" gorm:"foreignKey:CreatedBy;references:ID"`
Files []*ChatScheduleFiles `json:"files" gorm:"foreignKey:ChatScheduleID;references:ID"`
}