feat: enhance document attachment handling and audit logging

- Added support for attachment updates in the updateDocument functionc.
- Introduced new audit log type for document attachments updates.
- Updated ZDocumentAuditLog schemas to include attachment-related events.
- Modified AddSettingsFormPartial to handle attachment IDs and types correctly.
- Set default value for attachment type in the Prisma schema.
This commit is contained in:
Catalin Documenso
2025-04-30 15:53:58 +03:00
parent e3f8e76e6a
commit 6980db57d3
8 changed files with 110 additions and 15 deletions

View File

@ -388,6 +388,10 @@ export const formatDocumentAuditLogAction = (
anonymous: msg`Document completed`,
identified: msg`Document completed`,
}))
.with({ type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_ATTACHMENTS_UPDATED }, ({ data }) => ({
anonymous: msg`Document attachments updated`,
identified: msg`${prefix} updated the document attachments ${data.to.map((a) => a.label).join(', ')}`,
}))
.exhaustive();
return {