feat(docgov): record duty_policy on lifecycle audit details
Surface the document duty mode on submit/review/approve transitions for consistent logs under author_only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -83,7 +83,7 @@ func (sm *StateMachine) TransitionSubmitForReview(doc *DocumentRecord, actorID i
|
||||
ActorRole: actorRole,
|
||||
FromState: fromState,
|
||||
ToState: toState,
|
||||
Details: map[string]any{"timestamp": now},
|
||||
Details: map[string]any{"timestamp": now, "duty_policy": doc.DutyPolicy},
|
||||
CreatedAt: now,
|
||||
}, nil
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func (sm *StateMachine) TransitionReviewApprove(doc *DocumentRecord, actorID int
|
||||
ActorRole: actorRole,
|
||||
FromState: fromState,
|
||||
ToState: toState,
|
||||
Details: map[string]any{"comment": comment, "timestamp": now},
|
||||
Details: map[string]any{"comment": comment, "timestamp": now, "duty_policy": doc.DutyPolicy},
|
||||
CreatedAt: now,
|
||||
}, nil
|
||||
}
|
||||
@@ -169,6 +169,7 @@ func (sm *StateMachine) TransitionReviewReject(doc *DocumentRecord, actorID int6
|
||||
Details: map[string]any{
|
||||
"reject_reason": trimmedReason,
|
||||
"timestamp": now,
|
||||
"duty_policy": doc.DutyPolicy,
|
||||
},
|
||||
CreatedAt: now,
|
||||
}, nil
|
||||
@@ -207,8 +208,9 @@ func (sm *StateMachine) TransitionApproverApprove(doc *DocumentRecord, actorID i
|
||||
FromState: fromState,
|
||||
ToState: toState,
|
||||
Details: map[string]any{
|
||||
"comment": comment,
|
||||
"timestamp": now,
|
||||
"comment": comment,
|
||||
"timestamp": now,
|
||||
"duty_policy": doc.DutyPolicy,
|
||||
},
|
||||
CreatedAt: now,
|
||||
}, nil
|
||||
@@ -276,6 +278,7 @@ func (sm *StateMachine) TransitionApproverReject(doc *DocumentRecord, actorID in
|
||||
"reject_reason": trimmedReason,
|
||||
"rollback_to": toState,
|
||||
"timestamp": now,
|
||||
"duty_policy": doc.DutyPolicy,
|
||||
},
|
||||
CreatedAt: now,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user