Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/levende arbeidsforhold (#3594)
* **Refactor parameter handling and add logging** #deploy-dolly-frontend #deploy-levende-arbeidsforhold-scheduler #deploy-levende-arbeidsforhold-ansettelse Replaced JobbService with ParameterService for parameter management and added LoggService to handle logging operations in the application. This refactoring enhances the structure and maintainability of the services while improving traceability through logging. * **Improve error handling and add entity equality methods** #deploy-test-frontend #deploy-levende-arbeidsforhold-ansettelse #deploy-levenede-arbeidsforhold-scheduler Enhanced error handling in ParameterController by removing try-catch and ensuring HTTP OK status. Added equals and hashCode methods to AnsettelseLogg and JobbParameter for better entity management and comparison. * Remove AnsettelseLoggDTO and update Flyway config #deploy-levende-arbeidsforhold-ansettelse Deleted the unused AnsettelseLoggDTO class as part of code cleanup. Additionally, enabled the Flyway `baseline-on-migrate` option in application.yml to ensure proper database migration handling. * Refactor verdier type to List<String> in JobbParameter #deploy-levende-arbeidsforhold-ansettelse Updated the 'verdier' field in JobbParameter from String to List<String> to better align with data requirements. This change ensures that multiple values can be stored and managed effectively. * Change HTTP method from GET to POST in AnsettelsesCommand #deploy-levendearbeidsforhold-scheduler Updated the call method to use POST instead of GET for the "/api/v1/ansettelse" endpoint. This change is required to meet the API specifications and ensure proper data handling. * deploy #deploy-levende-arbeidsforhold-scheduler * Refactor schedulers and update controller mappings #deploy-levende-arbeidsforhold-scheduler #deploy-levende-arbeidsforhold-ansettelse Rearranged variable declarations in JobbScheduler.java for better readability. Changed REST endpoint mappings in JobbController.java from GET to PUT for starting and stopping the scheduler. Updated config files to include new applications and corrected existing rule entries. * Add version and logback config, update security URLs #deploy-levende-arbeidsforhold-scheduler Updated application version in application.yml to "1" and added logback-spring.xml for logging configuration. Also, modified SecurityConfig to refine request matchers and ensure proper authorization for "/api/**" endpoints. * Create RequestDTO and update controller logic #deploy-levende-arbeidsforhold-scheduler Introduced a new RequestDTO class to encapsulate request parameters for the scheduler. Refactored JobbController to accept this DTO and streamlined scheduler handling logic, replacing ResponseEntity with a simpler string return and incorporating exceptions for invalid input. Finally, adjusted client-side code to align with updated endpoint mappings. * Rename interval to intervall in RequestDTO #deploy-levende-arbeidsforhold-scheduler Updated the RequestDTO field from 'interval' to 'intervall' to ensure consistency with domain terminology. Removed unnecessary schema annotation from JobbController, adjusted method logic to reflect field renaming, and added logging for incoming requests. * Refactor reschedule method to use @RequestParam #deploy-levende-arbeidsforhold-scheduler Refactored the `reschedule` method in `JobbController` to use `@RequestParam` instead of `@RequestBody` for the `intervall` parameter. This change simplifies the HTTP request required to trigger scheduler activation. Removed the `RequestDTO` dependency and cleaned up the associated code. * Rename Appstyring to Levende arbeidsforhold #deploy-test-frontend Renamed folders and files under `Appstyring` to `Levendearbeidsforhold` to better reflect functionality changes. Adjusted import paths, updated the scheduler URL, and modified labels and navigation paths to ensure consistency with the new nomenclature. * Add log search by identity and organization #deploy-levende-arbeidsforhold-ansettelse Introduced methods in the LoggService and corresponding repository to fetch logs based on identity and organization number. Updated LoggController to provide endpoints for these searches, and adjusted timeout duration in AnsettelseService. * Rename navigation path #deploy-test-frontend Updated the admin navigation path from `/admin/appstyring` to `/admin/levendearbeidsforhold` for consistency. Adjusted the dropdown menu to reflect this change by modifying labels accordingly. * Add new applications to test config #deploy-test-frontend Included `testnav-levende-arbeidsforhold-ansettelse` and `testnav-levende-arbeidsforhold-scheduler` under the applications section. This ensures these new services are part of the test configuration setup. * **Change log levels and fix route path capitalization** Updated logger level from TRACE to INFO for consistent logging across multiple modules. Corrected the capitalization in the "/admin/levendearbeidsforhold" route path to ensure proper URL handling in the Dolly frontend. * **Remove AnsettelsesService and update JobbScheduler** #deploy-levende-arbeidsforhold-scheduler #deploy-levende_arbeidsforhold-ansettelse Removed AnsettelsesService and refactored JobbScheduler to use AnsettelseConsumer directly, simplifying the job scheduling process. This change includes enhancements for better async handling and transactional management in AnsettelseService. Additionally, security headers were updated, and new indexes were added for database optimization. * Deploy #deploy-levende-arbeidsforhold-scheduler * Update parameter value submission in EditParameter.tsx #deploy-test-frontend Previously, the parameter value was JSON stringified before being sent in the request body. This change removes the JSON.stringify, ensuring the value is sent as a plain string. * Delete unused PDL domain classes and GraphQL commands Removed multiple PDL domain classes and their related commands to clean up redundant code. This includes classes like `Bostedsadresse`, `Data`, `Feilmelding`, and several others that are no longer in use. Additionally, GraphQL commands and resources for fetching person data were also deleted. * Update tenorClient arguments to prevent default pagination #deploy-tenor-search-service Replaced fixed pagination values in tenorClient.getOrganisasjonTestdata with nulls to avoid unexpected default pagination behavior. This change ensures the full dataset is retrieved without arbitrary limitations. * Remove unused service classes and dependencies Deleted multiple service classes, utilities, and dependencies that were no longer needed in the codebase. This refactor simplifies the code and removes redundant components, enhancing maintainability. * Delete outdated domain classes Removed unused domain classes such as `Adresse`, `Organisasjon`, `Hendelse`, and related enums and interfaces. This clean-up helps streamline the codebase and eliminates obsolete code, improving maintainability. * Rettet feil etter merge * Improve logging in SannsynlighetVelger. Enhanced the log message to provide a more detailed breakdown of the stochastic distribution by age groups. Added a helper method to handle null values gracefully.
- Loading branch information