Skip to content
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

Bugfix/organisasjon bestilling #3606

Merged
merged 45 commits into from
Sep 16, 2024
Merged

Bugfix/organisasjon bestilling #3606

merged 45 commits into from
Sep 16, 2024

Conversation

krharum
Copy link
Contributor

@krharum krharum commented Sep 3, 2024

No description provided.

stigus and others added 30 commits August 29, 2024 13:25
…t om/lagt til validering

* Oppdatering og mindre refaktor
#deploy-test-frontend
…tus-service

Removed retry logic from GetBatchStatusCommand to simplify error handling. Modified StatusRepository and OrdreStatusService to eliminate Optional usage, ensuring robust handling of missing organization numbers. Cleaned up configuration by adjusting token settings in application YAML files.
Deleted JENKINS_SERVER_Q5 and JENKINS_SERVER_T3 configurations from application.yml as they are no longer in use. This cleanup simplifies the configuration file and reduces potential confusion over obsolete entries.
#deploy-organisasjon-bestilling-service

Configured OAuth2 resource server for token handling in production. Added H2 database initialization script and updated SQL initialization settings in the development profile. Adjusted security configurations to include necessary endpoints.
…pp-ereg-proxy

Introduced LocalVaultConfig and LocalSecurityConfig for local profiles. Added Vault configuration dependencies and updated application and production YAML files for proper OAuth2 and resource server setup. Tweaked character encoding and error message settings in the local environment configuration.
#deploy-modapp-ereg-proxy

Deleted LocalSecurityConfig.java and LocalVaultConfig.java files. Adjusted DevConfig to use correct VaultPropertySource and updated application.yml settings for better configuration management.
…-proxy

Removed the AzureAdApplication configuration and associated environment settings in config.yml. Introduced a new LoggingFilter to log incoming requests and their routes. Enhanced the application to include logging dependencies for better traceability.
#deploy-modapp-ereg-proxy

Replace hardcoded environment URL segment in 'application.yml' with a generic placeholder. Removing explicit mapping of environment to URL segment in 'ModappEregProxyApplicationStarter'.
#deploy-organisasjon-forvalter

Refactored `getStatus` to enhance status retrieval and error handling. Integrated missing organization checks with import service and introduced JSON error parsing for detailed error messages. Removed unused code in `MiljoerServiceConsumer`.
…isasjon-forvalter

Simplified `ImportService` logic by removing redundant methods and using reactive streams. Replaced `commands` library with `reactive-core` to enhance error handling and logging across services. Updated `GenererNavnServiceConsumer` and related classes to improve efficiency with non-blocking calls.
Introduce 'isFunnet' method to check if the juridiskEnhet is found. This includes defining a constant NOT_FOUND and utilizing @JsonIgnore for the method. This enhancement is crucial for distinguishing valid organizational entities.
#deploy-organisasjon-forvalter

Updated `OrganisasjonServiceConsumer` to correctly map organization numbers. Introduced `convertFeilmelding` in `OrdreStatusService` to streamline error processing and handle JSON parsing exceptions. Modified `OrganisasjonController` to specify JSON response type and adjusted data type for error in `OrdreResponse`.
#deploy-organisasjon-forvalter

Deleted CacheConfig.java and ClearCacheService.java to eliminate caching. Removed related imports and caching annotations in OrganisasjonController.java and OrdreResponse.java. This will simplify the codebase and remove unnecessary dependencies.
…jon-forvalte

Renamed variables for clarity and streamlined the conditional logic in the status update process. Improved readability and maintenance of the `OrdreStatusService` by using more descriptive names and ensuring the status list is updated only when necessary.
Added a Docker Compose file for setting up a Postgres container easily. Updated `local_db.md` with a corrected `docker run` command and adjusted database configuration in `application-local.yaml` to match the new setup.
Renamed and added new PostgreSQL services in compose.yaml for better isolation. Removed redundant filtering in OrdreStatusService, switched SecurityConfig profile from "dev" to "local", and adjusted database settings in application-local.yml.
#deploy-organisasjon-forvalter

Simplified the filtering logic in OrdreStatusService by merging similar conditions and reducing redundant checks. This improves readability and ensures that only relevant statuses are processed based on the updated criteria.
#deploy-modapp-ereg-proxy

