tâches planifiées : prompts cron persistés, outil scheduler, conversations liées aux tâches, rattrapage des exécutions manquées au redémarrage (go-cron MissedRunOnce)
This commit is contained in:
1 parent
bedb6c98e7
commit
058370830f
71 files changed
+1627
-100
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
// statuts d'une tâche planifiée
|
||||
TaskStatusActive = "active"
|
||||
TaskStatusDone = "done"
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
ID string `db:"id" json:"id"`
|
||||
TeamID string `db:"team_id" json:"teamId"`
|
||||
ModelID string `db:"model_id" json:"modelId"`
|
||||
Label string `db:"label" json:"label"`
|
||||
Prompt string `db:"prompt" json:"prompt"`
|
||||
Cron string `db:"cron" json:"cron"`
|
||||
Repeat bool `db:"repeat" json:"repeat"`
|
||||
Status string `db:"status" json:"status"`
|
||||
NextDatetime *time.Time `db:"next_datetime" json:"nextDatetime"`
|
||||
LastDatetime *time.Time `db:"last_datetime" json:"lastDatetime"`
|
||||
DateCreated time.Time `db:"_date_created" json:"_date_created"`
|
||||
DateUpdated *time.Time `db:"_date_updated" json:"_date_updated"`
|
||||
VersionId string `db:"_version" json:"_version"`
|
||||
}
|
||||
|
||||
type TaskRepository interface {
|
||||
ListTasks(userID string, teamID string) ([]*Task, error)
|
||||
ListActiveTasks() ([]*Task, error)
|
||||
GetTaskByID(userID string, teamID string, id string) (*Task, error)
|
||||
CreateTask(task *Task) (*Task, error)
|
||||
UpdateTask(task *Task) (*Task, error)
|
||||
DeleteTask(userID string, teamID string, id string) error
|
||||
FirstUserOfTeam(teamID string) (string, error)
|
||||
}
|
||||
Reference in new issue
Block a user