mirror of
https://github.com/documenso/documenso.git
synced 2026-07-24 08:54:20 +10:00
feat: add API endpoint to reject documents on behalf of recipients
Programmatically record an external rejection on behalf of a recipient who declined outside the platform. Flags the rejection as external in the audit log, optionally attributes it to a specific team member via actAsEmail, and enforces team membership and document visibility.
This commit is contained in:
@@ -560,12 +560,24 @@ export const ZDocumentAuditLogEventDocumentRecipientCompleteSchema = z.object({
|
||||
});
|
||||
|
||||
/**
|
||||
* Event: Document recipient completed the document (the recipient has fully actioned and completed their required steps for the document).
|
||||
* Event: Document recipient rejected the document.
|
||||
*/
|
||||
export const ZDocumentAuditLogEventDocumentRecipientRejectedSchema = z.object({
|
||||
type: z.literal(DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_RECIPIENT_REJECTED),
|
||||
data: ZBaseRecipientDataSchema.extend({
|
||||
reason: z.string(),
|
||||
/**
|
||||
* Whether the rejection was recorded externally on behalf of the recipient
|
||||
* via the API, rather than by the recipient directly on the platform.
|
||||
*/
|
||||
isExternal: z.boolean().optional(),
|
||||
/**
|
||||
* The team member the external rejection was recorded on behalf of, when
|
||||
* the API caller elected a specific member to attribute the action to.
|
||||
* Absent when the rejection is attributed to the API user/token itself.
|
||||
*/
|
||||
onBehalfOfUserEmail: z.string().optional(),
|
||||
onBehalfOfUserName: z.string().nullable().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user