From 47690c58d9e9a509cab14e013c7012648e366043 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Mon, 20 Jul 2026 12:49:43 +0100 Subject: [PATCH] fix: Fixed workflow id --- server/internal/models/workflow.go | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/server/internal/models/workflow.go b/server/internal/models/workflow.go index 6b8e2ad..8789a0c 100644 --- a/server/internal/models/workflow.go +++ b/server/internal/models/workflow.go @@ -1,18 +1,22 @@ package models -import "time" +import ( + "time" + + "go.mongodb.org/mongo-driver/v2/bson" +) type WorkflowStep struct { - ID string `bson:"_id,omitempty" json:"-"` - StepID string `bson:"step_id" json:"step_id"` - Name string `bson:"name" json:"name"` - Description string `bson:"description" json:"description"` - Interpreter string `bson:"interpreter" json:"interpreter"` // "bash" | "powershell" - Script string `bson:"script" json:"script"` - DeclaredOutputs []string `bson:"declared_outputs" json:"declared_outputs"` - SecretRefs []string `bson:"secret_refs" json:"secret_refs"` - CreatedAt time.Time `bson:"created_at" json:"created_at"` - UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` + ID bson.ObjectID `bson:"_id,omitempty" json:"-"` + StepID string `bson:"step_id" json:"step_id"` + Name string `bson:"name" json:"name"` + Description string `bson:"description" json:"description"` + Interpreter string `bson:"interpreter" json:"interpreter"` // "bash" | "powershell" + Script string `bson:"script" json:"script"` + DeclaredOutputs []string `bson:"declared_outputs" json:"declared_outputs"` + SecretRefs []string `bson:"secret_refs" json:"secret_refs"` + CreatedAt time.Time `bson:"created_at" json:"created_at"` + UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` } type WorkflowStepRef struct { @@ -29,7 +33,7 @@ type StepOverride struct { } type Workflow struct { - ID string `bson:"_id,omitempty" json:"-"` + ID bson.ObjectID `bson:"_id,omitempty" json:"-"` WorkflowID string `bson:"workflow_id" json:"workflow_id"` Name string `bson:"name" json:"name"` TargetServerIDs []string `bson:"target_server_ids" json:"target_server_ids"` @@ -73,7 +77,7 @@ type ServerRun struct { } type WorkflowRun struct { - ID string `bson:"_id,omitempty" json:"-"` + ID bson.ObjectID `bson:"_id,omitempty" json:"-"` RunID string `bson:"run_id" json:"run_id"` WorkflowID string `bson:"workflow_id" json:"workflow_id"` Name string `bson:"name" json:"name"`