This commit introduces a new function, `syncModelsWithScheduler`, to synchronize database schemas with the farm control scheduler. It also adds scheduled properties and event handling for invoices, allowing for automatic state updates based on due dates. Additionally, minor refactoring is performed in the sales listings routes and services to improve code readability and maintainability. The changes enhance the application's data synchronization and invoice management capabilities.
This commit updates the `syncModelsWithWS` function to include detailed statistics on schema synchronization, tracking the number of added, updated, and unchanged files. The `syncDirectory` function is modified to read file contents and determine if changes exist before copying, utilizing a new utility function, `fileHasChanges`, for comparison. Additionally, a helper function, `readFileIfExists`, is introduced to handle file reading more gracefully. These enhancements improve the efficiency and clarity of the schema synchronization process.