62 Commits

Author SHA1 Message Date
f6e7fb3a41 Implement Jest testing framework and add initial test cases for various modules. Update configuration for test environment in config.json and add test results handling in Jenkinsfile. Include .gitignore entry for test results. Enhance package.json with Jest dependencies.
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
2025-12-29 01:13:01 +00:00
0ed5eb86dd Added Jenskinsfile.
Some checks reported warnings
farmcontrol/farmcontrol-ws/pipeline/head This commit is unstable
2025-12-28 23:50:12 +00:00
7572661615 Update schemas to match api. 2025-12-28 02:12:18 +00:00
237383d3c4 Removed development logging. 2025-12-27 15:19:18 +00:00
8eafc81321 Updated models inline with API. 2025-12-27 14:15:13 +00:00
50221a0228 Updated Keycloak clientId in config.json from 'farmcontrol-client' to 'farmcontrol-dev'. 2025-12-27 14:15:00 +00:00
6bc0f6eded Added dotenv support. 2025-12-14 01:22:33 +00:00
456916ef1f Fixed index path. 2025-12-14 00:25:57 +00:00
c5b521e906 Fix JS export. 2025-12-14 00:23:57 +00:00
57e9f76ec6 Added pm2 ecosystem. 2025-12-14 00:20:08 +00:00
85e2ad8d6f Updated secrets held in env vars. 2025-12-13 23:54:25 +00:00
787e8f6a9c Updated schemas. 2025-12-13 22:35:01 +00:00
aa931c8f96 Update readme 2025-12-13 21:08:23 +00:00
2fc477ab25 Comment updates. 2025-12-13 21:08:18 +00:00
4d49a010c4 Updated lock. 2025-12-13 21:08:10 +00:00
a4740a3a26 Removed etcd 2025-12-13 21:08:02 +00:00
b49973c76b Updated comment. 2025-12-13 21:07:50 +00:00
f6e07e2cca Refactored caching utility: replaced jsonToCacheKey with getQueryToCacheKey for improved cache key generation based on model, id, and populate parameters. 2025-12-13 21:07:29 +00:00
94e0614852 Added trace logging 2025-12-13 21:07:18 +00:00
675e1e6143 Added more logging for mongo db. 2025-12-13 21:07:01 +00:00
15c2f2982e Added printer stats. 2025-12-13 21:06:39 +00:00
9aac0f8316 Order item support. 2025-12-13 21:06:23 +00:00
f72c27c588 Added stats support. 2025-12-13 21:03:55 +00:00
950d47bcfa Removed etc and added better redis support. 2025-12-13 21:03:11 +00:00
4653430c0f Added infinite height support. 2025-12-13 21:02:14 +00:00
aa4d2c6873 Schema modifications. 2025-12-13 21:01:35 +00:00
30295dad3a Added order items, shipments etc 2025-12-07 02:37:10 +00:00
e7957c3070 Added address to Vendor 2025-12-03 23:47:27 +00:00
bfd7d292d5 Added tax rates, tax records. 2025-12-03 23:35:44 +00:00
88952fbde2 Added purchase orders and couriers. 2025-12-03 03:40:10 +00:00
5dd4d9275b Modified schemas. 2025-12-03 00:07:58 +00:00
7f17f5f205 Rewrote subjob handling so it works and better progress updates too. 2025-12-02 18:29:59 +00:00
79ed7691f9 Added document printer support. 2025-11-29 01:28:20 +00:00
509b7de11c Refactoring 2025-11-29 01:27:19 +00:00
f3a1115a09 Enhance ActionManager with subscription management and listener removal functionality
- Introduced a Set to manage subscriptions for object actions, allowing for better tracking and cleanup of active listeners.
- Added a method to remove all action listeners, improving resource management and preventing memory leaks.
- Enhanced existing subscription and removal methods to ensure proper handling of callbacks and subscriptions.
- Improved logging for subscription actions to aid in debugging and traceability.
2025-11-29 01:26:55 +00:00
362265da72 Refactor caching mechanism to utilize Redis for improved performance and reliability
- Replaced in-memory caching with Redis for object and list caching in database operations.
- Introduced a new RedisServer class for managing Redis connections and operations.
- Updated cache retrieval and update functions to handle asynchronous operations with Redis.
- Enhanced logging for cache operations to improve traceability of cache hits, misses, and errors.
- Adjusted configuration to include Redis settings in config.json.
2025-11-24 03:35:26 +00:00
6be53349b5 Refactor LockManager to standardize lock key format and enhance logging; add debug statement in TemplateManager for template rendering 2025-11-16 17:11:15 +00:00
e1ba1f7871 Implement EventManager integration and enhance socket event handling
- Added EventManager to SocketHost and SocketUser for improved event handling.
- Introduced new socket event handlers for editing objects, listing objects, and subscribing to object actions.
- Refactored authentication logic to streamline host online status updates.
- Enhanced logging and callback mechanisms for better traceability and responsiveness in socket interactions.
2025-09-05 23:30:35 +01: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
8ccdc81de1 Refactor ActionManager and introduce EventManager for NATS-based event handling
- Replaced Etcd with NATS in ActionManager for tracking object actions and broadcasting updates.
- Implemented EventManager to handle object events using NATS, including subscription and publishing functionalities.
- Enhanced logging for better traceability of actions and events.
2025-09-05 23:29:47 +01:00
ca78fd6e62 Enhance template manager with additional style attributes
- Added support for color, background, and scale attributes in getNodeStyles function.
- Updated transformCustomElements function to apply dynamic styles to Text, Bold, and Barcode elements.
- Changed Barcode element to use a div container for better structure and styling.
2025-09-05 23:29:28 +01:00
7ccc4bb993 Add NATS messaging support
- Introduced a new NatsServer class for managing NATS connections and messaging.
- Implemented connection handling, publishing, requesting, and subscription management.
- Updated index.js to connect to NATS on application startup and handle connection errors.
- Enhanced logging for NATS operations to improve traceability and error management.
2025-09-05 23:29:14 +01:00
d6214e316b Add message field to alert schema in printer.schema.js 2025-09-05 23:28:39 +01:00
e4c790e7cc Refactor caching mechanism in database.js
- Replaced the previous model cache implementation with a unified object cache using NodeCache for improved performance and simplicity.
- Updated cache retrieval and update functions to support additional parameters such as `populate`, `filter`, `sort`, and `project`.
- Enhanced logging for cache operations to provide better traceability of cache hits and misses.
- Removed deprecated functions and streamlined the caching logic for object and list retrieval.
2025-09-05 23:28:23 +01:00
4ac87f0141 Update package.json and package-lock.json to add new dependencies
- Added @nats-io/nats-core and @nats-io/transport-node (version 3.1.0) for enhanced messaging capabilities.
- Included canonical-json (version 0.2.0) for improved JSON handling.
- Updated package-lock.json to reflect the new dependencies and their respective versions.
2025-09-05 23:27:56 +01:00
9fba977b2a Add .DS_STORE to .gitignore. 2025-09-05 23:27:34 +01:00
b9c2e959b9 Update dependencies in package.json and package-lock.json
- Upgraded several dependencies including axios, dotenv, express, mongodb, and mongoose to their latest versions for improved performance and security.
- Added new dependencies: date-fns, dayjs, ejs, nanoid, node-cache, object-hash, and posthtml to enhance functionality.
- Updated ESLint and related packages to the latest versions for better linting support and configuration.
- Removed deprecated dependencies and ensured compatibility with the latest Node.js versions.
2025-08-18 01:09:29 +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
1b86d256ca Enhance UpdateManager for object event handling and subscription management
- Refactored constructor to utilize socketClient for improved clarity.
- Added methods to subscribe and unsubscribe from object creation and update events.
- Implemented functionality to retrieve and set object updates in Etcd.
- Improved logging for event handling and error management.
2025-08-18 01:09:00 +01:00
d695772a3a Refactor LockManager to improve key handling and event broadcasting
- Updated constructor to use socketClient instead of socketManager for better clarity.
- Changed key management methods to use a consistent naming convention for setting and deleting locks.
- Enhanced event listener setup to utilize socketClient for broadcasting lock updates.
- Improved logging for lock and unlock operations to provide clearer insights into the locking mechanism.
2025-08-18 01:08:49 +01:00