11 Commits

Author SHA1 Message Date
9447a3206e Refactor UpdateManager and enhance object update handling
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Updated the `distributeUpdate` function to include the object ID in the published message, improving traceability.
- Refactored the `UpdateManager` class to streamline object update emissions, consolidating logic into the new `emitObjectUpdate` method for better maintainability.
- Enhanced test cases to ensure proper handling of object updates with the new structure, verifying that emitted events include the correct object ID and data.
- Modified the `objectViewSchema` to remove the `_reference` field and added a new `viewMode` field for improved schema clarity.
2026-09-03 22:25:32 +01:00
c94dc058ef Add ensure-references script and update package.json
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new script `ensure-references.js` to ensure all documents have a `_reference` field, enhancing data integrity across models.
- Updated `package.json` to include the new script in the npm scripts section for easy execution.
- Refactored database utility functions to exclude additional models from audit logging, improving data privacy.
- Enhanced various schemas with new fields and methods for better tax calculations and inventory management.
2026-09-02 20:55:38 +01:00
9416a94a23 Refactor database utility functions and enhance audit logging
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Removed unnecessary console logging in the `SocketUser` class for cleaner output.
- Updated the `distributeNew` function to accept the entire object instead of just the ID, improving flexibility in handling new entries.
- Enhanced the `newAuditLog` and `editAuditLog` functions to filter out excluded models and changes, ensuring sensitive data is not logged.
- Introduced new utility functions for omitting specific paths and excluded changes from audit logs, enhancing data privacy and integrity.
2026-09-01 12:34:31 +01:00
2dc2a9d296 Enhance database schemas and introduce marketplace event handling
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Updated the `notificationUserFromOwner` function to support 'marketplace' as a valid owner type.
- Added a new `marketplaceEvent` schema to manage marketplace events, including fields for `externalReference`, `topic`, and `status`.
- Enhanced existing schemas (e.g., `orderitem`, `shipment`, `client`, `listing`, `listingVarient`, `salesOrder`, `courierService`) to include `externalReference` fields for better integration with external systems.
- Introduced unique indexes for `externalReference` in relevant schemas to ensure data integrity and prevent duplicates.
- Improved the `marketplace` schema to include additional fields for eBay shipping services, enhancing its configurability.
2026-08-24 02:49:19 +01:00
e563538e89 Refactor database utility functions and enhance document job schema
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Reformatted the `NOTIFICATION_EXCLUDED_MODELS` array for improved readability in `utils.js`.
- Updated the `editNotification` and `createNotification` functions for better code clarity by breaking long lines.
- Added a new `quantity` field to the `documentJobSchema`, ensuring it is required with a default value of 1 and a minimum of 1.
- Introduced new filtering capabilities in `updatemanager.js` to handle complex filter conditions, enhancing the overall filtering logic.
- Updated tests to mock new filter functionalities, ensuring proper integration and functionality verification.
2026-08-22 20:02:36 +01:00
7e8879164a Refactor model entry retrieval in database utilities
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Changed the getModelEntryByType function to use dynamic import for models, caching the result to improve performance.
- Updated the editNotification function to await the model entry retrieval, ensuring proper asynchronous handling of model data.
2026-08-19 19:03:34 +01:00
c36765cc47 Add notification handling in editObject and utility functions
Some checks failed
farmcontrol/farmcontrol-ws/pipeline/head There was a failure building this commit
- Introduced notification functionality in the editObject method to notify users of changes when editing objects, enhancing user awareness of updates.
- Added utility functions for creating and managing notifications, including omitSensitive for filtering sensitive data and notificationUserFromOwner for user retrieval based on owner type.
- Updated SocketHost to support the new notify parameter, ensuring notifications can be triggered during object edits.
2026-08-19 18:58:37 +01:00
f72c27c588 Added stats support. 2025-12-13 21:03:55 +00:00
7f17f5f205 Rewrote subjob handling so it works and better progress updates too. 2025-12-02 18:29:59 +00:00
ab50a5261d Enhance utility functions and refactor authentication logic
- Added a new jsonToCacheKey function to generate a SHA-256 hash from a canonicalized JSON object for improved caching.
- Updated getModelByName to return the first model directly instead of an array.
- Refactored authentication logic to utilize listObjects for user and host retrieval, ensuring consistent handling of returned data.
- Improved logging for OTP verification to include the specific OTP used in the search.
2025-09-05 23:30:06 +01:00
6cc2a07ee0 Add utility functions for database operations
- Introduced a new utils.js file containing various utility functions for database operations.
- Implemented functions for parsing filters, converting objects to camelCase, extracting configuration blocks, and managing audit logs.
- Added functionality to handle ObjectId conversions and filter generation based on query parameters.
- Enhanced object ID handling with functions to flatten and expand ObjectIds for better integration with MongoDB.
2025-08-18 01:09:14 +01:00