279 Commits

Author SHA1 Message Date
1d473cc755 Refactor email attachment handling and improve error management
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit refines the `resolveEmailAttachments` function by enhancing error handling for unknown object types and removing unnecessary console logs. It also updates the test suite to mock additional database functions and ensure proper object retrieval during email message processing, improving the robustness of email management features.
2026-09-12 21:52:21 +01:00
624a2aefdd Update audit owner resolution tests to include 'system' property for marketplace and user actors
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-09-12 21:49:44 +01:00
d86dbe0261 Enhance email management features with new schemas and routes
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit introduces new schemas and routes for managing email accounts, email messages, and email templates. It adds functionality for CRUD operations on these entities, including listing, searching, and retrieving properties. The email message handling is enhanced with a worker for asynchronous email delivery, and the audit log schema is updated to accommodate system actions. Additionally, utility functions are improved for better data handling and validation. These changes significantly enhance the application's email management capabilities.
2026-09-12 21:40:07 +01:00
cb63d8dabb Implement schema synchronization and enhance invoice handling
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
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.
2026-09-06 22:58:06 +01:00
9defa3e30b Implement handling for empty values in filter parsing
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces a new utility function, `isEmptyOperand`, to treat empty strings as null or missing values in filter parsing. It updates the `parseFilter` function and related utility functions to handle cases where empty values are provided, ensuring consistent behavior across different field types. Additionally, corresponding tests are added to verify the correct handling of empty values in various scenarios, enhancing the robustness of the filtering capabilities.
2026-09-05 02:28:28 +01:00
bbec009337 Add appearance field to user settings schema for enhanced customization options
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-09-04 02:32:37 +01:00
9f5b390771 Enhance allowed filters and sorters in management routes to include 'overrideCost' and 'overridePrice'
This commit updates the allowed filters and sorters in the filament, part, and product SKU management routes to include 'overrideCost' and 'overridePrice'. Additionally, it refactors the route handlers for improved readability and consistency. These changes aim to enhance data retrieval capabilities and maintain a consistent structure across the management routes.
2026-09-04 01:33:43 +01:00
91eb22ac49 Update audit log tests to utilize new database mock functions for improved accuracy
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit enhances the audit log service route tests by replacing direct calls to the `auditLogModel` with mocked database functions `listObjects` and `getObject`. This change improves the accuracy of the tests by ensuring they reflect the updated database interaction methods. The tests now verify that the correct parameters are passed to these functions, enhancing the overall reliability of the audit log service tests.
2026-09-04 00:39:50 +01:00
605d845ba3 Enhance date handling and filtering capabilities in utility functions and tests
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit introduces new functions for handling various date operations, including start and end of day, week, month, hour, and minute. It also adds relative date parsing capabilities, allowing for expressions like 'TODAY', '-7D..', and '-1M..-CM'. Additionally, the `parseFilter` function is updated to support these new date functionalities, with corresponding tests added to ensure accurate date filtering and validation. The changes improve the overall date management and querying capabilities within the application.
2026-09-04 00:36:22 +01:00
9b896c2157 Enhance data distribution and filtering by adding 'tags' to allowed filters and updating publish functionality
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit modifies the `distributeUpdate` function in `utils.js` to include the `_id` in the published object, improving data integrity during distribution. Additionally, it updates the allowed filters in the `products` and `clients` routes to include 'tags', enhancing the filtering capabilities for better data categorization and retrieval.
2026-09-03 22:25:36 +01:00
efcf1389a5 Add object view functionality with CRUD operations and schema integration
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces a new `objectView` schema and corresponding routes for managing object views, enhancing the application's data handling capabilities. It includes CRUD operations for object views, allowing users to create, retrieve, update, and delete views based on specific object types. The implementation also updates existing services and routes to integrate the new functionality, ensuring proper authentication and data validation. Additionally, the commit modifies relevant utility functions and filters to accommodate the new object view model, improving overall application structure and maintainability.
2026-09-03 03:18:12 +01:00
850c721867 Refactor allowed filters and sorters across various routes to enhance data handling
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit updates the allowed filters and sorters in multiple routes, including invoices, payment policies, inventory, management, and sales. It removes unnecessary filters, adds new ones for improved categorization, and ensures consistency in the data structure. These changes aim to streamline data retrieval and enhance the overall functionality of the application.
2026-09-01 19:54:44 +01:00
a7b613c88b Implement model prefix stripping and leading operator handling in utility functions
This commit introduces new functions to handle model prefix stripping and leading operator detection in the `utils.js` file. The `stripModelPrefixFromExpression` and `splitLeadingOperator` functions are added to enhance expression parsing. Additionally, existing functions are updated to utilize these new utilities, improving the handling of expressions in filters. Corresponding tests are added to ensure the correctness of the new functionality, particularly for equality and not-equal expressions.
2026-09-01 18:44:38 +01:00
1f679825df Add tax calculation helpers and integrate into existing schemas
This commit introduces a new `tax.js` module containing functions for tax rate resolution and amount calculation with tax. The `amountWithTax` and `resolveTaxRate` functions are integrated into various schemas, including `invoice`, `orderitem`, `shipment`, `courierservice`, `filament`, `part`, and `product`, enhancing their ability to compute amounts with applicable taxes. Additionally, corresponding tests are added to ensure the correctness of the new tax-related functionalities.
2026-09-01 17:39:12 +01:00
edb8282c41 Enhance filament stock management by adding default state and posting functionality
This commit updates the filament stock schema to set a default state of 'draft' and introduces a new route handler for posting filament stocks. The posting process includes validation to ensure stocks are in the draft state before transitioning to 'unconsumed', along with the creation of an initial stock event. Additionally, the service layer is updated to handle these changes, and tests are added to verify the new functionality.
2026-09-01 17:26:10 +01:00
2af78c76f4 Update allowed filters and sorters in stock audit levels to include 'tags' for enhanced categorization and sorting capabilities.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-09-01 16:35:07 +01:00
e1ac5bfba1 Add auditLines field to new stock audit level creation and mock stock audit module in tests
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-09-01 16:07:42 +01:00
3bd1549c85 Refactor stock transfer schema and related services to improve location handling
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit modifies the `stockTransfer` schema by removing the `toStockLocation` field and introducing `fromLocation` and `toLocation` fields, ensuring better clarity in stock transfer operations. The routes and services are updated to reflect these changes, including adjustments in the `executePostedLine` function to validate stock locations. Additionally, the allowed filters and sorters in the stock transfer routes are refined, enhancing the overall functionality and maintainability of the inventory management system.
2026-09-01 16:04:29 +01:00
6623bf9bfd Update stock audit level schema to require tags and improve code readability
This commit modifies the `stockAuditLevel` schema by making the `tags` field required, ensuring that all stock audit levels have associated tags for better categorization. Additionally, it enhances the readability of the `normalizeAuditLevelLine` function by adjusting the formatting of the item and itemSku assignments, improving overall code clarity.
2026-09-01 15:51:25 +01:00
bce40ce30d Add stock audit level management functionality and integrate with existing inventory system
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit introduces a new `stockAuditLevel` schema and corresponding routes for managing stock audit levels, enhancing the inventory management capabilities. It includes CRUD operations for stock audit levels, allowing for the creation, retrieval, updating, and deletion of audit levels. The integration with existing stock audit functionalities is established, enabling the association of audit levels with stock audits. Additionally, utility functions for handling stock audit levels are implemented, improving the overall structure and maintainability of the inventory system.
2026-09-01 15:41:32 +01:00
ec5783acd8 Refactor deviceInfo schema in host management to simplify structure
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit modifies the `deviceInfo` schema by removing unused fields such as `uptime`, `memory`, and `network`, streamlining the schema for better clarity and performance. The `deviceInfo` property in the `hostSchema` is updated to directly reference the `deviceInfoSchema`, enhancing code readability and maintainability.
2026-09-01 13:04:02 +01:00
6393ed5e3e Add rollup configurations and statistics methods to finance and inventory schemas
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit enhances the `invoice`, `taxrecord`, `orderitem`, `purchaseorder`, `shipment`, and `salesorder` schemas by introducing new rollup configurations for various states and values. It adds methods for aggregating statistics and historical data using `aggregateRollups` and `aggregateRollupsHistory`, improving data analysis capabilities across financial and inventory records. The new rollups include counts and sums for different transaction types and states, facilitating better reporting and insights into the application's financial and inventory management.
2026-08-30 14:56:48 +01:00
5e4830b036 Enhance number field handling in utility functions and add tests
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces new utility functions to support number field validation and regex condition building in the `utils.js` file. It updates the `buildEquality`, `buildComparison`, and `parseLeafCondition` functions to accommodate number fields, ensuring proper handling of numeric values in filters. Additionally, a new test suite is added to validate the behavior of the `parseFilter` function with number fields, covering various scenarios including exact matches, wildcard handling, and non-numeric input. This enhancement improves the robustness of the filtering mechanism in the application.
2026-08-30 12:48:04 +01:00
5f59c23fbe Remove debug logging statements from utility functions and schema files to clean up code and improve performance. This includes the removal of console logs in parseFilter, filterDistributeKeys, normalizeFilterQuery, and the stockevent schema, streamlining the codebase for better maintainability.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-30 12:26:08 +01:00
6a730294b1 Refactor filter handling in various routes to include master filter support
This commit updates multiple routes across the management and inventory modules to enhance the handling of property value requests. The `/values` endpoints are modified to incorporate a filtering mechanism that allows for both a standard filter and an optional master filter, improving the flexibility and accuracy of data retrieval. Additionally, debug logging statements are added to assist in tracking the filter parameters during requests. This refactor aims to streamline the data fetching process and improve the overall user experience when interacting with the API.
2026-08-30 12:25:10 +01:00
933d76969f Refactor eBay order and shipping services integration; introduce trading request utilities
This commit refactors the eBay order integration by introducing a new module for trading requests, encapsulating common functionalities such as XML parsing and request handling. The `orders.js` file is significantly expanded to include new parsing functions for shipping addresses, tracking details, and trading transactions, enhancing the overall order processing capabilities. Additionally, the `shippingServices.js` file is streamlined by removing deprecated constants and functions, replacing them with calls to the new trading request utilities. Comprehensive tests are added to ensure the correctness of the new functionalities and their integration with existing systems, improving the reliability of eBay marketplace operations.
2026-08-30 11:11:59 +01:00
1cef3a8d1d Implement syncWebhooks functionality and refactor ensureWebhookSubscriptions
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces the `syncWebhooks` function to streamline the process of synchronizing webhook configurations for marketplaces. It enhances the existing `ensureWebhookSubscriptions` function to utilize `syncWebhooks`, ensuring that webhook URLs and verification tokens are correctly set and updated. Additionally, a new module for managing webhook configurations is added, which includes utility functions for building webhook URLs and generating verification tokens. Tests are also included to validate the new functionality and its integration with existing systems, improving the overall reliability of webhook management.
2026-08-29 23:02:13 +01:00
61d29a8f7e Add syncHash and syncImageHash fields to listing and variant schemas; implement sync fingerprinting for marketplace integration
This commit introduces new fields `syncHash` and `syncImageHash` to the `listing` and `listingVariant` schemas, enhancing the tracking of synchronization states. Additionally, a new module for sync fingerprinting is added, which includes functions to generate hashes for listings and their variants. The marketplace integration logic is updated to utilize these hashes for determining if updates are necessary, improving efficiency in syncing operations. Tests are also added to ensure the correctness of the new functionality and its integration with existing systems.
2026-08-29 22:34:11 +01:00
37706f61c4 Add mock implementations for permissions module in user API tests
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces mock functions for the `permissions` module in the user API test file, enhancing test isolation and allowing for comprehensive testing of permission-related functionalities. The new mocks include methods for checking permissions, managing user permissions cache, and resolving permission settings, improving the overall test coverage and reliability of the user API tests.
2026-08-29 00:53:35 +01:00
e98828bfc7 Update configuration and enhance marketplace integration with new policies
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit modifies the log level in the configuration file from "trace" to "debug" for improved logging clarity. It also introduces new routes for fulfillment, return, and payment policies in the index file, enhancing the marketplace integration capabilities. Additionally, the initialization process is updated to start the marketplace worker, ensuring that the application can handle marketplace operations effectively. Various schemas are updated to include new fields and relationships for policies, improving the overall functionality and flexibility of the marketplace management system.
2026-08-29 00:47:55 +01:00
f5551f4f03 Refactor aggregateRollupsHistory function to improve rollup snapshotting
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit enhances the `aggregateRollupsHistory` function by restructuring the logic for filtering and processing audit logs, improving the accuracy of rollup snapshots over time. New utility functions are introduced to streamline the matching of objects against filters and to handle the existence of objects at specific timestamps. The overall flow is optimized to ensure that rollup calculations reflect the correct state of objects based on historical data, enhancing the reliability of data analysis and reporting.
2026-08-24 23:14:43 +01:00
9435d5c64c Add rollup statistics functionality to sales schemas
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit enhances the `client`, `listing`, and `marketplace` schemas by introducing rollup statistics and history tracking capabilities. New rollup configurations are added to count various states, such as 'active', 'inactive', and others specific to each schema. The `stats` and `history` static methods are implemented to aggregate data using the newly introduced `aggregateRollups` and `aggregateRollupsHistory` functions, improving data analysis and reporting for sales entities.
2026-08-24 23:02:47 +01:00
c57641518e Enhance inventory schemas with additional rollup configurations for stock types
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit adds new rollup configurations to the `filamentstock`, `partstock`, and `productstock` schemas to track the counts of different stock states: 'unconsumed', 'used', and 'consumed'. Additionally, the `stockevent` schema is updated to include rollup statistics for various stock types, improving the overall inventory management capabilities. Tests are also updated to mock new aggregate functions, ensuring comprehensive coverage of the new functionalities.
2026-08-24 22:54:09 +01:00
61ec9deecb Add utility functions for ObjectId handling and enhance expandObjectIds functionality
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces several utility functions in `utils.js` to improve ObjectId handling, including `isByte`, `isTwelveByteBuffer`, and `objectIdToString`. The `expandObjectIds` function is updated to better handle various ObjectId formats, including BSON ObjectIds and serialized 12-byte buffers. Additionally, comprehensive tests are added in `utils.expandObjectIds.test.js` to verify the correct behavior of these enhancements, ensuring robust handling of ObjectId conversions and expansions.
2026-08-24 22:40:07 +01:00
e2a135aa3d Enhance schema synchronization by adding change detection and statistics tracking
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.
2026-08-24 19:04:15 +01:00
8cd8ee6f94 Add stock quantity calculation to listing variant schema and enhance tests
This commit introduces a new utility function, `toId`, to handle ID conversions in the `listingvarient.schema.js` file. The `recalculate` method is updated to compute and update the stock quantity for listing variants based on product SKU and stock location. Additionally, a new test case is added in `stockQuantity.recalculate.test.js` to verify the correct behavior of stock quantity calculations before rolling up, ensuring comprehensive test coverage for this functionality.
2026-08-24 18:33:10 +01:00
e0f2870af3 Enhance test coverage by adding additional mock implementations for database and schema modules
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit expands the test setup in `stockQuantity.recalculate.test.js` and `shipments.test.js` by introducing new mock functions for various database operations, including `searchObjects`, `getPropertyValues`, and `listObjects`. These enhancements improve the isolation of tests and ensure that the tests can run independently of the actual database implementation. The updates also include mocks for sales order and marketplace schemas, further enriching the test environment and facilitating comprehensive testing of inventory-related functionalities.
2026-08-24 02:58:10 +01:00
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
b0943f3fa0 Enhance document template schema and service with referenced templates functionality
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces a new field, `referencedTemplates`, to the document template schema, allowing for the association of other document templates. It also adds utility functions for extracting references from template content and converting filter values to ObjectIds. The document template service is updated to recalculate and populate referenced templates when editing a document template. Additionally, route handlers are modified to support the new referenced templates in their population logic, improving the management of document templates.
2026-08-22 16:39:10 +01:00
827f3b7c8c Update progress messages in PDF generation tests for consistency and clarity
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit modifies the progress messages in the PDF generation tests to include ellipses and exclamation marks, enhancing the clarity and consistency of the output. The changes ensure that the messages reflect a more engaging user experience during the PDF generation process. Corresponding tests have been updated to verify these modifications.
2026-08-22 13:23:48 +01:00
97c44565a8 Implement EventManager for handling object events and enhance document template management
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit introduces the `EventManager` class, which facilitates tracking and broadcasting object events using NATS and websockets. The `documenttemplate.schema.js` file is updated to change the `testObject` field type to `ObjectId` with a reference path, improving data integrity. Additionally, the document template service is enhanced with new functionalities for asynchronous rendering and progress reporting, utilizing Redis for storing render requests. Corresponding tests are added to ensure the correct functionality of the new event handling and document management features.
2026-08-22 12:56:05 +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
4ee5eb7d0a Add pdf-lib dependency and implement PDF merging functionality
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces the `pdf-lib` library to facilitate PDF document manipulation. A new function, `mergePdfBuffers`, is added to handle the merging of multiple PDF buffers into a single document. Additionally, the PDF generation process is updated to support pagination, allowing for the export of each paginated page before merging. The changes enhance the PDF generation capabilities, ensuring that documents can be created with multiple pages while maintaining proper formatting and structure. Corresponding tests have been added to verify the new functionality.
2026-08-22 00:17:43 +01:00
bec4c8bf4c Enhance EJS formatting functionality with new placeholder handling and text tag collapsing
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces several improvements to the EJS formatting logic in the `templateformatter.js` file. It adds new regex patterns for inline placeholders and text-only tags, enhancing the ability to manage EJS content. The `maskEjsBlocks` function is updated to differentiate between control and inline EJS tags, while the `restoreEjsBlocks` function now handles both comment and inline placeholders. Additionally, a new function, `collapseTextOnlyTags`, is introduced to ensure that text content within tags is properly formatted without unnecessary whitespace. Corresponding tests have been added to verify these enhancements, improving the overall template content formatting capabilities.
2026-08-21 22:46:44 +01:00
ff60d6cf09 Enhance document size and template management with padding options
This commit introduces new padding options for document sizes, allowing for customizable print padding and specific padding values (left, right, top, bottom). The document size schema has been updated to include these new fields, and corresponding route handlers have been modified to handle padding data during document size creation and editing. Additionally, the template manager has been updated to apply padding when rendering templates, ensuring that the layout respects the specified padding values. Tests have been added to verify the correct application of padding in both document sizes and templates, improving the overall document formatting capabilities.
2026-08-21 22:39:13 +01:00
e8c9a307ab Enhance route permission checks across management and inventory modules
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit updates various route handlers in the management and inventory modules to include permission checks using the `checkPermissions` middleware. The changes ensure that access to properties, values, and search functionalities for different entities (e.g., users, products, tax rates) is properly restricted based on user permissions. This enhancement improves the security and integrity of the application by enforcing role-based access control across multiple routes.
2026-08-20 20:15:07 +01:00
bce5afad7e Implement caching and permission checks for user permissions
This commit introduces a caching mechanism for user permissions using Redis, enhancing performance by reducing database queries. The `permissions.js` file has been updated to include functions for saving and retrieving user permissions from Redis, as well as middleware for checking permissions in various routes. Additionally, tests have been added to ensure the correctness of the permission logic and caching behavior, improving the overall security and efficiency of the application.
2026-08-20 19:35:15 +01:00
1c51766da6 Add user group management functionality and refactor permission settings
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit introduces a new feature for managing user groups within the application, including the creation of a `usergroup.schema.js` file for the Mongoose schema and corresponding route handlers for CRUD operations. Additionally, the permission settings functionality has been refactored to use a singular `permissionSetting` model instead of the previous plural form. Tests have been added to ensure the functionality of both user groups and permission settings services, enhancing the application's capability to manage user roles and permissions effectively.
2026-08-20 15:04:52 +01:00