Torsten Schulz (local)
deaf5ac6ca
Refactor variable naming in DirectorWorker: Updated variable names to improve code clarity by prefixing with underscores for unused variables. This change enhances readability and maintains functionality without altering logic.
2026-02-04 14:50:39 +01:00
Torsten Schulz (local)
00cb97ec57
Enhance logging for sales checks in DirectorWorker: Added detailed logging statements to track the sales verification process, including cases with no items to sell and the number of inventory items found. This improves visibility into the sales workflow and aids in debugging.
2026-02-02 15:48:53 +01:00
Torsten Schulz (local)
658a9034ed
Add SQL query to count children by user: Introduced a new query to count distinct children associated with a user across all their characters. Updated UserCharacterWorker to utilize this new query, replacing the previous count query. This enhances user-specific data retrieval capabilities.
2026-02-02 15:25:13 +01:00
Torsten Schulz (local)
c24aa63f97
Fix SQL query parameter order in inventory update: Swap parameters in the execute call to correctly update inventory quantity based on the new quantity and inventory ID. Add comment for clarity on SQL operation.
2026-01-29 16:10:34 +01:00
Torsten Schulz (local)
05e6155e38
Enhance capacity management in DirectorWorker: Retrieve current capacity values directly from the database to prevent race conditions, calculate free capacity based on real-time data, and ensure production only occurs if sufficient storage is available. Update SQL query to check for adequate storage before returning production results.
2026-01-28 16:36:30 +01:00
Torsten Schulz (local)
1d9a7ba8a0
Refactor product cost retrieval in DirectorWorker: Simplify the SQL query by removing the original_sell_cost from the selection, and adjust the cost resolution logic to improve clarity and efficiency in database interactions.
2026-01-28 14:41:27 +01:00
Torsten Schulz (local)
c9e0781b61
Update dependencies and enhance WebSocket server logging: Add 'chrono' and 'android_system_properties' to Cargo.lock, improve error handling and logging in websocket_server.rs, and streamline character creation notifications in worker modules for better clarity and maintainability.
2026-01-28 14:21:28 +01:00
Torsten Schulz (local)
1505d3d004
Refactor production initiation logic in DirectorWorker: Update the create_single_production method to return the produced quantity, enhancing the loop's decision-making process. Improve error handling and logging for production failures, ensuring better capacity management and preventing race conditions during production checks.
2026-01-12 16:52:18 +01:00
Torsten Schulz (local)
5475ae24f6
Refactor production calculation in DirectorWorker: Update the logic for determining the number of items to produce, ensuring it adheres to capacity constraints and maximum production limits. Add safety checks and logging for potential errors in production calculations, enhancing reliability and debugging capabilities.
2026-01-12 14:01:18 +01:00
Torsten Schulz (local)
108ac6c82b
Refactor QUERY_GET_BEST_PRODUCTION SQL query in Worker: Improve readability and maintainability by restructuring the query with clearer aliases and consistent use of COALESCE. Enhance join conditions and ensure proper handling of character health, resulting in more accurate production worth calculations.
2026-01-05 11:44:44 +01:00
Torsten Schulz (local)
713504d3ab
Refactor DirectorWorker SQL queries: Remove unused QUERY_GET_DIRECTOR_USER and update vehicle count retrieval to use consistent column names. This improves code clarity and maintains consistency in data handling.
2026-01-05 11:32:56 +01:00
Torsten Schulz (local)
ade3bff5cf
Refactor revenue and tax calculations in DirectorWorker: Update pricing logic to compute revenue based on piece price and quantity, adjust profit calculations, and implement optional treasury user ID from environment variables for tax handling. This enhances accuracy in financial computations and improves code clarity.
2025-12-23 12:16:58 +01:00
Torsten Schulz (local)
08563c956c
Add vehicle repair automation in DirectorWorker: Implement functionality to automatically repair vehicles based on their condition and region. Update SQL queries to support vehicle selection and repair operations, enhancing the Director's capabilities in managing vehicle maintenance.
2025-12-22 15:07:02 +01:00
Torsten Schulz (local)
1719af2344
Refactor revenue and tax calculations in DirectorWorker: Adjust the pricing logic to account for cumulative tax inflation, ensuring accurate revenue and payout calculations. Update SQL query for sell logs to change conflict resolution order for better data integrity.
2025-12-20 15:20:03 +01:00
Torsten Schulz (local)
6d12c70d84
Entferne Info-Logs aus den Worker-Klassen: Reduziere die Protokollierung in ProduceWorker, DirectorWorker und TransportWorker, um die Ausgabe zu optimieren und nur Fehler zu protokollieren.
2025-12-16 12:58:37 +01:00
Torsten Schulz (local)
74fee2d4c9
Verbessere Fehlerbehandlung in SQL-Abfragen: Füge detaillierte Fehlermeldungen für Vorbereitungs- und Ausführungsfehler in den Director- und Politics-Workern hinzu.
2025-12-16 08:52:08 +01:00
Torsten Schulz (local)
10bc1e5a52
Refactor SQL queries into a dedicated module
...
- Moved SQL queries from multiple worker files into `src/worker/sql.rs` for better organization and maintainability.
- Updated references in `stockage_manager.rs`, `transport.rs`, `underground.rs`, `user_character.rs`, and `value_recalculation.rs` to use the new centralized SQL queries.
- Improved code readability by replacing `.get(0)` with `.first()` for better clarity when retrieving the first row from query results.
- Cleaned up unnecessary comments and consolidated related SQL queries.
2025-12-13 11:57:28 +01:00
Torsten Schulz (local)
a9d490ce38
Refactor SQL queries into centralized module
...
- Moved various SQL query strings from individual worker files into a new `sql.rs` module for better organization and reusability.
- Updated `events.rs`, `underground.rs`, and `weather.rs` to use the centralized SQL queries.
- Removed redundant query definitions from `events.rs`, `underground.rs`, and `weather.rs`.
2025-12-12 15:18:30 +01:00
Torsten Schulz (local)
eab46f5cdc
Verbessere Preisberechnung im DirectorWorker: Implementiere kumulative Steuerberechnung basierend auf regionalen Büros und deren Befreiungen, um die Genauigkeit der Einnahmen und Auszahlungen zu erhöhen.
2025-12-12 07:52:53 +01:00
Torsten Schulz (local)
1134be0f8d
Enhance tax calculation in DirectorWorker: Integrate DEFAULT_TAX_PERCENT and DEFAULT_TREASURY_USER_ID for improved financial operations during product sales.
2025-12-10 12:57:08 +01:00
Torsten Schulz (local)
688b21581d
Enhance logging in BaseWorker and DirectorWorker: Added detailed debug logs before database calls in change_falukant_user_money, improving traceability of user ID and money change values during production start and sell operations.
2025-12-08 16:07:08 +01:00
Torsten Schulz (local)
8db82e0ced
Refactor transport planning in DirectorWorker: Updated variable naming for clarity by changing 'shipped' to '_shipped' to indicate unused variable. Removed unused get_branch_user_id function from TransportWorker to streamline code and improve maintainability.
2025-12-05 14:20:56 +01:00
Torsten Schulz (local)
f481ef4b73
Refactor inventory handling in DirectorWorker: Updated transport planning logic to ensure inventory is reduced immediately after successful transport creation. Removed redundant inventory updates from the planning phase, enhancing consistency and clarity in inventory management. Improved logging to reflect changes in inventory status during transport operations.
2025-12-05 14:17:57 +01:00
Torsten Schulz (local)
b59837feb3
Refactor transport planning logic in DirectorWorker: Improved handling of empty transports for vehicle retrieval when no vehicles are available in the current branch. Enhanced checks for free vehicles and better selling prices in other branches, along with detailed logging for improved traceability during transport operations.
2025-12-05 12:56:59 +01:00
Torsten Schulz (local)
9f2f20cba2
Add empty transport planning in DirectorWorker: Introduced SQL queries and logic to handle empty transports for vehicle retrieval when no transport vehicles are available in the current branch. Enhanced the planning process to check for better selling prices in other branches and available free vehicles, improving transport management and operational efficiency.
2025-12-04 16:31:39 +01:00
Torsten Schulz (local)
940706bed3
Enhance logging and vehicle checks in DirectorWorker: Added SQL queries to verify the existence of vehicles in the source region and routes between regions. Improved debug logging to provide insights into vehicle counts and route availability, enhancing traceability during transport planning operations.
2025-12-03 16:54:22 +01:00
Torsten Schulz (local)
66b19fbe7c
Enhance logging in DirectorWorker for transport planning: Added detailed error and status messages throughout the transport planning process, including inventory checks, transport feasibility assessments, and pricing evaluations. This improves traceability and debugging capabilities for transport operations associated with directors.
2025-12-03 16:52:38 +01:00
Torsten Schulz (local)
d2c8b62156
Implement transport management in DirectorWorker: Enhanced the start_transports_stub function to handle transport planning for inventory items associated with a director. Added error handling for transport initiation and improved database interactions for inventory management, ensuring accurate transport planning and logging of potential errors.
2025-12-03 16:42:36 +01:00
Torsten Schulz (local)
c943e57f80
Enhance production management by adding region_id to ProductionPlan and updating SQL queries: Introduced region_id to the ProductionPlan struct and modified the insert production query to include weather_type_id based on region. Updated finished productions query to account for weather effects on quality ratings, ensuring accurate production assessments. Improved comments for clarity on the impact of weather on production quality.
2025-12-02 09:57:31 +01:00
Torsten Schulz (local)
4a2e814803
Enhance pricing logic in DirectorWorker and implement hourly price recalculation: Added a new worth_percent field to the InventoryItem struct and updated SQL queries to incorporate this value in price calculations. Refactored price computation logic to use a base price derived from worth_percent. Introduced a new hourly price recalculation mechanism that adjusts prices based on sales data from the last hour, ensuring dynamic pricing adjustments. Enhanced logging for better monitoring of price updates.
2025-12-02 08:55:01 +01:00
Torsten Schulz (local)
9ee8c970c7
Add branch capacity query and production limits in DirectorWorker: Introduced a new SQL query to fetch current stock and production values for a branch, enabling dynamic production management. Implemented logic to limit concurrent productions to a maximum of two and updated production creation to handle single production requests efficiently. Enhanced logging for better traceability of production activities.
2025-12-01 16:23:40 +01:00
Torsten Schulz (local)
513862a157
Limit maximum production quantity in DirectorWorker: Updated the production calculation to cap the output at 100 units per start, ensuring it does not exceed available capacity or financial constraints. Enhanced comments for better understanding of the production limits.
2025-12-01 15:55:59 +01:00
Torsten Schulz (local)
bd9fbb80c0
Enhance production job handling in DirectorWorker: Implemented a limit on the number of concurrent production jobs per branch to a maximum of two. Updated SQL query for fetching finished productions to aggregate quality ratings correctly and ensure unique results per production ID. Improved comments for clarity on the logic and SQL structure.
2025-12-01 14:32:31 +01:00
Torsten Schulz (local)
3e9f921f4f
Enhance DirectorWorker functionality: Added branch_id to the Director struct and updated SQL queries to include branch_id as a parameter. Improved logging messages to include branch_id for better traceability during production, transport, and sales checks. This change enhances the clarity and functionality of the DirectorWorker's operations.
2025-12-01 11:59:03 +01:00
Torsten Schulz (local)
a0e14788c7
Refactor money update execution in BaseWorker: Simplified the SQL execution by directly constructing the update query without parameterized placeholders, addressing serialization issues. Updated comments for clarity on the handling of money values and ensured compatibility with trusted data sources. Additionally, modified the casting of money in the director query to text for consistent mapping in Rust.
2025-12-01 11:31:37 +01:00
Torsten Schulz (local)
260b3b2962
Refactor SQL parameter handling in BaseWorker: Updated the execution of the money update query to pass parameters in their natural types, allowing PostgreSQL to handle type casting automatically. Improved comments for clarity on the changes made to ensure compatibility with the existing database schema.
2025-12-01 11:18:54 +01:00
Torsten Schulz (local)
d98620ea06
Refactor SQL query in DirectorWorker: Removed unnecessary conditions from the query for fetching transport vehicles, simplifying the logic while maintaining functionality. This change enhances query readability and performance.
2025-12-01 10:55:50 +01:00
Torsten Schulz (local)
7ae2f0c6c9
Enhance money production calculation in DirectorWorker: Updated the logic to handle cases where available money is zero, allowing production limits to be determined by capacity instead. Added warning logging for unexpected zero money scenarios, improving error handling and visibility in production planning.
2025-12-01 10:37:05 +01:00
Torsten Schulz (local)
cf874a7b8d
Refactor map_row_to_production_plan in DirectorWorker: Simplified the parsing of database fields by introducing local variables for required and optional fields. This change enhances readability and maintains default values for optional fields, improving the robustness of production plan creation.
2025-12-01 10:25:33 +01:00
Torsten Schulz (local)
9715723db7
Improve logging in DirectorWorker: Added detailed error messages and production calculations to enhance visibility into production planning and execution. Included checks for running productions and capacity constraints, ensuring better tracking of production processes.
2025-12-01 10:23:42 +01:00
Torsten Schulz (local)
d5017ef1e1
Enhance logging and error handling in DirectorWorker: Added detailed logging for production, transport, and sales checks for directors. Included a warning message when no directors are found for actions, improving visibility into the task execution process.
2025-12-01 10:09:19 +01:00
Torsten Schulz (local)
fbca231de5
Add running_productions_quantity to ProductionPlan: Introduced a new field to track the quantity of ongoing productions. Updated the DirectorWorker to parse this new field from the database and adjusted the free capacity calculation accordingly. Enhanced logging to provide detailed information when production cannot be started due to capacity constraints.
2025-12-01 10:04:09 +01:00
Torsten Schulz (local)
8a08a74b80
Refactor ProductionPlan to use f64 for money: Updated the money field in ProductionPlan from i32 to f64 to accommodate decimal values from the database. Adjusted related calculations in DirectorWorker to handle floating-point arithmetic for production costs and money management, ensuring accurate financial computations.
2025-12-01 09:35:23 +01:00
Torsten Schulz (local)
407cdd9bdc
Add transport planning functionality in DirectorWorker: Introduced logic for planning transports for inventory items, including new SQL queries for fetching regional worth and available transport vehicles. Enhanced inventory management by updating quantities based on transport outcomes and improved logging for transport planning decisions.
2025-11-26 16:21:11 +01:00
Torsten Schulz (local)
d0ec363f09
Initial commit: Rust YpDaemon
2025-11-21 23:05:34 +01:00