This commit introduces several utility functions in the `utils.js` file, including `getSchemaTypeRef`, `forEachSchemaPath`, and `collectIdsAtPath`, to streamline schema reference handling. Additionally, it refactors the `modelHasRef` and `getFieldsByRef` functions to utilize these new utilities, improving code readability and maintainability. The email message schema is updated to support multiple recipients with enhanced attachment handling, ensuring better management of email content and references. Tests are added to validate the new functionality, reinforcing the integrity of email message processing.
This commit introduces new schemas and routes for managing email accounts, email messages, and email templates. It adds functionality for CRUD operations on these entities, including listing, searching, and retrieving properties. The email message handling is enhanced with a worker for asynchronous email delivery, and the audit log schema is updated to accommodate system actions. Additionally, utility functions are improved for better data handling and validation. These changes significantly enhance the application's email management capabilities.