163 Commits

Author SHA1 Message Date
bd6038241f Add email recipient schema to email message structure
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new `emailRecipientSchema` to encapsulate recipient details, including email, type, and associated objects.
- Updated the `emailMessageSchema` to utilize the new `recipients` field, enhancing the management of multiple recipients.
- Modified indexing to support text search on recipient emails and ensure unique pixel IDs for recipients.
- Improved overall schema structure for better clarity and maintainability.
2026-09-15 01:57:14 +01:00
ea80bfb217 Update document and email message schemas to allow optional object references
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Modified the `object` field in both `documentJob` and `emailMessage` schemas to be non-required.
- Introduced a new `objects` array field in both schemas to accommodate multiple optional object references, enhancing flexibility in data management.
2026-09-14 23:32:56 +01:00
940c05078e Add scan session management to SocketUser class
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a `scanSessions` map to track active scan sessions.
- Implemented logic in `handleObjectActionEvent` to add and remove sessions based on scan actions.
- Added `cancelScanSessions` method to clear active sessions upon user disconnect, ensuring proper cleanup.
- Updated tests to verify that scan sessions are correctly canceled during disconnection.
2026-09-14 22:55:43 +01:00
dc285a63fe Implement host ID check in device state update method
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Added a validation check in the `setDevicesState` method to ensure the host ID is present before proceeding with the device state update.
- Introduced a warning log to notify when the host ID is not found, preventing unnecessary operations.
2026-09-14 22:50:42 +01:00
cd12a0ca0d Add resource management to document and email template schemas
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a `resources` field in both `documentTemplate` and `emailTemplate` schemas to manage associated resources.
- Implemented validation and normalization functions for resource names to ensure uniqueness and proper formatting.
- Updated schemas to include resource name and file references, enhancing template management capabilities.
2026-09-13 19:51:28 +01:00
110ea9355a Refactor audit log and email message schemas for consistency
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Standardized formatting in the `auditLog` and `emailMessage` schemas by ensuring consistent use of commas and spacing.
- Simplified the index definitions for both schemas to enhance readability.
- Improved overall schema structure while maintaining required fields and types for better clarity and maintainability.
2026-09-12 23:29:55 +01:00
44fb686cbb Enhance audit logging and user handling in database operations
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Added a `user` parameter to `editObject`, `newObject`, and `deleteObject` functions to improve audit logging capabilities.
- Updated audit log functions to utilize the new `user` parameter, allowing for more granular tracking of changes.
- Introduced new email-related schemas (`emailAccount`, `emailTemplate`, `emailMessage`) to support email management features.
- Enhanced the `auditLog` schema to include a `system` field for better differentiation of log entries.
- Refactored utility functions to streamline the resolution of audit owners based on user context.
2026-09-12 21:39:59 +01:00
d659695912 Add scheduled properties and event handling for invoice schema
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced `scheduledProperties` to define properties for invoice scheduling, specifically for `dueAt`.
- Implemented `onSchedulerEvent` method to update invoice state to 'overdue' when the due date has passed.
- Enhanced the invoice schema with new static methods to improve scheduling functionality and state management.
2026-09-06 22:58:31 +01:00
6fcaab56d3 Add sidebar width setting to user settings manager
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Updated the DEFAULTS_CATEGORIES array to include 'sidebarWidths', allowing for customization of sidebar widths in user settings.
- This addition enhances the flexibility of the user interface by enabling users to adjust sidebar dimensions according to their preferences.
2026-09-05 01:59:44 +01:00
4bdd624755 Add appearance settings to user settings schema and manager
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new `appearance` field in the user settings schema to allow customization options.
- Updated the `TOP_LEVEL_CATEGORIES` to include `appearance` for better organization of settings.
- Modified the `createEmptySettings` and `normalizeSettings` functions to handle the new `appearance` field.
- Enhanced the `UserSettingsManager` to ensure proper retrieval and updating of appearance settings.
- Added a test case to verify that appearance settings are written correctly at the top level, ensuring they are not nested under defaults.
2026-09-04 02:32:51 +01:00
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
5f84c7077d Enhance stock quantity recalculation tests with updated mock implementations
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Added a mock for `updateDraftStockAuditCurrents` in the stock quantity recalculation test suite to ensure proper integration with stock audit processes.
- Reset the mock state for `updateDraftStockAuditCurrents` in the `beforeEach` hook to maintain test isolation and reliability.
- Updated the test setup to resolve the mock function, improving the accuracy of test outcomes related to stock quantity recalculations.
2026-09-01 16:07:49 +01:00
6bf0568f23 Refactor stock transfer schema to improve location management
Some checks failed
farmcontrol/farmcontrol-ws/pipeline/head There was a failure building this commit
- Removed the `toStockLocation` field from the `stockTransferLineSchema` to streamline the schema.
- Introduced `fromLocation` and `toLocation` fields in the `stockTransferSchema` for better clarity in stock transfer processes.
- Updated the text index to focus on `state.type` for improved search capabilities.
2026-09-01 16:04:38 +01:00
5349538046 Enhance inventory schemas and introduce stock audit level management
Some checks failed
farmcontrol/farmcontrol-ws/pipeline/head There was a failure building this commit
- Added `stockAuditLevelModel` and its schema to manage stock audit levels, including normalization functions for audit lines.
- Updated `filamentStock`, `partStock`, and `productStock` schemas to integrate stock audit calculations, ensuring accurate stock quantity tracking.
- Introduced a `recalculate` method in the stock audit schema to handle stock quantity updates based on audit levels.
- Removed the obsolete `stockEvent` schema to streamline inventory management.
- Enhanced existing schemas with new fields and methods for improved inventory auditing and reporting capabilities.
2026-09-01 15:41:40 +01:00
ffcc7cd0aa Add support for subscribing and unsubscribing to all object updates
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Implemented `subscribeToAllObjectUpdates` and `unsubscribeAllObjectUpdates` methods in the `UpdateManager` to handle bulk updates for object types.
- Updated `SocketHost` and `SocketUser` classes to listen for new socket events related to all object updates.
- Enhanced test coverage for the new subscription methods to ensure correct functionality and integration with the socket client.
2026-09-01 14:14:18 +01:00
7b84114588 Refactor host schema to simplify deviceInfo structure
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Removed unused fields from the deviceInfo schema, including uptime, memory, and network properties, to streamline the schema.
- Updated the deviceInfo reference in the host schema for improved clarity and consistency.
2026-09-01 13:04:00 +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
ccbf2ff388 Enhance financial and inventory schemas with new rollup configurations
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Added new rollup configurations to the `invoice`, `taxrecord`, `orderitem`, `purchaseorder`, `shipment`, and `salesorder` schemas to improve financial reporting and inventory management.
- Introduced aggregate functions for calculating totals and counts based on various states, enhancing data analysis capabilities across the application.
2026-08-30 14:56:57 +01:00
ae2cefb183 Enhance sales schemas with synchronization fields
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Added `syncHash`, `syncImageHash`, and `marketplaceImageUrls` fields to the `listing`, `listingVariant`, and `marketplaceMapping` schemas to support improved synchronization and image management across marketplaces.
2026-08-29 23:13:46 +01:00
cdc7b860ac Refactor database schemas and enhance inventory management
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Removed unnecessary logging in the `getFilter` function to streamline query processing.
- Updated the `models` export to include new policy models for payment, fulfillment, and return, enhancing schema flexibility.
- Enhanced the `partStock` schema with a default state for `type` and added a `postedAt` field for better tracking.
- Introduced a new `marketplaceMappingSchema` in the `productCategory` schema to manage marketplace references.
- Updated the `taxRate` schema to include `jurisdiction` and `shippingAndHandlingTaxed` fields for improved tax management.
- Enhanced the `listing` and `listingVariant` schemas with new states and policy references to support additional business logic.
2026-08-29 00:48:13 +01:00
4109523f59 Add stock quantity recalculation tests and enhance inventory schemas
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new test suite for stock quantity recalculation in `stockQuantity.recalculate.test.js`, ensuring comprehensive coverage of listing variant recalculation logic.
- Enhanced the `filamentstock`, `partstock`, and `productstock` schemas by adding new rollup configurations for tracking unconsumed, used, and consumed states.
- Implemented a pre-validation hook in the `partstock` and `productstock` schemas to automatically set the `part` field based on the associated `partSku`.
- Updated the `stockevent` schema to include new rollup configurations and statistics methods for better inventory management.
- Improved the `listing` and `listingvarient` schemas with additional recalculation logic and statistics methods to enhance data integrity and reporting capabilities.
2026-08-25 01:59:22 +01:00
91c88b5cbb Enhance user settings management and schema
- Introduced a new `pageLayout` field in the user settings schema to allow for top-level layout configurations.
- Refactored the user settings manager to handle `pageLayout` separately from default settings, ensuring proper data structure during updates.
- Updated normalization functions to accommodate the new `pageLayout` field, enhancing the overall user settings management.
- Added tests to verify the correct handling of `pageLayout` updates, ensuring that it is written at the top level and not under defaults.
2026-08-25 01:59:14 +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
f5e74ac471 Update document template schema to reference object types
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Changed the type of `testObject` from Mixed to ObjectId and added a refPath to `objectType`, enhancing the schema's ability to manage relationships with other documents.
- This update improves data integrity and allows for more structured querying of related objects.
2026-08-22 12:56:03 +01:00
4fca989b04 Add print padding and padding properties to document size schema
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced new fields for printPadding, paddingLeft, paddingRight, paddingTop, and paddingBottom in the document size schema.
- Ensured all new fields are required with appropriate default values, enhancing the schema's capability to manage document layout settings.
2026-08-21 22:39:22 +01:00
ecbdfb97c1 Add caching for user permissions in Redis
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced utility functions to save user permissions to Redis, enhancing performance by reducing database load.
- Updated user schema to call the new caching function during permission recalculation, ensuring permissions are stored efficiently.
- Improved overall permission management by integrating Redis caching into the existing permission handling workflow.
2026-08-20 19:35:28 +01:00
998bb725a2 Refactor permission settings and introduce user group management
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Replaced the existing permission settings schema with a new permission setting schema, enhancing the management of user permissions.
- Updated user and user group schemas to include references to the new permission setting model, allowing for more flexible permission handling.
- Added utility functions for resolving referenced documents and recalculating permissions, improving the overall permission management process.
- Removed the old permission settings schema to streamline the codebase and reduce redundancy.
2026-08-20 15:04:55 +01:00
3742839737 Add permission settings model and related functionality
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new permission settings schema and model to manage user permissions effectively.
- Updated user schema to include a reference to permission settings, allowing for dynamic permission management.
- Enhanced the editObject function to conditionally recalculate permissions based on the new recalculate parameter.
- Added utility functions for applying and retrieving permission settings, improving permission handling across the application.
2026-08-20 12:27:54 +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
6e74e0dfec Remove TemplateManager and related PDF rendering functionality
- Deleted the TemplateManager class and its associated methods for rendering templates and PDFs, streamlining the socket handling code.
- Removed all references to PDF and image rendering in SocketHost, SocketUser, and their tests, ensuring a cleaner codebase.
- Updated package.json and pnpm-lock.yaml to remove dependencies related to PDF generation and image processing, enhancing project simplicity.
2026-08-19 18:18:49 +01:00
a3eef435f4 Improve barcode attribute handling and enhance error logging in TemplateManager
- Updated barcode attributes to provide default values when content or attributes are missing, ensuring more robust barcode generation.
- Added error logging in the preview method to capture and log errors more effectively, improving debugging capabilities.
2026-08-19 17:38:59 +01:00
7b4bedeee4 Add sortSidebarVisibility to user settings schema and manager
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new field `sortSidebarVisibility` in the user settings schema to manage sidebar visibility preferences.
- Updated the user settings manager to include `sortSidebarVisibility` in the settings categories and default settings structure, ensuring proper normalization and handling of this new setting.
2026-08-09 20:55:04 +01:00
943e5ff4c6 Update configuration and dependencies for improved logging and compatibility
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Changed log level in config.json from "debug" to "trace" for enhanced logging detail.
- Updated mongoose version to ^9.9.1 in package.json for better performance and features.
- Added new cors origin in config.json for improved access control.
- Updated pnpm-lock.yaml to reflect changes in package versions and added new dependencies for better compatibility.
2026-08-02 01:01:43 +01:00
a7d7d0a456 Add sharp to allowed builds in pnpm-workspace.yaml
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Updated pnpm-workspace.yaml to include 'sharp' in the allowed builds, enhancing the build configuration for image processing capabilities.
2026-07-28 23:22:55 +01:00
e34326b768 Add new dependencies and update package versions in pnpm-lock.yaml
Some checks failed
farmcontrol/farmcontrol-ws/pipeline/head There was a failure building this commit
- Added "pdf-to-img" version 6.2.0 and "sharp" version 0.34.5 to enhance image processing capabilities.
- Updated package resolutions for various architectures and operating systems for the "sharp" library, ensuring compatibility across platforms.
- Included new entries for "@napi-rs/canvas" packages to support additional image processing functionalities on multiple environments.
2026-07-28 23:21:24 +01:00
c2372f661e Update configuration, add dependencies, and enhance socket event handling
Some checks failed
farmcontrol/farmcontrol-ws/pipeline/head There was a failure building this commit
- Changed log level in config.json from "debug" to "trace" for more detailed logging.
- Added new dependencies "pdf-to-img" and "sharp" in package.json for image processing capabilities.
- Introduced 'renderTemplateJPG' event handling in SocketHost and SocketUser classes to support JPG rendering.
- Implemented the renderJPG method in TemplateManager for converting templates to JPG format, including error handling and logging.
2026-07-28 23:16:05 +01:00
53b5924767 Refactor parent template handling in TemplateManager
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Updated the logic to retrieve and validate the parent template content, ensuring it is correctly fetched and checked for string type.
- Improved error logging to provide clearer messages when parent template content is missing or invalid.
2026-07-28 02:51:02 +01:00
8c445a7392 Enhance socket management and error handling in template events
- Increased the maximum HTTP buffer size for the Socket.IO server to improve data handling capabilities.
- Added error handling in `handlePreviewTemplateEvent` and `handleRenderTemplatePDFEvent` methods to log errors and return error messages through callbacks.
- Implemented a check for unknown object types in the `TemplateManager` to prevent processing errors and return appropriate error messages.
2026-07-28 01:50:24 +01:00
00198b8199 Refactor subjob schema for improved consistency and readability
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Removed unnecessary line breaks in the subjob schema to enhance code clarity.
- Ensured all required fields maintain their definitions for better data integrity.
- Updated formatting for the `state` field to align with coding standards.
2026-07-28 00:22:27 +01:00
8493f44748 Delete builds older than 25.
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
2026-07-26 23:56:13 +01:00
ef5cfd34e4 Refactor inventory and filament schemas for improved consistency and readability
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Enhanced the stock event schema by ensuring consistent formatting and removing unnecessary line breaks for better maintainability.
- Updated the filament schema to improve code readability and maintain required fields while maintaining functionality.
- Introduced a new `recalculate` method in the printer schema to manage printer state changes effectively.
- Added logic to handle host disconnection in the socket host, ensuring proper state management and logging.
2026-07-26 22:41:09 +01:00
f3a3d3914a Enhance gcode file schema to populate part information from partSku
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Added logic in the pre-validation hook to populate the `part` field in `parts` array based on the `partSku` if it is not already set.
- Improved data integrity by ensuring that part information is correctly retrieved and assigned during validation.
2026-07-26 21:21:35 +01:00
652d62c758 Enhance printer schema by adding optional code field and default ID generation
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new optional field `code` in the printer schema for additional identification.
- Updated the `_id` field to use a default value generated by `generateId()` for improved uniqueness.
- Ensured schema maintains required fields and defaults for better data integrity.
2026-07-26 21:11:49 +01:00
0a1f75d050 Enhance filament schema by adding vendor reference and improving formatting
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a new optional field `vendor` in the filament schema to reference the vendor associated with the filament.
- Improved code formatting for better readability and maintainability, including consistent indentation and line breaks.
- Ensured that the `recalculate` method remains functional with updated schema structure.
2026-07-26 19:07:46 +01:00
766f4722ea Refactor stock event schema for improved readability and consistency
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Cleaned up the stock event schema by removing unnecessary line breaks and ensuring consistent formatting across the code.
- Enhanced readability of function parameters and return statements for better maintainability.
- Made minor adjustments to comments and structure to align with coding standards.
2026-07-26 19:00:30 +01:00
2b660ec61d Add history tracking to inventory schemas and stock event
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Introduced a `history` field in filamentStock, partStock, productStock, and stockEvent schemas to maintain historical records of current quantities and weights.
- Enhanced stock event processing to append history entries when values change, ensuring accurate tracking of stock changes over time.
- Implemented utility functions to manage history entries and enforce rate limits on updates for improved data integrity.
2026-07-26 18:38:04 +01:00
67f929e369 Refactor inventory schemas to remove redundant stock event calculations
- Removed the `getStockEventTotal` function and associated `recalculate` methods from filamentStock, partStock, and productStock schemas to streamline code and reduce redundancy.
- Updated stockEvent schema to include a new `recalculate` method that centralizes stock recalculation logic for improved maintainability.
- Enhanced the stockEvent schema with additional utility functions for building update data and recalculating parent stock based on events.
2026-07-26 16:10:38 +01:00