Add Reject endpoint to AnnotationController

Introduced a new Reject endpoint for users with the ReceiverFull role to reject annotations, with optional reason support. Marked the endpoint as obsolete for future exception handling updates. Also standardized the Unauthorized response to remove the custom error message.
This commit is contained in:
2026-03-11 12:09:23 +01:00
parent 60db762bcc
commit 7cb1546934

View File

@@ -81,6 +81,7 @@ public class AnnotationController : ControllerBase
return Ok();
}
//TODO: add logic to check if it is already rejected or signed
[Authorize(Roles = Role.ReceiverFull)]
[HttpPost("reject")]
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
@@ -101,7 +102,7 @@ public class AnnotationController : ControllerBase
if (envRcvRes.IsFailed)
{
_logger.LogNotice(envRcvRes.Notices);
return Unauthorized("you are not authirized");
return Unauthorized();
}
var histRes = await _histService.RecordAsync(envRcvRes.Data.EnvelopeId, userReference: mail, EnvelopeStatus.DocumentRejected, comment: reason);