14 Commits

Author SHA1 Message Date
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
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
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
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
c043ad7a86 Enhance allowedFilters across multiple routes to include 'createdAt', 'updatedAt', and '_reference' for improved filtering capabilities. This update applies to finance, inventory, management, and sales modules, ensuring consistency and better query handling.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-01 14:26:40 +01:00
74c0d8eb52 Refactor propertiesAllowedFilters across various routes to streamline filtering logic. Removed redundant allowedFilters definitions and replaced them with propertiesAllowedFilters for improved query handling in finance, inventory, and management modules.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-08-01 13:22:51 +01:00
1e807beacf Implement neighbors caching and retrieval for various entities in the inventory and finance modules. Introduced new route handlers for fetching neighbors in invoices, payments, tax records, filament stocks, order items, part stocks, product stocks, purchase orders, shipments, stock audits, stock events, stock locations, and stock transfers. Updated allowed filters for improved query capabilities across these routes. Enhanced database.js with caching logic for neighbors, including cache invalidation on object updates.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-08-01 13:20:01 +01:00
287e74b682 Added new route handlers and service functions to retrieve distinct property values for various entities, including invoices, payments, tax records, filament stocks, and more. Updated corresponding routes to support these new functionalities across multiple management and production modules, enhancing data querying capabilities.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-24 23:19:48 +01:00
11ff82a9af Enhanced various route handlers and services to support an additional master filter parameter for improved data querying capabilities. Updated related functions across multiple management and production routes, ensuring consistent handling of master filters in property-based queries. 2026-07-24 21:52:54 +01:00
50eacb3974 Added text indexes to various schemas for improved search capabilities across finance, inventory, and management modules. Updated route handlers to include search functionality for invoices, payments, tax records, and inventory items, enhancing data retrieval efficiency.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-04 16:48:50 +01:00
55a1633eab Updated import paths. 2025-12-13 21:14:06 +00: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