Reduced response timeout in application.yml to 3 seconds. Updated `Timed` annotation tag to be more specific in `OrganisasjonConsumer`. Removed unused import in `ModappEregProxyApplicationStarter` and adjusted Docker command and datasource URL in configurations.
#deploy-organisasjon-forvalter

Removed convertFeilmelding method and replaced Object with String for error field in OrdreResponse. Additionally, streamlined order status checking logic in OrganisasjonBestillingService by removing unnecessary condition checks. These changes reduce code complexity and improve readability.
…-test-dolly-backend

Updated environment comparison in BestillingOrganisasjonStatusMapper to prevent null values. Enhanced OrganisasjonBestillingService to mark deployments as complete only if any error does not contain "404".
#deploy-dolly-backend

Added onErrorResume to handle exceptions gracefully and avoid blocking. Streamlined status processing by checking for null values and refining status detail mapping logic. These changes enhance code robustness and maintainability.
#deploy-organisasjon-bestilling-service

Introduce the PENDING_COMPLETE status to track orders awaiting completion. Removed logging in OrganisasjonBestillingConsumer and refactored OrderServiceV2 to return appropriate statuses. Commented out unused methods in EregBatchStatusConsumer to reduce redundancy.
#deploy-organisasjon-bestilling-service

Commented out the endpoints for item status retrieval in `OrderController` and their corresponding service methods in `OrderService`. This change removes unused or deprecated functionalities without deleting the code, allowing for potential reactivation in the future if needed.
…loy-organisasjon-forvalter

Added logging for fetching status and receiving response in OrganisasjonBestillingStatusCommand and OrganisasjonBestillingConsumer. This improves traceability and debugging capabilities by providing visibility into the flow of status requests and responses.
#deploy-organisasjon-bestilling-service

Commented out the endpoints for item status retrieval in `OrderController` and their corresponding service methods in `OrderService`. This change removes unused or deprecated functionalities without deleting the code, allowing for potential reactivation in the future if needed.
#deploy-organisasjon-bestilling-service

Deleted the EregBatchStatusConsumer class along with its command class and corresponding configurations in application.yml. Also removed unused methods and references in OrderService and Consumers classes. This cleanup helps streamline the service and eliminate unnecessary dependencies.
Deleted all source files, configurations, and dependencies associated with the ereg-batch-status-service and modapp-ereg-proxy projects. This includes build scripts, Dockerfiles, resource files, and test configurations, effectively decommissioning these services.
@krharum krharum marked this pull request as ready for review September 16, 2024 08:55
@krharum krharum requested a review from a team as a code owner September 16, 2024 08:55
Copy link
Contributor

@stigus stigus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ser flott ut 😄

// public ResponseEntity<List<ItemDTO>> getItems(@PathVariable("uuid") String uuid) {
// log.info("Henter status for uuid: {}.", uuid);
// var items = service.getStatusBy(uuid);
// if (items == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La dette ligge kommentert ut i tilfelle de får støtte igjen, eller bare fjerne?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er fjernet, takk!

#deploy-test-dolly-backend

Simplify the status validation logic by separating the status and environment checks. Ensure the environments match by comparing each status object's environment to the bestilling's environments.
#deploy-test-dolly-backend

Update environment matching in `OrganisasjonBestillingService` for clarity and efficiency. This change replaces nested stream operations with a more straightforward `map` and `contains` approach, improving code readability.
#deploy-test-dolly-backend

Removed unnecessary commented-out methods from OrderController class to improve readability. Optimized environment matching logic in OrganisasjonBestillingService using ArrayUtils from Apache Commons.
#deploy-test-dolly-backend

Previously, the filtering logic for environments was only applied after matching statuses. This change ensures that the environments are correctly filtered before status matching, preventing unnecessary status checks.
#deploy-jenkins-batch-status-service

Changed API endpoints from v1 to v2 in both UpdateOrganisasjonBestillingCommand and SaveOrganisasjonBestillingCommand. This ensures compatibility with the updated backend services.
#deploy-test-dolly-backend

Simplify logic by removing dependency on ArrayUtils and using Java Streams to match environments and status. This improves code readability and maintainability.
#deploy-test-dolly-backend

The previous logic incorrectly assumed orders with empty status lists were completed. This change ensures an order is only marked as completed if the status list is not empty and all statuses indicate completion.
@krharum krharum merged commit 8cc0806 into master Sep 16, 2024
232 checks passed
@krharum krharum deleted the bugfix/organisasjon-bestilling branch September 16, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants