Torsten Schulz (local)
d801a26417
Refactor sellAllProducts method in FalukantService to ensure atomic transactions for selling products, updating inventory, and handling financial transactions. Implement batch processing for sell items and enhance error handling for inventory deletions. Update updateFalukantUserMoney function to support transactions, improving consistency and reliability in financial operations.
2025-12-20 22:04:29 +01:00
Torsten Schulz (local)
5b0b36c86d
Add request and SQL performance logging features to backend
...
- Implement request timing middleware in app.js to log slow requests and all requests based on environment variables.
- Enhance sequelize.js with optional SQL query timing and logging capabilities, allowing for performance monitoring of database queries.
2025-12-20 16:35:30 +01:00
Torsten Schulz (local)
83bed991bf
Optimize getInventory method in FalukantService by replacing nested includes with a single SQL query for improved performance. Add error handling for invalid branchId input.
2025-12-20 16:13:33 +01:00
Torsten Schulz (local)
114cfa8f66
Add error handling for missing branches in sell batch processing in FalukantService. Ensure that missing branch IDs trigger an error to prevent accounting mismatches.
2025-12-20 16:01:18 +01:00
Torsten Schulz (local)
38c65fcd76
Implement synchronous price calculation for batch operations in FalukantService, optimizing performance by reducing database queries. Update inventory handling to batch delete items and enhance revenue calculations. Fix translation formatting in German locale for sellAllSuccess message.
2025-12-20 15:37:16 +01:00
Torsten Schulz (local)
60bfa77dca
Backend error fixed
2025-12-20 15:06:43 +01:00
Torsten Schulz (local)
4390666e3f
Refactor SQL joins in calcRegionalSellPrice function of FalukantService to use updated region type table for improved clarity and consistency in tax calculations.
2025-12-20 15:03:03 +01:00
Torsten Schulz (local)
43e2e3ec80
Refactor tax calculation in calcRegionalSellPrice function of FalukantService to convert exemptTypes Set to PostgreSQL array string for improved query performance and clarity.
2025-12-20 14:54:32 +01:00
Torsten Schulz (local)
b999b8865f
Enhance getCumulativeTaxPercentWithExemptions function in FalukantService to first retrieve the character associated with the userId, ensuring accurate filtering of political offices by characterId for regional tax calculations.
2025-12-20 11:09:03 +01:00
Torsten Schulz (local)
7aed6679aa
Fix cumulative tax calculation in FalukantService by using falukantUser.id instead of user.id for accurate regional tax assessments.
2025-12-20 11:04:21 +01:00
Torsten Schulz (local)
a98ea5f9ef
Refactor getCumulativeTaxPercentWithExemptions function in falukantService.js to filter political offices by userId through the FalukantCharacter model. Update query structure to enhance clarity and ensure accurate data retrieval for regional tax calculations.
2025-12-20 10:48:56 +01:00
Torsten Schulz (local)
5cc90db021
Implement logic to create tables without Foreign Key constraints in sequelize.js when referenced tables do not exist. Enhance error handling and logging to provide clear feedback during synchronization attempts, improving robustness in model management.
2025-12-19 08:37:40 +01:00
Torsten Schulz (local)
9a6212f268
Enhance error handling in sequelize.js for Foreign Key Constraint Errors by adding logging for orphaned records and skipping problematic models during synchronization. Update syncDatabase.js to include cleanup logic for orphaned political_office entries, improving database integrity and user feedback during sync operations.
2025-12-19 08:34:04 +01:00
Torsten Schulz (local)
76dccbc67b
Refactor error handling in sequelize.js to skip model synchronization for cases with duplicate pg_description entries or multiple tables with the same name. Update logging to provide clearer feedback on sync failures and the reasons for skipping models, enhancing user understanding of potential issues.
2025-12-19 08:13:52 +01:00
Torsten Schulz (local)
7696d5caa2
Improve error handling and logging for duplicate pg_description cleanup in sequelize.js. Update comments for clarity on permission requirements and provide detailed instructions for manual cleanup by database administrators. Enhance user feedback during synchronization attempts to address potential permission issues.
2025-12-19 07:56:07 +01:00
Torsten Schulz (local)
6e45814e3d
Refactor duplicate entry cleanup in sequelize.js by replacing DO $$ blocks with direct parameter substitution in SQL queries. This change enhances performance and security while maintaining the logic for cleaning up duplicate pg_description entries before and after model synchronization.
2025-12-19 07:53:34 +01:00
Torsten Schulz (local)
3dfe73957c
Enhance model synchronization in sequelize.js by adding logic to clean up duplicate pg_description entries before and after sync attempts. Implement error handling for potential sync failures related to duplicate entries, improving robustness and clarity in foreign key management during model synchronization.
2025-12-18 17:53:24 +01:00
Torsten Schulz (local)
0f94ab0709
Refactor associations in models to include constraints: false, preventing automatic foreign key creation. Update sequelize.js to enhance foreign key management during model synchronization, ensuring associations are restored correctly after sync operations.
2025-12-18 17:44:17 +01:00
Torsten Schulz (local)
389a479dbf
Enhance foreign key management in sequelize.js by refining schema handling and improving logging for foreign key removal during model synchronization. Add detailed console outputs for better visibility on foreign key operations and error handling.
2025-12-18 16:45:56 +01:00
Torsten Schulz (local)
31e60b8eb1
Implement foreign key removal before model synchronization in sequelize.js to prevent conflicts during sync. Add error handling and logging for better visibility on foreign key management.
2025-12-18 16:39:34 +01:00
Torsten Schulz (local)
366fa68cc3
Improve model synchronization in sequelize.js by temporarily removing associations to prevent automatic foreign key creation. Add logging for association management during the sync process, ensuring clarity in model handling.
2025-12-18 16:36:26 +01:00
Torsten Schulz (local)
d34d0667c3
Add logging for model synchronization and cache handling in syncDatabase.js
...
Enhance sequelize.js by adding a console log to indicate when models are being synced without constraints. Update syncDatabase.js to include important notes on caching issues with Node.js ES-Modules and log the model loading process during deployment synchronization.
2025-12-18 16:34:10 +01:00
Torsten Schulz (local)
30627b318b
Update model synchronization in sequelize.js to prevent automatic foreign key creation by adding constraints: false, ensuring foreign keys are managed through migrations only.
2025-12-18 16:14:53 +01:00
Torsten Schulz (local)
57ca664b51
Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.
2025-12-18 16:08:30 +01:00
Torsten Schulz (local)
a15e017ed0
Enhance syncDatabase function to include cleanup for orphaned child_relation entries with invalid father_character_id, mother_character_id, or child_character_id references, improving data integrity and logging consistency.
2025-12-18 15:59:35 +01:00
Torsten Schulz (local)
b6c4d62ecc
Refactor user_house model to remove default values for houseTypeId and userId fields, and enhance syncDatabase function to include cleanup for orphaned user_house entries with invalid house_type_id or user_id references, improving data integrity and logging.
2025-12-18 15:57:39 +01:00
Torsten Schulz (local)
6703c0c390
Enhance syncDatabase function to include cleanup for orphaned promotional_gift entries, removing invalid sender and recipient character references, and improve logging for orphaned entry detection.
2025-12-18 15:49:34 +01:00
Torsten Schulz (local)
ccee65aa2e
Refactor Notification model to remove VIRTUAL field definition for characterName and implement a getter method for improved data handling and synchronization.
2025-12-18 15:43:54 +01:00
Torsten Schulz (local)
fd14bd6081
Refactor VIRTUAL field detection logic in sequelize.js to improve accuracy and add special handling for Notification model's characterName field, addressing a Sequelize bug related to field mapping.
2025-12-18 15:37:52 +01:00
Torsten Schulz (local)
a1bf9fedce
Enhance VIRTUAL field detection in sequelize.js by implementing multiple identification methods, ensuring accurate model synchronization and preventing unintended field removals.
2025-12-18 15:34:26 +01:00
Torsten Schulz (local)
a8eeb1f683
Add socket notification for status bar updates in FalukantService and enhance model sync by handling VIRTUAL fields in sequelize.js
2025-12-18 15:25:24 +01:00
Torsten Schulz (local)
252c19fa58
Refactor syncDatabase function to improve orphaned entry cleanup for knowledge and notification, ensuring data integrity and consistent logging.
2025-12-18 15:20:09 +01:00
Torsten Schulz (local)
431f3fa08d
Add cleanup for orphaned notification entries in syncDatabase functions to remove invalid user_id references, improving data integrity and logging consistency.
2025-12-18 15:18:21 +01:00
Torsten Schulz (local)
1f5860ee40
Add cleanup for orphaned knowledge entries in syncDatabase functions to remove invalid character_id and product_id references, enhancing data integrity and logging.
2025-12-18 15:17:01 +01:00
Torsten Schulz (local)
ad0d7f6f1e
Refactor stock cleanup logic in syncDatabase functions to remove orphaned stock entries with invalid branch_id and streamline logging for orphaned entries.
2025-12-18 15:13:24 +01:00
Torsten Schulz (local)
b25698b120
Implement cleanup of orphaned user_param_visibility entries before schema updates in syncDatabase functions
2025-12-18 15:11:50 +01:00
Torsten Schulz (local)
95fc20318f
Add index on (user_id, shown) in notification table to optimize markNotificationsShown queries and prevent deadlocks. Implement transaction handling in markNotificationsShown method for atomic updates.
2025-12-18 15:04:37 +01:00
Torsten Schulz (local)
04626b25c9
Refactor product model by removing unused sellCostMinNeutral and sellCostMaxNeutral fields, and simplify product insertion logic in initialization script.
2025-12-18 14:41:56 +01:00
Torsten Schulz (local)
0b2317906b
Activate pgcrypto extension for digest() function in database initialization and migration scripts
2025-12-18 14:11:15 +01:00
Torsten Schulz (local)
5b3ce93d56
Füge Spalte product_quality zur Tabelle stock hinzu und erstelle Migration für weather_type_id in production
2025-12-16 13:00:29 +01:00
Torsten Schulz (local)
cb3510bbff
Implement tax handling for branches by adding tax percent to regions, updating product sell costs, and enhancing UI for tax summaries in BranchView
2025-12-09 16:16:08 +01:00
Torsten Schulz (local)
3e381ef750
Enhance notification enrichment by recursively collecting character IDs and attaching character names
2025-12-09 00:06:09 +01:00
Torsten Schulz (local)
eccf2b2688
Enhance notification handling by enriching notifications with character names
2025-12-08 23:55:50 +01:00
Torsten Schulz (local)
4794ee2198
Add character_name field and trigger for notifications in Falukant module
2025-12-08 23:37:07 +01:00
Torsten Schulz (local)
44d83aab13
Add heir management functionality in Falukant module
...
- Implemented setHeir method in FalukantService to designate a child as heir, including validation checks for user and child relationships.
- Updated FalukantController to expose the setHeir endpoint, allowing users to set heirs via the API.
- Enhanced FalukantRouter with a new route for setting heirs.
- Modified FamilyView component to include UI elements for setting heirs, with success and error feedback.
- Updated localization files in both German and English to include new translations related to heir management, improving user experience.
2025-12-08 13:22:43 +01:00
Torsten Schulz (local)
b34ca1d894
Enhance weather data handling in FalukantService and update localization files
...
- Modified the FalukantService to explicitly load weather data for all regions, ensuring accurate weather information is associated with branches.
- Updated the return logic to utilize the newly loaded weather data, improving data accuracy in branch responses.
- Added new random event messages in both German and English localization files, enhancing user experience with richer event descriptions.
2025-12-08 11:54:10 +01:00
Torsten Schulz (local)
e13a14e45e
Add bulk vehicle repair functionality in Falukant module
...
- Implemented a new repairAllVehicles method in FalukantService to handle the repair of multiple vehicles at once, including cost calculation and precondition checks.
- Updated FalukantController to expose the repairAllVehicles endpoint, allowing users to initiate bulk repairs via the API.
- Enhanced FalukantRouter to include a new route for bulk vehicle repairs.
- Modified BranchView component to add UI elements for repairing all vehicles, including a dialog for confirmation and displaying repair details.
- Updated German localization files to include translations related to bulk vehicle repair actions, improving user experience for German-speaking users.
2025-12-08 08:36:21 +01:00
Torsten Schulz (local)
b925be5cd1
Enhance nobility ID validation in FalukantService
...
- Added checks to ensure that provided nobility IDs are valid and exist in the database, improving error handling and user feedback.
- Updated logic to use loaded nobility objects when adding invited nobilities to a party, optimizing database interactions.
2025-12-05 20:49:12 +01:00
Torsten Schulz (local)
adddbcd287
Refactor availability status logic in FalukantService
...
- Enhanced the logic for determining the availability status of vehicles based on the 'availableFrom' date.
- Added conditions to differentiate between 'building' and 'available' statuses, improving clarity and accuracy in status reporting.
- Updated comments for better understanding of the code flow.
2025-12-05 17:23:54 +01:00
Torsten Schulz (local)
2b6227c543
Add vehicle repair functionality in Falukant module
...
- Implemented a new repairVehicle method in FalukantService to handle vehicle repairs, including cost calculation and precondition checks.
- Updated FalukantController to expose the repairVehicle endpoint, allowing users to initiate repairs via the API.
- Enhanced FalukantRouter to include a new route for vehicle repairs.
- Modified BranchView component to add UI elements for repairing vehicles, including a dialog for repair confirmation and displaying repair details.
- Updated German localization files to include translations related to vehicle repair actions, improving user experience for German-speaking users.
2025-12-05 14:40:55 +01:00