diff --git a/internal/docgov/state_machine.go b/internal/docgov/state_machine.go index d75ac8ef..8dd09008 100644 --- a/internal/docgov/state_machine.go +++ b/internal/docgov/state_machine.go @@ -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