37 Commits

Author SHA1 Message Date
5ff93be27c Add audit owner resolution and actor display name functions
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit introduces a new module, `auditOwner.js`, which includes functions for resolving audit owner details and generating display names for actors. The `resolveAuditOwner` function determines the owner type based on the actor's object type, defaulting to 'user' if not specified. The `actorDisplayName` function formats the display name based on the actor's properties, enhancing the clarity of audit logs. Additionally, the `AUDIT_OWNER_TYPES` constant is exported for use in other modules. Updates to existing files incorporate these new functions for improved audit logging and notification handling.
2026-08-24 02:49:38 +01:00
8974d1e9da Add quantity field to document job schema and update related routes and services
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces a new `quantity` field to the document job schema, ensuring it is required with a default value of 1. The routes and services for managing document jobs are updated to include this new field, allowing for its inclusion in both creation and editing processes. Additionally, the allowed filters and sorters are modified to accommodate the new `quantity` field, enhancing the overall functionality and flexibility of document job management.
2026-08-22 20:02:28 +01:00
0470f62e05 Refactor schema type handling and enhance utility functions in utils and database modules
This commit introduces several utility functions to improve schema type handling, including `getEmbeddedSchemaType` and `getObjectIdSchemaTypeFromPath`. The `getFilterFieldKind` function is updated to utilize these new utilities for better clarity and functionality. Additionally, the `getArrayParentPaths` function is renamed to `getArrayUnwindPaths` for improved readability, and the logic for fetching unique IDs is enhanced with a new `flattenRefIds` function. These changes streamline the code and enhance the overall management of schema references and array paths.
2026-08-22 20:02:21 +01:00
30d1469204 Refactor query handling in various routes to standardize sort property and order parameters
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit updates multiple route handlers across the management and inventory modules to replace the `sort` and `order` parameters with `sortProperty` and `sortOrder`. This change enhances consistency in query handling and improves the clarity of the code. Additionally, the `getFilter` function is modified to accommodate these new parameters, ensuring that filtering logic remains intact. Corresponding tests have been updated to verify the correct functionality of the modified routes.
2026-08-22 02:36:05 +01:00
f3391fb8f3 Add createDocumentJobUserNotifier utility and integrate into document job handling
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This update introduces the `createDocumentJobUserNotifier` function in `utils.js`, which creates a user notifier for document jobs if it doesn't already exist. The function is then integrated into the `newDocumentJobRouteHandler` in `documentjobs.js`, ensuring that user notifications are properly managed upon the creation of new document jobs. Additionally, tests have been updated to verify the correct invocation of the new utility function, enhancing the overall notification system for document jobs.
2026-08-19 18:58:28 +01:00
aa4b173a7e Add sorting functionality to various inventory and management routes
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This update introduces a new utility function, `getSort`, to validate and apply sorting based on allowed sorters across multiple routes in the inventory and management modules. The function is integrated into route handlers for invoices, payments, tax records, filament stocks, order items, part stocks, product stocks, purchase orders, shipments, and various management entities. This enhancement improves the flexibility and consistency of sorting operations throughout the application.
2026-08-11 02:12:27 +01:00
234652f7b0 Enhance database utility functions for improved property value retrieval and reference handling
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This update introduces several new functions in `database.js` to enhance the handling of Mongoose model references and property values. Key additions include `getObjectRefPathInfo`, `resolveMongooseModel`, and `fetchBasicObjectsByIds`, which improve the efficiency of fetching related objects based on property references. Additionally, the `getPropertyValues` function has been updated to support dynamic references and filtering, ensuring more robust data retrieval. Minor adjustments were also made to the `getJobPropertyValuesRouteHandler` to accommodate the new filtering capabilities.
2026-08-10 00:56:59 +01:00
4bd29e2010 Enhance utility functions in utils.js for improved reference model handling and filtering logic
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This update introduces new functions such as `getRefModelEntryFromPrefix`, `stripPrefixFromOperand`, and `getRefModelEntryForToken` to streamline the processing of reference models and tokens. Additionally, the `resolveRefLeaf` and `resolveRefCondition` functions have been refactored to utilize these enhancements, improving the overall efficiency and clarity of the filtering and reference resolution processes. Minor formatting adjustments were also made in orderitems.js for consistency.
2026-08-09 22:52:05 +01:00
069406e4d8 Remove unnecessary logging statements in utils.js to streamline the filtering and parsing functions. This change enhances code clarity and performance by eliminating debug logs that are no longer needed.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-09 22:28:05 +01:00
2a30b7f3f6 Enhance filtering and parsing logic in utils.js and update route handlers for async support
This update introduces several utility functions in `utils.js` to improve the handling of ObjectId paths, schema types, and filtering logic. Key additions include `isObjectIdPath`, `getBaseProperty`, and `getFilterFieldKind`, which enhance the flexibility of property handling. Additionally, all route handlers in the finance and inventory modules have been refactored to support asynchronous operations, ensuring better performance and responsiveness when processing requests.
2026-08-09 22:27:45 +01:00
fcdd76f891 Add additional boolean operand parsing in utils.js
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This update expands the `parseBooleanOperand` function to handle more string representations of boolean values, including '1', '0', 'on', 'off', 'y', and 'n'. This enhancement improves the flexibility and robustness of boolean parsing in the application.
2026-08-09 20:29:27 +01:00
6c694d7d48 Add boolean field handling to filtering logic in utils.js
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This update introduces functions to manage boolean fields in the filtering process, including parsing boolean operands and building equality/comparison conditions. The `buildCondition`, `parseLeafCondition`, and `parseFilter` functions have been modified to accommodate boolean field checks, enhancing the overall filtering capabilities across the application.
2026-08-01 14:33:03 +01:00
3155733642 Add filterDistributeKeys function and DISTRIBUTE_KEYS constant to utils.js for improved data handling in distributed updates. Updated distribution functions to utilize these enhancements, ensuring only relevant keys are published.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-28 02:51:09 +01:00
5a4fecbae0 Refactored editObject function in database.js to utilize a merged object for updates, improving code clarity and reducing redundancy. Updated printer schema to include a default ID generation method and added alerts handling in editPrinterRouteHandler for enhanced printer management.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 21:11:43 +01:00
3dd80b7790 Updated expandObjectIds function in utils.js to exclude specific fields from expansion, ensuring proper handling of object IDs. Added console.log for debugging filter clauses in getFilter function.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-24 21:53:00 +01:00
a42f953e9a Removed console.log statements across various files to clean up the code and improve performance. This includes logging related to audit logs, user notifications, database operations, and session management.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-23 21:44:32 +01:00
e5981ce419 Updated expandObjectIds function in utils.js to convert _id values to strings, ensuring consistent data formatting for object IDs.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-18 16:28:25 +01:00
ce6f396bcb Audit log fixes.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-13 22:59:49 +01:00
bf3e23ddf1 Implemented subscribe and unsubscribe audit log functions in utils.js and integrated them into user notifier route handlers for tracking subscription changes. This enhances audit capabilities and maintains user activity logs.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-13 03:12:48 +01:00
af0934b163 Added product category support, including new routes, database schemas, and service updates. Enhanced existing product functionalities to incorporate product categories in filtering and population. 2026-06-14 23:51:51 +01:00
1b858d8814 Added better listing and listing varient support. 2026-03-21 21:39:10 +00:00
7eb774a297 Added missing SKUs. 2026-03-08 01:07:34 +00:00
8ad3d3da5c Implemented multiple app passwords.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-03-02 01:58:24 +00:00
a9c4b29f9f Improved notifications.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-03-01 19:21:05 +00:00
78509ed3a2 Implemented email notifications. 2026-03-01 16:54:56 +00:00
3e47cb131b Implemented notifications.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-03-01 01:42:30 +00:00
dea6a90b68 Removed development logging. 2025-12-27 15:19:13 +00:00
7541612d67 Refactor ObjectId handling in utils.js to use mongoose.Types.ObjectId for consistency across the codebase. 2025-12-27 14:02:50 +00:00
d9247d2504 Refactored config system to have both production and development configs. 2025-12-13 23:01:03 +00:00
528e57dd9a Moved schema id generation. 2025-12-13 21:13:17 +00:00
f4681e917b Added tax rates, tax records. 2025-12-03 23:35:40 +00:00
b44e3a5141 Added loads of features, updated packages and created schema sync. 2025-12-02 18:29:30 +00:00
dca386e6ae Large amount of refactoring. 2025-11-16 17:06:54 +00:00
a768ca04de Add NATS messaging for updates and deletes: Replaced Etcd operations with NATS publish calls in utils.js for distributing updates, new entries, and deletions. Updated logging in etcd.js to use trace level for improved verbosity during connection and operation handling. 2025-09-05 23:25:34 +01:00
e1b0b707ba Update dependencies, refactor routes, and enhance caching: Upgraded various package versions in package.json and package-lock.json for improved performance and security. Refactored routes to include new document-related endpoints and integrated caching mechanisms for user and token lookups to optimize authentication processes. Updated schemas to support new data structures and relationships, ensuring better data integrity and retrieval. 2025-08-18 00:51:46 +01:00
7626ff0317 Refactor audit logging: centralized audit log retrieval in utils, updated service methods to utilize new getAuditLogs function, and standardized model references in audit log creation across services. Enhanced filtering in management routes for improved query handling. 2025-06-29 22:34:58 +01:00
eb8bc0f4b3 Remove unused files and refactor imports: deleted obsolete files including passport.js, and others, while updating import paths in various services and routes for consistency. Added ESLint and Prettier configurations to enhance code quality. 2025-06-29 21:53:18 +01:00