Files
stack/ee/orchestration/internal/workflow/workflow.go

28 lines
569 B
Go

package workflow
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type Workflow struct {
bun.BaseModel `bun:"table:workflows"`
ID string `json:"id" bun:",pk"`
Config Config `json:"config"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt"`
}
func New(config Config) Workflow {
now := time.Now().Round(time.Nanosecond)
return Workflow{
ID: uuid.NewString(),
Config: config,
CreatedAt: now,
UpdatedAt: now,
}
}