feat(t215): add admin order authorization

This commit is contained in:
QiuSW
2026-07-28 12:50:42 +08:00
parent 16c2ea410a
commit 827afc7257
24 changed files with 2688 additions and 113 deletions
@@ -285,6 +285,24 @@ func (service *ExecutionResultService) StoreCandidates(
if err != nil {
return false, internalExecutionResultFailure(err)
}
var readyEvent *domain.TaskEvent
if len(command.Candidates) > 0 {
eventID, err := service.ids.NewID()
if err != nil {
return false, internalExecutionResultFailure(err)
}
actorUserID := identity.UserID
actorDeviceID := identity.DeviceID
readyEvent = &domain.TaskEvent{
ID: eventID,
TaskID: identity.TaskID,
ActorUserID: &actorUserID,
ActorDeviceID: &actorDeviceID,
Type: "CANDIDATES_READY",
Message: "candidates ready for admin confirmation",
OccurredAt: now,
}
}
replayed, err := service.repository.StoreExecutionCandidates(
ctx,
service.write(identity, executionResultCandidatesOperation, requestHash, now),
@@ -297,6 +315,7 @@ func (service *ExecutionResultService) StoreCandidates(
ProvenanceJSON: provenanceJSON,
CandidatesJSON: candidatesJSON,
RecommendationJSON: recommendationJSON,
ReadyEvent: readyEvent,
ReceivedAt: now,
},
)