feat: establish Orbit models, migrations and development baseline

This commit is contained in:
2026-09-17 07:04:21 +08:00
commit 4f2935e36f
84 changed files with 4915 additions and 0 deletions

24
weave/model/step.go Normal file
View File

@@ -0,0 +1,24 @@
package model
import (
core "git.yuntuo.hk/k2safe/orbit/model"
)
// Step 表示实例中的逻辑步骤,指向该步骤当前的激活记录。
// 对应表 weave_steps;这是服务端持久化模型,不直接作为 API 响应。
type Step struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
core.Record
// WorkflowID 所属流程实例标识。
WorkflowID core.ID `db:"workflow_id"`
// Key 定义中的稳定步骤键,在同一流程实例内唯一。
Key string `db:"key"`
// Kind 节点或等待类型,决定由哪类推进规则处理。
Kind NodeKind `db:"kind"`
// State 当前状态;只允许定义的状态转换并配合事务校验。
State StepState `db:"state"`
// CurrentActivationID 当前激活记录,必须属于本实例的本步骤;可为空,表示尚未设置该关联或值。
CurrentActivationID *core.ID `db:"current_activation_id"`
}
func (Step) TableName() string { return "weave_steps" }