-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MalBestilling functionality #3463
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Three new files have been created to handle a functionality termed MalBestilling. The new service class `MalBestillingService` is responsible for creating a new instance of `BestillingMal`. Also, a new controller class `MalBestillingController` is provided to expose this service over HTTP. The file `DollyRequest2MalBestillingMappingStrategy` implements mapping strategies for data conversion.
The 'MalBestillingService' has been shaped up to execute and accumulate certain changes. Part of these adjustments includes replacing null as a returned object to a new class object 'RsBestillingMal'. Additionally, a new class 'RsBestillingMal' has been created to replace 'BestillingMal' with more parameters. These changes are introduced across several related files. These modifications lead to a more structured and rich response from 'MalBestillingService'.
The check for an existing name in MalBestillingService has been removed. This change simplifies code and prevents throwing a 'bad request' response, improving the response structure from 'MalBestillingService'. Now, 'BestillingMal' is saved directly without checking for duplicate names.
A significant refactor on BestillingMalService has been conducted by moving the logic within MalBestillingService to BestillingMalService. As a result, MalBestillingService is not needed anymore and it was removed. Alongside, the related classes and tests were updated according to the new structure.
Renamed BestillingMalService to MalBestillingService across the application. Changes were applied to all its related files, tests, and import statements. All relevant methods updated to call the newly renamed service.
Updated handling of Bestilling by streamlining the mapping process and handling potential exceptions for failing conversions. Removed usage of JsonBestillingMapper and utilized ObjectMapper instead. Renamed BestillingMal to MalBestilling to better reflect its function.
The code has been restructured to handle Bestilling objects more efficiently. The mapping process has been streamlined with the use of ObjectMapper, leading to more effective handling of potentially failing conversions. Additionally, the object BestillingMal has been renamed to MalBestilling to better represent its functionality. The unneeded method getMalbestillingByUserAndNavn has been removed.
…t-dolly-backend The variable 'bestKriterier' was renamed to 'bestilling' in several Java and TypeScript files to improve code clarity. Additionally, the backend API path was updated in useMaler.tsx and Minside.cy.ts, as well as some logging added to MalPanel.tsx for testing. New fields were added to DollyRequest2MalBestillingMappingStrategy.java for greater functionality.
Deleted the unwanted console.log in MalPanel.tsx and refactored the mapping of 'maler' to use 'bestilling' instead of 'bestKriterier'. In DollyEndpoints.tsx, modified URLs to a different endpoint and added a new method 'opprettMalFraPerson'. Further, in PersonVisning.tsx, imported and implemented 'OpprettMalFraPerson' and made a minor refactor. Lastly, in DollyService.tsx, the method 'opprettMalFraPerson' was implemented.
#deploy-test-dolly-backend Exception handling has been improved in BestillingStatusMappingStrategy.java, specifically for the 'bestilling' variable. Previously, an error would occur when attempting to read 'BestKriterier' if null or empty; this is now properly handled to default to an empty JSON, preventing an INTERNAL_SERVER_ERROR response.
#deploy-test-dolly-backend This commit removes the use of the JsonInclude annotation in RsBestillingStatus.java. The absence of this annotation ensures all properties of the class, whether empty or not, will be included in the JSON serialization process.
#deploy-test-dolly-backend Added getter methods for occupationTypes, workLoadTypes, and workScheduleTypes in ArbeidsplassenCVDTO. These methods ensure that the corresponding lists are initialized when they are null. Also, the BestillingMapper class has been moved from 'strategy' subdirectory to 'mapper' directory for better organization.
#deploy-test-dolly-backend The RsDollyBestillingRequest type has been replaced with the new RsDollyUtvidetBestilling type in the MalBestillingService and DollyRequest2MalBestillingMappingStrategy classes. This updates how the Bestilling requests are constructed and mapped, allowing extended Bestilling data to be handled correctly.
#deploy-test-dolly-backend Removed unnecessary imports and refactored the createFromIdent method in MalBestillingService to improve readability. Added helper functions for JSON operations. In DollyRequest2MalBestillingMappingStrategy, adjusted the class mapping to use RsDollyUtvidetBestilling instead of RsDollyBestillingRequest for better consistency.
#deploy-test-frontend The commit adds a switch case to the MalModal.tsx file to determine a 'topic' based on the 'malType'. It changes modal title to include the selected topic when creating a new template. Also, buttons with the text "OPPRETT NY MAL" have been updated to just say "OPPRETT MAL" in the PersonVisning.tsx and BestillingDetaljer.tsx files.
stigus
approved these changes
Apr 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ser flott ut, blir kult å få dette på plass 🤩
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Three new files have been created to handle a functionality termed MalBestilling. The new service class
MalBestillingService
is responsible for creating a new instance ofBestillingMal
. Also, a new controller classMalBestillingController
is provided to expose this service over HTTP. The fileDollyRequest2MalBestillingMappingStrategy
implements mapping strategies for data conversion.