218 Commits

Author SHA1 Message Date
3d4150c6cc Add mock for getModelByName in database tests to enhance test coverage
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-10 02:03:38 +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
d3adf00477 Add sortSidebarVisibility field to user settings schema
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This update introduces a new field, `sortSidebarVisibility`, to the user settings schema, allowing for more flexible management of sidebar visibility preferences. The field is defined as a mixed type with a default value of an empty object, enhancing the schema's capabilities for user customization.
2026-08-09 20:54:59 +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
05d0cd539c Improve CORS error handling in index.js by logging allowed origins and the rejected origin. This change enhances debugging capabilities by providing clearer context when a request is denied due to CORS policy.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-02 01:27:20 +01:00
627de41cca Refactor CORS origin handling in index.js to support multiple origins using a Set for uniqueness. Log allowed origins during server initialization for better visibility and debugging. 2026-08-02 01:18:05 +01:00
87256257d7 Update CORS configuration in config.json and README.md to allow multiple origins. Refactor CORS handling in index.js to utilize new server.corsOrigins setting, enhancing API security and flexibility. 2026-08-02 01:01:50 +01:00
0dafdf1eda Update slicer.js and slicer.test.js to include createFileThumbnails function. This change integrates thumbnail creation into the slicer service and updates the test suite to mock the new function, enhancing testing coverage for file upload scenarios.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-01 18:30:26 +01:00
f69c88926c Refactor allowedFilters in inventory and management routes to improve consistency and readability. Cleaned up whitespace and ensured all filters are properly formatted for better query handling across purchase orders, shipments, and filament SKUs.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-08-01 18:25:59 +01:00
c0112d61fb Add thumbnail creation call in slicerUploadRouteHandler to generate file thumbnails upon upload. This enhancement improves the user experience by ensuring thumbnails are created for uploaded files.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-08-01 15:22:04 +01:00
6b80aee80a Refactor thumbnail creation logic in createFileThumbnails function to handle GCode file types and improve thumbnail source validation. Cleaned up whitespace and enhanced caching logic for better performance in database.js. 2026-08-01 15:10:59 +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
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
c233be5d80 Enhance allowedFilters in printers.js and subjobs.js to include 'state' and '_reference' for improved filtering capabilities. Cleaned up whitespace for better code readability.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-01 13:31:27 +01:00
664a3a4884 Update allowedFilters in jobs.js to include '_id' and '_reference' for enhanced filtering capabilities in job queries. Cleaned up whitespace for improved code readability. 2026-08-01 13:28:50 +01:00
7606afcf11 Add getObjectNeighbors mock implementation in various test files for improved neighbor retrieval functionality across multiple modules.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-08-01 13:26:23 +01:00
300478b62b Update package.json to specify pnpm as the package manager and add minimumReleaseAge to pnpm-workspace.yaml for improved workspace configuration.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-08-01 13:24:36 +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
6a9cd2a2ea Refactor Redis integration to use ioredis instead of redis, enhancing performance and compatibility. Updated connection handling and command syntax for improved functionality. Added new dependencies for ioredis and updated mongoose version in package.json.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-08-01 12:42:08 +01:00
7a1b85bb19 Updated allowedFilters in printers.js to include '_id' and '_reference' for enhanced filtering capabilities in printer queries. Cleaned up unnecessary whitespace in the file. 2026-08-01 12:41:29 +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
8ca49e5a87 Added vendor property to document printer route handlers for improved data handling during printer updates and creation.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-27 02:37:36 +01:00
b04030cdf1 Delete builds older than 25.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 23:56:15 +01:00
e1b6814efd Enhanced gcodeFile schema to populate part information during validation, improving data integrity for parts. Updated service functions to reflect changes in population logic for parts, ensuring accurate data retrieval.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 21:21:30 +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
3a79526eda Added unit property to spotlight object in trimSpotlightObject function, enhancing the object structure for improved data handling.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 20:03:06 +01:00
0b3a911611 Added recalculation logic to printer schema for managing printer states based on activity and online status. Integrated editObject utility for state updates, enhancing printer state management. 2026-07-26 19:40:16 +01:00
02a05231d1 Added support for tags in new host creation by including tags from the request body in the host object. This enhancement improves the data structure for host management. 2026-07-26 19:40:11 +01:00
6f59f75b41 Refactored newFilamentStockRouteHandler test to accommodate updated filament stock structure, including net and gross weight properties. Adjusted mock implementations to ensure accurate testing of stock creation and event handling.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 19:28:01 +01:00
5ee8f332e2 Enhanced filament schema and related service functions to include vendor information. Updated route handlers to support vendor population in filament queries and exports, improving data management and retrieval capabilities.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-26 19:07:41 +01:00
fa74c464f9 Added history tracking to inventory schemas (filament, part, product stocks) and stock events, enabling better state management and historical data retention. Updated related service functions to incorporate new history logic for stock events and recalculations.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-26 18:37:55 +01:00
9a22fd6452 Updated log level in config.json to 'trace' for more detailed logging. Refactored inventory schemas by removing redundant stock event calculation functions and integrating stock event recalculation logic into the stockevent schema, enhancing overall data management and performance. 2026-07-26 16:10:31 +01:00
8423db2858 Implemented a merge utility function for object updates in database.js to handle array merging correctly, enhancing cache update logic for improved data integrity.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 15:00:37 +01:00
c710f46a6f Added mock implementations for createFileThumbnails and getThumbnail functions in the file management tests to enhance testing capabilities for thumbnail generation and retrieval.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 03:10:32 +01:00
4231d548cc Added sharp and blurhash dependencies, implemented thumbnail generation and retrieval functionality in the file management system. Updated database schema to include thumbnail metadata and enhanced route handlers for thumbnail access.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-26 03:07:23 +01:00
4db7ffff6a Updated createOrUpdateUser function in auth.js to return the expanded object IDs from the new user document directly, ensuring accurate data representation upon user creation or update.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-26 00:43:32 +01:00
5e71afe246 Updated deleteObject function in database.js to convert ID values to strings before logging deletions and notifications, ensuring consistent data handling across operations.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-25 01:36:20 +01:00
13ddcbce61 Added mock implementations for getPropertyValues in various test files to enhance testing capabilities across multiple services, including management, finance, inventory, and production modules. This update ensures consistent behavior in tests by simulating property value retrieval.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-24 23:28:11 +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
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
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
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
82ca27756d Refactored editObject function to flatten object ID references before updating the database, ensuring proper data structure. Added corresponding test case to verify the flattening functionality in update operations.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
2026-07-20 02:28:13 +01:00
491900bdaf Refactored user model mock in app password tests to utilize a lean query for improved consistency in test behavior. Updated related test cases to reflect this change, ensuring accurate user data retrieval during authentication tests.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-20 02:18:36 +01:00
cb16385b33 Added printer and filament profile schemas, routes, and associated logic for managing profiles. Enhanced authentication for slicer uploads and integrated new routes for handling slicer-related operations. Updated database utilities and services to support new features, improving overall functionality and user experience.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
2026-07-20 02:11:44 +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