package models

import "time"

type SenlinAgentTask struct {
	ID                      uint    `gorm:"primaryKey"`
	Identity                string  `gorm:"type:char(36);uniqueIndex"`
	ProjectID               uint    `gorm:"index;not null"`
	ProjectIdentity         string  `gorm:"type:char(36);index"`
	CreatedBy               uint    `gorm:"index;not null"`
	CreatedByIdentity       string  `gorm:"type:char(36);index"`
	AssigneeID              *uint   `gorm:"index"`
	AssigneeIdentity        *string `gorm:"type:char(36);index"`
	TagID                   *uint   `gorm:"index"`
	TagIdentity             *string `gorm:"type:char(36);index"`
	SourceInboxItemID       *uint   `gorm:"index"`
	SourceInboxItemIdentity *string `gorm:"type:char(36);index"`
	Title                   string  `gorm:"not null"`
	Description             string
	Status                  string `gorm:"not null;default:open"`
	SortOrder               int    `gorm:"not null;default:0"`
	DueAt                   *time.Time
	CreatedAt               time.Time
	UpdatedAt               time.Time
}

func (SenlinAgentTask) TableName() string {
	return "senlin_agent_tasks"
}
