rejectHeld is the shared reject dispatch (agent-path + /reviews). Caller MUST have proven account scope + ownership of agentEmail. Inbound holds are dropped (hidden); outbound holds are discarded (never sent).
(ctx context.Context, userID, msgID, agentEmail, reason string)
| 166 | // have proven account scope + ownership of agentEmail. Inbound holds are dropped |
| 167 | // (hidden); outbound holds are discarded (never sent). |
| 168 | func (s *Server) rejectHeld(ctx context.Context, userID, msgID, agentEmail, reason string) (RejectResultView, error) { |
| 169 | meta, inbound, err := s.resolveHeldDirection(ctx, msgID, agentEmail) |
| 170 | if err != nil { |
| 171 | return RejectResultView{}, err |
| 172 | } |
| 173 | if inbound { |
| 174 | if s.deps.RejectInboundReview == nil { |
| 175 | return RejectResultView{}, NewError(http.StatusInternalServerError, "internal_error", "reject unavailable") |
| 176 | } |
| 177 | if derr := s.deps.RejectInboundReview(ctx, userID, reason, meta); derr != nil { |
| 178 | return RejectResultView{}, NewError(derr.Status, derr.Code, derr.Msg) |
| 179 | } |
| 180 | return RejectResultView{Status: identity.MessageStatusReviewRejected, MessageID: meta.ID, RejectionReason: reason}, nil |
| 181 | } |
| 182 | if s.deps.RejectPending == nil { |
| 183 | return RejectResultView{}, NewError(http.StatusInternalServerError, "internal_error", "reject unavailable") |
| 184 | } |
| 185 | rejected, derr := s.deps.RejectPending(ctx, userID, msgID, agentEmail, reason) |
| 186 | if derr != nil { |
| 187 | return RejectResultView{}, NewError(derr.Status, derr.Code, derr.Msg) |
| 188 | } |
| 189 | return RejectResultView{Status: rejected.Status, MessageID: rejected.ID, RejectionReason: rejected.RejectionReason}, nil |
| 190 | } |
no test coverage detected