-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
featureNew feature or requestNew feature or request
Description
Implementation Order: 1 of 8 (start here)
Feature: Schedules — Recurring automated tasks for AI agent teams
Summary
Add the database models for the Schedules feature. These are the foundation for all subsequent issues.
Models
Schedule
type Schedule struct {
ID string `gorm:"primaryKey;size:36" json:"id"`
Name string `gorm:"not null;size:255" json:"name"`
TeamID string `gorm:"not null;size:36" json:"team_id"`
Prompt string `gorm:"type:text;not null" json:"prompt"`
CronExpression string `gorm:"not null;size:100" json:"cron_expression"`
Timezone string `gorm:"not null;size:50;default:'UTC'" json:"timezone"`
Enabled bool `gorm:"default:true" json:"enabled"`
LastRunAt *time.Time `json:"last_run_at"`
NextRunAt *time.Time `json:"next_run_at"`
Status string `gorm:"size:20;default:'idle'" json:"status"` // idle | running | error
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}ScheduleRun
type ScheduleRun struct {
ID string `gorm:"primaryKey;size:36" json:"id"`
ScheduleID string `gorm:"not null;index" json:"schedule_id"`
TeamDeploymentID string `gorm:"size:36" json:"team_deployment_id"` // links to the team instance for viewing conversation
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
Status string `gorm:"size:20;default:'running'" json:"status"` // running | success | failed | timeout
Error string `gorm:"type:text" json:"error"`
}Acceptance Criteria
- Both models added to
internal/models/models.go - AutoMigrate includes both new models
- Foreign key:
ScheduleRun.ScheduleID→Schedule.ID - Foreign key:
Schedule.TeamID→Team.ID - Status enums documented in code comments
- Unit tests for model creation and relationships
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request
Type
Projects
Status
Todo