144 Commits

Author SHA1 Message Date
a996b05ead
Fix CS 2025-04-25 18:25:29 +02:00
6d76b94644
Refactor title translation logic in SpreadSheetFormatter.
Simplified and streamlined the handling of title translation. Added truncation for titles exceeding 30 characters to ensure proper formatting. This enhances code readability and ensures title length consistency.
2025-04-25 18:23:58 +02:00
ff6ec45575
Add center filtering logic to export generation
Introduced a `filterStatsByCenters` configuration in `ExportGenerator` to enable conditional center filtering during exports. Updated related methods and tests to account for this parameter, ensuring compatibility with both filtered and unfiltered scenarios.
2025-04-25 18:23:37 +02:00
c8851a8e8a
Handle empty array case in denormalizeDoctrineEntity method
Previously, the method did not explicitly handle empty arrays, which could lead to unexpected behavior. This update ensures that when an empty array is provided as an ID, an empty array is returned immediately.
2025-04-25 17:28:57 +02:00
abdfe49c33
Fix fixedDate logic to handle empty string check
Previously, the `fixedDate` logic did not account for empty strings, which could lead to unexpected behavior. This change ensures that `fixedDate` is validated for both null and empty string values before processing.
2025-04-25 14:38:32 +02:00
b414b27ba9
Make methods private in ExportDataNormalizerTrait
Changed the visibility of several methods from public to private to improve encapsulation and restrict access to internal logic. This enhances code maintainability and prevents unintended use outside the intended scope.
2025-04-25 11:31:31 +02:00
3f5ce5f841
Refactor filters to support "me" as a user option.
Replaced `PickUserDynamicType` with `PickUserOrMeDynamicType` across filters to enable handling of the "me" option. Introduced normalization and denormalization methods for "me" and adjusted all relevant queries and test cases to accommodate this enhancement.
2025-04-25 11:24:33 +02:00
65b7ed0755
Fix Cs (and problably signature of FormatterInterface) 2025-04-24 22:00:46 +02:00
a74118e5d4
Add context parameter to export generation methods 2025-04-24 22:00:13 +02:00
176bff0551
change FilterInterface::describeAction signature to include context 2025-04-24 21:48:00 +02:00
d49058805a
Refactor aggregator and filter retrieval into a new class
Moved aggregator and filter retrieval logic from ExportGenerator to the newly introduced ExportConfigProcessor class. This improves separation of concerns, simplifies ExportGenerator, and enhances code maintainability and readability. Updated related tests accordingly.
2025-04-24 14:21:16 +02:00
73496e0e1f
Add documentation for trait ExportDataNormalizerTrait 2025-04-23 09:46:11 +02:00
5a7bba83f7
Ignore PHPStan warning for deprecated method usage
Added a PHPStan ignore comment to bypass warnings for calling a deprecated method, which remains necessary for compatibility. This ensures functionality while avoiding static analysis issues.
2025-04-08 17:30:08 +02:00
b6375cad6c
fix tests 2025-04-08 16:32:56 +02:00
8c5abbff74
Update type handling in entity normalization methods
Extended support for `string` types in `normalizeDoctrineEntity` and `denormalizeDoctrineEntity` methods. This ensures compatibility with a broader range of identifier formats and improves flexibility in entity processing.
2025-04-08 15:49:55 +02:00
2b88593e64
Add RegroupmentRepositoryInterface and integrate it
Created a new `RegroupmentRepositoryInterface` to define repository methods for Regroupment entities. Updated `RegroupmentRepository` to implement this interface, and replaced its usage in `ExportConfigNormalizer` for better abstraction and testability.
2025-04-08 15:24:18 +02:00
a2713041da
fix cs 2025-04-08 14:09:16 +02:00
6f1a26742d
Refactor method signatures for stricter type safety
Updated method parameters to enforce stricter type declarations, improving code clarity and reducing potential runtime errors. This change ensures better consistency across interfaces and aligns with modern PHP typing practices.
2025-04-08 13:40:05 +02:00
0d0a626f50
Implements return types on aggregators 2025-04-08 12:38:52 +02:00
ec5f4ed1d6
Refactor type annotations in export interfaces
Updated return type annotations in `AggregatorInterface` for clarity and adjusted generics in `ListInterface` to better reflect supported query types. This improves code readability and strengthens type safety.
2025-04-08 12:38:38 +02:00
d9251239f7
Remove unused CSVFormatter and improve translations handling
CSVFormatter was deprecated and is no longer in use, so it was removed. Additionally, translation handling was enhanced across multiple formatters, supporting `TranslatableInterface` to ensure better localization compatibility.
2025-04-08 10:38:07 +02:00
b2d3d806b6
Fix PHPDocs and return type declarations in export interfaces
Corrected typos in PHPDocs, added missing type templates, and ensured proper return type declarations. These changes improve code readability, consistency, and type safety across export-related interfaces.
2025-04-08 10:37:47 +02:00
8e952cc966
Implements new return types 2025-04-07 14:35:29 +02:00
1c4ee37507
Refactor entity normalization to handle Doctrine Collection.
Updated `normalizeDoctrineEntity` to support normalizing `Collection` objects and handle null values in arrays. This ensures compatibility with a broader range of entity structures and improves data integrity during normalization.
2025-04-07 14:35:07 +02:00
8331a836f2
Add explicit return types and TranslatableInterface support
Updated interfaces to include explicit return types for improved type safety and readability. Integrated support for Symfony's TranslatableInterface in relevant methods to enhance translation handling.
2025-04-07 14:26:11 +02:00
2482dcc62e
Refactor ExportManager integration and remove ExportsCompilerPass
Replaced direct ExportManager dependencies in formatters with an ExportManagerAwareTrait to decouple components and enhance flexibility. Removed the ExportsCompilerPass as it is no longer required, and adjusted service configurations to improve reliability and consistency.
2025-04-07 12:42:28 +02:00
f9a55a1bfd
Fix debug artifact in ExportFormHelper
Removed unnecessary `dump()` calls when resolving centers and regroupments. This ensures cleaner processing and
2025-04-07 12:37:29 +02:00
15aa565caf
Add custom exception classes for export errors
Introduced `ExportRuntimeException` and `ExportLogicException` to better categorize exceptions in the export process. Updated `ExportGenerationException` to extend `ExportRuntimeException` for clearer hierarchy and improved maintainability.
2025-04-07 11:38:42 +02:00
566b72ec9e
Add $context parameter to export query generation
This update introduces the $context parameter to the query generator method. It ensures additional contextual data can be passed and utilized, improving the flexibility of export generation logic.
2025-04-07 11:31:52 +02:00
bb42ee25ff
Update initiateQuery method to include ExportGenerationContext
The `initiateQuery` method now consistently incorporates the `ExportGenerationContext` parameter across various export classes, improving functionality and standardization. This change ensures compatibility and alignment with the expected method signature.
2025-04-07 11:29:04 +02:00
aebeca1d7a
Use readonly properties in constructors for better immutability.
Converted constructor properties to readonly where applicable, ensuring immutability and promoting safer code practices. Updated throwable class reference for clarity and consistency.
2025-04-05 00:56:54 +02:00
3b0a4e9c73
Refactor exports to include ExportGenerationContext.
Updated initiateQuery methods to pass ExportGenerationContext, enabling better user-specific query filtering. Removed redundant user retrieval in FilterListAccompanyingPeriodHelper, now relying on context-provided user data.
2025-04-05 00:35:42 +02:00
b5fd9cf4af
Add SavedExportOptionsMigrator for migrating export options
Introduced SavedExportOptionsMigrator to handle the migration of saved export options with structures ensuring versioning. Added unit tests to validate transformation logic and edge cases for better reliability.
2025-04-05 00:35:16 +02:00
bb30ddc876
Add logging and validation to export generation handler
Introduce a logger to track processing steps, durations, and outcomes in `ExportRequestGenerationMessageHandler`. Add validation to prevent reprocessing of already generated export objects, ensuring robust error handling and improved traceability.
2025-04-05 00:08:37 +02:00
5ebb53173e
Fix PHPStan comment format in ExportGenerator.php
Updated the PHPStan ignore comment to use a single asterisk for consistency with comment style. This change does not affect functionality but improves code readability and adherence to coding standards.
2025-04-05 00:08:21 +02:00
d1d6a00ebf
Add failure handling for export generation errors
Introduce `OnExportGenerationFails` subscriber to handle export generation failures. It logs errors, updates the export status to failure, and records generation errors. Added tests to validate the new functionality.
2025-04-05 00:07:08 +02:00
e48bec490c
Compute allowed centers and regroupment at the time of generating the export 2025-04-03 17:47:46 +02:00
68b61b7d8a
Refactor export-related controllers and helpers
Removed unused dependencies, obsolete methods, and redundant parameters across ExportController, ExportFormHelper, and SavedExportController. Simplified session handling and aligned method signatures to improve maintainability and code readability.
2025-04-01 14:19:15 +02:00
1375a41de2
Refactor export handling to support ExportGeneration and SavedExport
Unified handling of ExportGeneration and SavedExport entities by introducing the SavedExportOrExportGenerationRepository. Simplified form data conversion using ExportConfigNormalizer, removing redundant FormBuilder logic. Adjusted dependent methods and controllers to accommodate these changes.
2025-04-01 10:38:51 +02:00
1ebf838bde
Refactor ExportRequestGenerationMessageHandler logic.
Enhance the message handler to properly manage stored objects by leveraging `StoredObjectManagerInterface` and `EntityManagerInterface`. Added logic for writing generated content, updating stored object status, and ensuring data persistence with a DB flush.
2025-03-13 14:19:00 +01:00
85a9c6bb67
Refactor export manager and normalize configuration handling
Simplified formatter and aggregator logic by removing redundant fields and improving method checks (e.g., `hasAggregator`, `hasFilter`). Adjusted test cases to align with the updated structure and added tests for empty data normalization and denormalization. Improved code readability and ensured better handling of edge cases in export data processing.
2025-03-13 14:18:54 +01:00
4f6a7116a4
fixup! Add ChillBundle normalization methods rector rule 2025-03-12 21:57:54 +01:00
cac7d33a44
fixup! Add ChillBundle normalization methods rector rule 2025-03-12 21:51:24 +01:00
4f030eb11a
Add date normalization and denormalization functionality
Introduce methods to normalize and denormalize DateTime objects using specific formats. Also, implement corresponding unit tests to ensure correct handling of single and multiple Doctrine entities, as well as date normalization.
2025-03-12 10:00:39 +01:00
0d2a487ae7
Add new normalization methods on filters, aggregators exports and formatter by applying rector rule 2025-03-11 22:28:42 +01:00
229f9b7125
Rename getVersion to getNormalizationVersion.
This change improves clarity by making the method name more descriptive and aligned with its purpose. All relevant interfaces, classes, and tests have been updated accordingly to reflect this renaming.
2025-03-10 21:37:32 +01:00
4fc433cd63
Rename and implement form data normalization for filters
The `StepFilterTest` was renamed to `StepFilterOnDateTest` for improved clarity. Added `normalizeFormData` and `denormalizeFormData` methods to `UserJobFilter` and `StepFilterOnDate` for handling form data conversions. Also introduced `ExportDataNormalizerTrait` to enhance consistency in data normalization processes.
2025-03-10 21:17:25 +01:00
2c812fc5fe
Generate export using denormalization 2025-02-23 23:16:30 +01:00
1f1d38acef
infrastructure for normalizing form config [WIP] 2025-02-21 15:08:09 +01:00
057c34610d
First step to async generation [WIP] 2025-02-20 14:33:50 +01:00