fix: audit logs

This commit is contained in:
Ephraim Atta-Duncan
2024-10-16 23:05:44 +00:00
parent cc8b972fbc
commit bb805ea93b
7 changed files with 34 additions and 6 deletions

View File

@ -122,12 +122,16 @@ export const selfSignDocument = async ({
if (document.status === DocumentStatus.DRAFT) {
await tx.documentAuditLog.create({
data: createDocumentAuditLogData({
// todo: use a different audit log type
type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_SENT,
type: DOCUMENT_AUDIT_LOG_TYPE.SELF_SIGN,
documentId: document.id,
requestMetadata,
user,
data: {},
data: {
recipientId: document.Recipient[0].id,
recipientEmail: document.Recipient[0].email,
recipientName: document.Recipient[0].name,
recipientRole: document.Recipient[0].role,
},
}),
});
}