Constraint: 在线热修前必须保存当前迭代分支全部有效代码进展 Confidence: medium Scope-risk: broad Directive: 后续修改需保持审计事件与业务事务边界一致 Tested: git diff --cached --check Not-tested: 未运行全量测试,提交用于切换分支前保存既有工作
41 lines
967 B
Go
41 lines
967 B
Go
package approval
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// AuditChange 描述通用审批链路一次实际状态变化。
|
|
type AuditChange struct {
|
|
EventID string
|
|
ActionCode string
|
|
Summary string
|
|
InstanceID uint
|
|
BusinessType string
|
|
BusinessID uint
|
|
SubmitterAccountID uint
|
|
SubmitterSnapshot []byte
|
|
Provider string
|
|
BeforeExternalRef string
|
|
AfterExternalRef string
|
|
CorrelationID string
|
|
ParentEventID string
|
|
BeforeStatus *int
|
|
AfterStatus *int
|
|
ActorKind string
|
|
ActorID string
|
|
ActorName string
|
|
Source string
|
|
Result string
|
|
ErrorSummary string
|
|
Decision string
|
|
IntegrationIDs []string
|
|
OutboxEventID string
|
|
}
|
|
|
|
// AuditWriter 在审批事实事务中追加统一 Audit Event。
|
|
type AuditWriter interface {
|
|
WriteApproval(ctx context.Context, tx *gorm.DB, change AuditChange) error
|
|
}
|