feat: complete SOP execution workflow

This commit is contained in:
Eric 1549169735@qq.com
2026-08-09 00:29:26 +08:00
parent e32025d2ca
commit c5ab886b70
63 changed files with 1229 additions and 215 deletions

View File

@@ -0,0 +1,22 @@
package sop
import (
"encoding/json"
"testing"
"gorm.io/datatypes"
)
func TestWithKnowledgeVersionPreservesConfiguration(t *testing.T) {
updated, err := withKnowledgeVersion(datatypes.JSON([]byte(`{"knowledge_card_id":12,"display":"full"}`)), 34)
if err != nil {
t.Fatal(err)
}
var value map[string]interface{}
if err := json.Unmarshal(updated, &value); err != nil {
t.Fatal(err)
}
if value["knowledge_card_id"] != float64(12) || value["knowledge_card_version_id"] != float64(34) || value["display"] != "full" {
t.Fatalf("unexpected knowledge config: %#v", value)
}
}