droboticflow/internal/domain/workflow_release.go

66 lines
4.5 KiB
Go

package domain
type WorkflowReleaseRecord struct {
UsesPublicSupplierPool bool `json:"usesPublicSupplierPool,omitempty" bson:"-"`
ID string `json:"id" bson:"id"`
OrganizationID string `json:"organizationId" bson:"organizationId"`
TemplateID string `json:"templateId" bson:"templateId"`
Version int `json:"version" bson:"version"`
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"description"`
Type WorkflowType `json:"type" bson:"type"`
Kind WorkflowKind `json:"kind" bson:"kind"`
ExecutionScope WorkflowExecutionScope `json:"executionScope" bson:"executionScope"`
ScanConfig *ScanConfig `json:"scanConfig,omitempty" bson:"scanConfig,omitempty"`
Hyperparams []HyperParam `json:"hyperparams,omitempty" bson:"hyperparams,omitempty"`
MaxConcurrentRuns int `json:"maxConcurrentRuns,omitempty" bson:"maxConcurrentRuns,omitempty"`
NodeTimeoutSeconds int `json:"nodeTimeoutSeconds,omitempty" bson:"nodeTimeoutSeconds,omitempty"`
RunTimeoutSeconds int `json:"runTimeoutSeconds,omitempty" bson:"runTimeoutSeconds,omitempty"`
MaxRetryAttempts int `json:"maxRetryAttempts,omitempty" bson:"maxRetryAttempts,omitempty"`
RetryBackoffSeconds int `json:"retryBackoffSeconds,omitempty" bson:"retryBackoffSeconds,omitempty"`
Schedule *WorkflowSchedule `json:"schedule,omitempty" bson:"schedule,omitempty"`
WorkflowInputs []WorkflowInputDefinition `json:"workflowInputs,omitempty" bson:"workflowInputs,omitempty"`
ArtifactStorage *ArtifactStoragePolicy `json:"artifactStorage,omitempty" bson:"artifactStorage,omitempty"`
Nodes []WorkflowNode `json:"nodes" bson:"nodes"`
Edges []WorkflowEdge `json:"edges" bson:"edges"`
Capabilities []string `json:"capabilities,omitempty" bson:"capabilities,omitempty"`
RequiredPluginIDs []string `json:"requiredPluginIds,omitempty" bson:"requiredPluginIds,omitempty"`
ContentDigest string `json:"contentDigest" bson:"contentDigest"`
ReleaseNotes string `json:"releaseNotes,omitempty" bson:"releaseNotes,omitempty"`
PublishedByUserID string `json:"publishedByUserId" bson:"publishedByUserId"`
PublishedAt string `json:"publishedAt" bson:"publishedAt"`
CreatedAt string `json:"createdAt" bson:"createdAt"`
}
type ProjectWorkflowInstanceStatus string
const (
ProjectWorkflowInstanceActive ProjectWorkflowInstanceStatus = "active"
ProjectWorkflowInstanceSuperseded ProjectWorkflowInstanceStatus = "superseded"
)
type ProjectWorkflowInstanceRecord struct {
ID string `json:"id" bson:"id"`
OrganizationID string `json:"organizationId" bson:"organizationId"`
ProjectID string `json:"projectId" bson:"projectId"`
ReleaseID string `json:"releaseId" bson:"releaseId"`
ReleaseVersion int `json:"releaseVersion" bson:"releaseVersion"`
SourceTemplateID string `json:"sourceTemplateId" bson:"sourceTemplateId"`
WorkflowID string `json:"workflowId" bson:"workflowId"`
SupplierID string `json:"supplierId,omitempty" bson:"supplierId,omitempty"`
Status ProjectWorkflowInstanceStatus `json:"status" bson:"status"`
SupersedesInstanceID string `json:"supersedesInstanceId,omitempty" bson:"supersedesInstanceId,omitempty"`
CreatedByUserID string `json:"createdByUserId" bson:"createdByUserId"`
CreatedAt string `json:"createdAt" bson:"createdAt"`
UpdatedAt string `json:"updatedAt" bson:"updatedAt"`
}
type WorkflowReleaseQuery struct {
TemplateID string
}
type ProjectWorkflowInstanceQuery struct {
ProjectID string
Status ProjectWorkflowInstanceStatus
}