diff --git a/DEPENDENCIES_BACKEND b/DEPENDENCIES_BACKEND index 5aa523f4..41f08614 100644 --- a/DEPENDENCIES_BACKEND +++ b/DEPENDENCIES_BACKEND @@ -65,7 +65,7 @@ maven/mavencentral/org.antlr/antlr4-runtime/4.13.0, BSD-3-Clause, approved, #107 maven/mavencentral/org.apache.commons/commons-lang3/3.14.0, Apache-2.0, approved, #11677 maven/mavencentral/org.apache.logging.log4j/log4j-api/2.21.1, Apache-2.0 AND (Apache-2.0 AND LGPL-2.0-or-later), approved, #11079 maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.21.1, Apache-2.0, approved, #15262 -maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.20, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949 +maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.20, Apache-2.0 AND (EPL-2.0 OR (GPL-2.0 WITH Classpath-exception-2.0)) AND CDDL-1.0 AND (CDDL-1.1 OR (GPL-2.0-only WITH Classpath-exception-2.0)) AND EPL-2.0, approved, #15195 maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.20, Apache-2.0, approved, #6997 maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.20, Apache-2.0, approved, #7920 maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved, clearlydefined @@ -99,7 +99,7 @@ maven/mavencentral/org.objenesis/objenesis/3.3, Apache-2.0, approved, clearlydef maven/mavencentral/org.openapitools/jackson-databind-nullable/0.2.0, Apache-2.0, approved, #3294 maven/mavencentral/org.opentest4j/opentest4j/1.3.0, Apache-2.0, approved, #9713 maven/mavencentral/org.ow2.asm/asm/9.6, BSD-3-Clause, approved, #10776 -maven/mavencentral/org.postgresql/postgresql/42.6.2, BSD-2-Clause AND Apache-2.0, approved, #9159 +maven/mavencentral/org.postgresql/postgresql/42.6.2, BSD-2-Clause AND Apache-2.0, approved, #15238 maven/mavencentral/org.projectlombok/lombok/1.18.32, MIT, approved, #15192 maven/mavencentral/org.reactivestreams/reactive-streams/1.0.4, CC0-1.0, approved, CQ16332 maven/mavencentral/org.skyscreamer/jsonassert/1.5.1, Apache-2.0, approved, clearlydefined diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/DemandCapacityMgmtBackendApplication.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/DemandCapacityMgmtBackendApplication.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/DemandCapacityMgmtBackendApplication.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/DemandCapacityMgmtBackendApplication.java index 3c82a060..3711f868 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/DemandCapacityMgmtBackendApplication.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/DemandCapacityMgmtBackendApplication.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend; +package org.eclipse.tractusx.demandcapacitymgm.backend; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/appinfo/InfoConfiguration.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/appinfo/InfoConfiguration.java similarity index 93% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/appinfo/InfoConfiguration.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/appinfo/InfoConfiguration.java index 40e7c7bd..b94211fb 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/appinfo/InfoConfiguration.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/appinfo/InfoConfiguration.java @@ -19,7 +19,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.appinfo; +package org.eclipse.tractusx.demandcapacitymgm.backend.appinfo; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/config/GlobalExceptionHandler.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/config/GlobalExceptionHandler.java similarity index 96% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/config/GlobalExceptionHandler.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/config/GlobalExceptionHandler.java index d32abb43..46693817 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/config/GlobalExceptionHandler.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/config/GlobalExceptionHandler.java @@ -19,7 +19,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.config; +package org.eclipse.tractusx.demandcapacitymgm.backend.config; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.exception.ExceptionUtils; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/config/openapi/OpenApiConfig.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/config/openapi/OpenApiConfig.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/config/openapi/OpenApiConfig.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/config/openapi/OpenApiConfig.java index 78ac19e4..aedc8e4a 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/config/openapi/OpenApiConfig.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/config/openapi/OpenApiConfig.java @@ -19,7 +19,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.config.openapi; +package org.eclipse.tractusx.demandcapacitymgm.backend.config.openapi; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; @@ -28,14 +28,15 @@ import io.swagger.v3.oas.models.security.OAuthFlows; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; -import java.util.Collections; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.appinfo.InfoConfiguration; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.security.AppSecurityConfigProperties; +import org.eclipse.tractusx.demandcapacitymgm.backend.appinfo.InfoConfiguration; +import org.eclipse.tractusx.demandcapacitymgm.backend.security.AppSecurityConfigProperties; import org.springdoc.core.models.GroupedOpenApi; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import java.util.Collections; + @Configuration @AllArgsConstructor public class OpenApiConfig { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AddressBookController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AddressBookController.java similarity index 75% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AddressBookController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AddressBookController.java index f0500d7d..2e6b3808 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AddressBookController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AddressBookController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,23 +20,22 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.AddressBookApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusesResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.AddressBookApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookResponse; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.AddressBookService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.AddressBookService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class AddressBookController implements AddressBookApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AdminRulesetController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AdminRulesetController.java similarity index 80% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AdminRulesetController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AdminRulesetController.java index 3056c8b6..32a93b52 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AdminRulesetController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AdminRulesetController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,22 +20,23 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.RulesApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddRuleRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.RuleRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.RuleResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.RulesApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddRuleRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.RuleRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.RuleResponse; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Objects; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.RulesetService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.RulesetService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; +import java.util.Objects; + @RestController @AllArgsConstructor public class AdminRulesetController implements RulesApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AlertController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AlertController.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AlertController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AlertController.java index ad9c8cbe..8dfbdb0b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/AlertController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/AlertController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,19 +19,23 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.AlertsApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; +import eclipse.tractusx.demandcapacitymgm.specification.api.AlertsApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.AlertRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.AlertResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.TriggeredAlertRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.TriggeredAlertResponse; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.AlertService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.AlertService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor //@RequestMapping("/alerts") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CapacityGroupRuleSetController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CapacityGroupRuleSetController.java similarity index 76% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CapacityGroupRuleSetController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CapacityGroupRuleSetController.java index 0350018e..ebb27211 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CapacityGroupRuleSetController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CapacityGroupRuleSetController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.CgRulesetApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CGRulesetRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CGRulesetResponse; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.api.CgRulesetApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.CGRulesetRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.CGRulesetResponse; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CapacityGroupRuleSetService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CapacityGroupRuleSetService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CapacityGroupsController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CapacityGroupsController.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CapacityGroupsController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CapacityGroupsController.java index 867e881d..dc426078 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CapacityGroupsController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CapacityGroupsController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.CapacityGroupApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; +import eclipse.tractusx.demandcapacitymgm.specification.api.CapacityGroupApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CapacityGroupService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CapacityGroupService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class CapacityGroupsController implements CapacityGroupApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CompanyController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CompanyController.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CompanyController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CompanyController.java index 8b7191aa..00db9fd5 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CompanyController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CompanyController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,19 +20,18 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.CompanyApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CompanyDto; -import java.util.List; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.api.CompanyApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.CompanyDto; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CompanyService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CompanyService; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class CompanyController implements CompanyApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CompanyRuleSetController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CompanyRuleSetController.java similarity index 76% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CompanyRuleSetController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CompanyRuleSetController.java index 374be984..6cacd627 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/CompanyRuleSetController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/CompanyRuleSetController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.CdRulesetApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CDRulesetRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CDRulesetResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.CdRulesetApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.CDRulesetRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.CDRulesetResponse; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CompanyRuleSetService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CompanyRuleSetService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/DemandCategoryController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/DemandCategoryController.java similarity index 78% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/DemandCategoryController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/DemandCategoryController.java index b7ee6dfa..80351832 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/DemandCategoryController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/DemandCategoryController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,17 +20,18 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.DemandCategoryApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.DemandCategoryResponse; -import java.util.List; +import eclipse.tractusx.demandcapacitymgm.specification.api.DemandCategoryApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.DemandCategoryResponse; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.DemandCategoryService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.DemandCategoryService; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class DemandCategoryController implements DemandCategoryApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/DemandController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/DemandController.java similarity index 89% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/DemandController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/DemandController.java index b76c3867..20da48b2 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/DemandController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/DemandController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,19 +20,20 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.DemandApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; +import eclipse.tractusx.demandcapacitymgm.specification.api.DemandApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.DemandService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.DemandService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class DemandController implements DemandApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/EDCController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/EDCController.java similarity index 90% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/EDCController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/EDCController.java index f91c45f2..4fc568a6 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/EDCController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/EDCController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,16 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.EdcApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; -import java.util.List; +import eclipse.tractusx.demandcapacitymgm.specification.api.EdcApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.EDCService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.EDCService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import reactor.core.publisher.Flux; + +import java.util.List; @RestController @AllArgsConstructor diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/FavoriteController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/FavoriteController.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/FavoriteController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/FavoriteController.java index 4130993c..5d03c339 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/FavoriteController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/FavoriteController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,16 +20,16 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.FavoriteApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.FavoriteRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.FavoriteResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.FavoriteApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.FavoriteRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.FavoriteResponse; import jakarta.servlet.http.HttpServletRequest; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.FavoriteService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.FavoriteType; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.FavoriteService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/LoggingHistoryController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/LoggingHistoryController.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/LoggingHistoryController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/LoggingHistoryController.java index 992d1408..8d5bbad9 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/LoggingHistoryController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/LoggingHistoryController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,21 +20,22 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.LoggingHistoryApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.ArchivedLoggingHistoryResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.LoggingHistoryRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.LoggingHistoryResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.LoggingHistoryApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.ArchivedLoggingHistoryResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.LoggingHistoryRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.LoggingHistoryResponse; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LoggingHistoryService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LoggingHistoryService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class LoggingHistoryController implements LoggingHistoryApi { @@ -86,9 +87,9 @@ public ResponseEntity> filterLogs( String materialDemandId, String capacityGroupId ) throws Exception { - return ResponseEntity - .status(HttpStatus.OK) - .body(loggingHistoryService.filterLog(capacityGroupId, materialDemandId, event, startTime, endTime)); + return ResponseEntity.status(HttpStatus.OK).body( + loggingHistoryService.filterLog(capacityGroupId, materialDemandId, event, startTime, endTime) + ); } @Override diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/SecurityTokenController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/SecurityTokenController.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/SecurityTokenController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/SecurityTokenController.java index 4a3d70e5..0f079c14 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/SecurityTokenController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/SecurityTokenController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,13 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.KeycloakApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.IntrospectTokenResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.User; +import eclipse.tractusx.demandcapacitymgm.specification.api.KeycloakApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.IntrospectTokenResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.User; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.SecurityTokenService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.SecurityTokenService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/StatusesController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/StatusesController.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/StatusesController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/StatusesController.java index 7aad5bbe..6c0d3158 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/StatusesController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/StatusesController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,15 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.StatusesApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusesResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.StatusesApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.StatusRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.StatusesResponse; import jakarta.servlet.http.HttpServletRequest; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.StatusesService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.StatusesService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/UnitMeasureController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/UnitMeasureController.java similarity index 80% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/UnitMeasureController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/UnitMeasureController.java index 7f622d3e..d8e3fa89 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/UnitMeasureController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/UnitMeasureController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.UnitMeasureApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UnitMeasure; -import java.util.List; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.api.UnitMeasureApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.UnitMeasure; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.UnityOfMeasureService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.UnityOfMeasureService; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; +import java.util.UUID; + @RestController @AllArgsConstructor public class UnitMeasureController implements UnitMeasureApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/UserController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/UserController.java similarity index 74% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/UserController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/UserController.java index d7736f87..611969e1 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/UserController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/UserController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,19 +19,19 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.UserOperationsApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UserRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UserResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.UserOperationsApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.UserRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.UserResponse; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.UserOperationsService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.UserOperationsService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class UserController implements UserOperationsApi { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/WeekBasedCapacityGroupController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/WeekBasedCapacityGroupController.java similarity index 76% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/WeekBasedCapacityGroupController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/WeekBasedCapacityGroupController.java index 0e5afead..40f84cf3 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/WeekBasedCapacityGroupController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/WeekBasedCapacityGroupController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.WeekBasedCapacityGroupApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupDtoRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupDtoResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.WeekBasedCapacityGroupApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupDtoRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupDtoResponse; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedCapacityGroupService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedCapacityGroupService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class WeekBasedCapacityGroupController implements WeekBasedCapacityGroupApi { @@ -43,7 +44,8 @@ public class WeekBasedCapacityGroupController implements WeekBasedCapacityGroupA @Override public ResponseEntity> getWeekBasedCapacityGroup() { - List capacityGroupDefaultViewResponseList = weekBasedCapacityGroupService.getWeekBasedCapacityGroups(); + List capacityGroupDefaultViewResponseList = + weekBasedCapacityGroupService.getWeekBasedCapacityGroups(); return ResponseEntity.status(HttpStatus.OK).body(capacityGroupDefaultViewResponseList); } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/WeekBasedMaterialController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/WeekBasedMaterialController.java similarity index 76% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/WeekBasedMaterialController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/WeekBasedMaterialController.java index 1e5bc9e4..2018a539 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/WeekBasedMaterialController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/WeekBasedMaterialController.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.WeekBasedMaterialDemandApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandRequestDto; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandResponseDto; +import eclipse.tractusx.demandcapacitymgm.specification.api.WeekBasedMaterialDemandApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandRequestDto; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandResponseDto; import jakarta.servlet.http.HttpServletRequest; -import java.util.List; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedMaterialService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedMaterialService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @AllArgsConstructor public class WeekBasedMaterialController implements WeekBasedMaterialDemandApi { @@ -43,7 +44,8 @@ public class WeekBasedMaterialController implements WeekBasedMaterialDemandApi { @Override public ResponseEntity> getWeekBasedMaterialDemand() { - List capacityGroupDefaultViewResponseList = weekBasedMaterialService.getWeekBasedMaterialDemands(); + List capacityGroupDefaultViewResponseList = + weekBasedMaterialService.getWeekBasedMaterialDemands(); return ResponseEntity.status(HttpStatus.OK).body(capacityGroupDefaultViewResponseList); } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/YearReportController.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/YearReportController.java similarity index 56% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/YearReportController.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/YearReportController.java index 5539f140..e11a405b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/YearReportController.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/controllers/YearReportController.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,15 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; +package org.eclipse.tractusx.demandcapacitymgm.backend.controllers; -import eclipse.tractusx.demand_capacity_mgmt_specification.api.YearReportApi; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.YearReportRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.YearReportResponse; +import eclipse.tractusx.demandcapacitymgm.specification.api.YearReportApi; +import eclipse.tractusx.demandcapacitymgm.specification.model.YearReportRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.YearReportResponse; import jakarta.servlet.http.HttpServletRequest; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl.BottleneckManagerImpl; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.impl.BottleneckManagerImpl; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; @@ -42,17 +42,15 @@ public class YearReportController implements YearReportApi { @Override public ResponseEntity generateYearReport(YearReportRequest yearReportRequest) throws Exception { - return ResponseEntity - .status(200) - .body( - bottleneckManager.generateYearReport( - UserUtil.getUserID(request), - yearReportRequest.getCgID(), - yearReportRequest.getStartDate(), - yearReportRequest.getEndDate(), - yearReportRequest.getRuled(), - yearReportRequest.getPercentage() - ) - ); + return ResponseEntity.status(200).body( + bottleneckManager.generateYearReport( + UserUtil.getUserID(request), + yearReportRequest.getCgID(), + yearReportRequest.getStartDate(), + yearReportRequest.getEndDate(), + yearReportRequest.getRuled(), + yearReportRequest.getPercentage() + ) + ); } } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/AddressBookRecordEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/AddressBookRecordEntity.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/AddressBookRecordEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/AddressBookRecordEntity.java index b6c07517..e207c6b1 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/AddressBookRecordEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/AddressBookRecordEntity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "address_book") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/AlertEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/AlertEntity.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/AlertEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/AlertEntity.java index 912143a3..3e3c58c6 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/AlertEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/AlertEntity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,14 +19,15 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; +import lombok.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.AlertThresholdType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.AlertsMonitoredObjects; + import java.util.List; import java.util.UUID; -import lombok.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.AlertThresholdType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.AlertsMonitoredObjects; @Entity @Table(name = "alerts") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/ArchivedLogEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/ArchivedLogEntity.java similarity index 85% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/ArchivedLogEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/ArchivedLogEntity.java index 1df4206d..df4183b9 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/ArchivedLogEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/ArchivedLogEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.annotation.Nullable; import jakarta.persistence.*; -import java.sql.Timestamp; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; + +import java.sql.Timestamp; +import java.util.UUID; @Entity @Table(name = "archived_log") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityGroupEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityGroupEntity.java similarity index 90% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityGroupEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityGroupEntity.java index 3302ffbd..565704f8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityGroupEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityGroupEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,15 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; +import lombok.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; + import java.time.LocalDate; import java.util.List; import java.util.UUID; -import lombok.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; @Entity @Table(name = "capacity_group") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityGroupRuleSetEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityGroupRuleSetEntity.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityGroupRuleSetEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityGroupRuleSetEntity.java index f8b11caa..7670201f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityGroupRuleSetEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityGroupRuleSetEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; -import jakarta.persistence.*; -import java.util.UUID; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "capacity_group_ruleset") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityTimeSeries.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityTimeSeries.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityTimeSeries.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityTimeSeries.java index 3cef4e99..ef2942fe 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CapacityTimeSeries.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CapacityTimeSeries.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.*; +import java.util.UUID; + @Entity @Table(name = "capacity_time_series") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CompanyEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CompanyEntity.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CompanyEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CompanyEntity.java index f4057937..b1cc8b45 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CompanyEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CompanyEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "company_base_data") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CompanyRuleSetEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CompanyRuleSetEntity.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CompanyRuleSetEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CompanyRuleSetEntity.java index e7c9fd2c..2715f43b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CompanyRuleSetEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/CompanyRuleSetEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "company_ruleset") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DedicatedAlertEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DedicatedAlertEntity.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DedicatedAlertEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DedicatedAlertEntity.java index f4e46404..328dcb35 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DedicatedAlertEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DedicatedAlertEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; + import java.util.UUID; -import lombok.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; @Entity @Table(name = "dedicated_alerts") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandCategoryEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandCategoryEntity.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandCategoryEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandCategoryEntity.java index e981d9a4..57968595 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandCategoryEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandCategoryEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "demand_category") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandSeries.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandSeries.java similarity index 89% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandSeries.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandSeries.java index 39eba708..4bf9015f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandSeries.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandSeries.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import jakarta.persistence.*; +import lombok.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters.ListToStringConverter; + import java.util.List; import java.util.UUID; -import lombok.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters.ListToStringConverter; @Entity @Table(name = "demand_series") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandSeriesValues.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandSeriesValues.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandSeriesValues.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandSeriesValues.java index c69e3238..1151e943 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandSeriesValues.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/DemandSeriesValues.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; +import lombok.*; + import java.time.LocalDate; import java.util.UUID; -import lombok.*; @Entity @Table(name = "demand_series_values") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/FavoriteEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/FavoriteEntity.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/FavoriteEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/FavoriteEntity.java index 9ff16b42..a8a1d1b5 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/FavoriteEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/FavoriteEntity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,16 +20,17 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.sql.Timestamp; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.FavoriteType; + +import java.sql.Timestamp; +import java.util.UUID; @Entity @Table(name = "favorites") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LinkDemandEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LinkDemandEntity.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LinkDemandEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LinkDemandEntity.java index b83e06c6..2f763765 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LinkDemandEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LinkDemandEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "link_demand") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LinkedCapacityGroupMaterialDemandEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LinkedCapacityGroupMaterialDemandEntity.java similarity index 93% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LinkedCapacityGroupMaterialDemandEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LinkedCapacityGroupMaterialDemandEntity.java index 395754c6..cea2834c 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LinkedCapacityGroupMaterialDemandEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LinkedCapacityGroupMaterialDemandEntity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "link_capacitygroup_demandseries") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LoggingHistoryEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LoggingHistoryEntity.java similarity index 85% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LoggingHistoryEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LoggingHistoryEntity.java index 6525299f..ad6614fc 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/LoggingHistoryEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/LoggingHistoryEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.annotation.Nullable; import jakarta.persistence.*; -import java.sql.Timestamp; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; + +import java.sql.Timestamp; +import java.util.UUID; @Entity @Table(name = "logging_history") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/MaterialDemandEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/MaterialDemandEntity.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/MaterialDemandEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/MaterialDemandEntity.java index 5b99c006..80a81ae3 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/MaterialDemandEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/MaterialDemandEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,17 +20,18 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import jakarta.persistence.*; +import lombok.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.MaterialDemandStatus; + import java.time.LocalDateTime; import java.util.List; import java.util.UUID; -import lombok.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.MaterialDemandStatus; @Entity @Cacheable(false) diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/Rule.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/Rule.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/Rule.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/Rule.java index 69367da4..6ad6efbf 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/Rule.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/Rule.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/StatusesEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/StatusesEntity.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/StatusesEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/StatusesEntity.java index 8b35d54a..82c64fd8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/StatusesEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/StatusesEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "statuses") @Builder diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/TriggeredAlertEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/TriggeredAlertEntity.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/TriggeredAlertEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/TriggeredAlertEntity.java index a00986b3..69d7d9a8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/TriggeredAlertEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/TriggeredAlertEntity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,16 +19,17 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.AlertThresholdType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.AlertsMonitoredObjects; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.AlertThresholdType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.AlertsMonitoredObjects; + +import java.util.UUID; @Entity @Table(name = "triggered_alerts") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/UnitMeasureEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/UnitMeasureEntity.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/UnitMeasureEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/UnitMeasureEntity.java index 83d844f1..68f82d38 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/UnitMeasureEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/UnitMeasureEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.UUID; + @Entity @Table(name = "unit_of_measure") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/UserEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/UserEntity.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/UserEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/UserEntity.java index f99547ff..3d28c803 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/UserEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/UserEntity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; + +import java.util.UUID; @Entity @Table(name = "dcm_users") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/WeekBasedCapacityGroupEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/WeekBasedCapacityGroupEntity.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/WeekBasedCapacityGroupEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/WeekBasedCapacityGroupEntity.java index 620c4141..ff6b1c1f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/WeekBasedCapacityGroupEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/WeekBasedCapacityGroupEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupRequest; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters.WeekBasedCapacityGroupConverter; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters.WeekBasedCapacityGroupConverter; import org.hibernate.annotations.ColumnTransformer; +import java.util.UUID; + @Entity @Table(name = "week_based_capacity") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/WeekBasedMaterialDemandEntity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/WeekBasedMaterialDemandEntity.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/WeekBasedMaterialDemandEntity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/WeekBasedMaterialDemandEntity.java index e92ce0d8..e6d9ee9b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/WeekBasedMaterialDemandEntity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/WeekBasedMaterialDemandEntity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandRequest; import jakarta.persistence.*; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters.WeekBasedMaterialConverter; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters.WeekBasedMaterialConverter; import org.hibernate.annotations.ColumnTransformer; +import java.util.UUID; + @Entity @Table(name = "week_based_material_demand") @Data diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/CategoryDeltaDto.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/CategoryDeltaDto.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/CategoryDeltaDto.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/CategoryDeltaDto.java index e7f505a2..4c6c8cd2 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/CategoryDeltaDto.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/CategoryDeltaDto.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/MonthReportDto.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/MonthReportDto.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/MonthReportDto.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/MonthReportDto.java index 008579cb..b5d6dffa 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/MonthReportDto.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/MonthReportDto.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,15 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks; -import jakarta.persistence.*; -import java.util.List; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.List; + @Data @Builder @NoArgsConstructor diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/WeekReportDto.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/WeekReportDto.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/WeekReportDto.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/WeekReportDto.java index c1d5afe2..3556fdd3 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/WeekReportDto.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/WeekReportDto.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,15 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks; -import java.util.List; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.DemandSeries; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.DemandSeries; + +import java.util.List; @Data @Builder diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/YearReportDto.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/YearReportDto.java similarity index 89% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/YearReportDto.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/YearReportDto.java index fb3b326e..b82d39d4 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/bottlenecks/YearReportDto.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/bottlenecks/YearReportDto.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,15 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks; -import java.util.List; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.List; + @Data @Builder @NoArgsConstructor diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/ListToStringConverter.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/ListToStringConverter.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/ListToStringConverter.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/ListToStringConverter.java index a8f8bbd7..ebe22e0e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/ListToStringConverter.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/ListToStringConverter.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,11 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters; + +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; -import jakarta.persistence.*; import java.util.List; import java.util.Optional; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/MaterialDemandConverter.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/MaterialDemandConverter.java similarity index 75% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/MaterialDemandConverter.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/MaterialDemandConverter.java index 93c3c130..348393c8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/MaterialDemandConverter.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/MaterialDemandConverter.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.MaterialDemandResponse; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity; +import eclipse.tractusx.demandcapacitymgm.specification.model.MaterialDemandResponse; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.MaterialDemandEntity; public class MaterialDemandConverter { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/WeekBasedCapacityGroupConverter.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/WeekBasedCapacityGroupConverter.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/WeekBasedCapacityGroupConverter.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/WeekBasedCapacityGroupConverter.java index af32d488..88154b77 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/WeekBasedCapacityGroupConverter.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/WeekBasedCapacityGroupConverter.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,12 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters; import com.google.gson.Gson; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupRequest; -import jakarta.persistence.*; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupRequest; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; @Converter(autoApply = true) public class WeekBasedCapacityGroupConverter implements AttributeConverter { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/WeekBasedMaterialConverter.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/WeekBasedMaterialConverter.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/WeekBasedMaterialConverter.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/WeekBasedMaterialConverter.java index b4081542..9b2e08dd 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/converters/WeekBasedMaterialConverter.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/converters/WeekBasedMaterialConverter.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,12 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.converters; import com.google.gson.Gson; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandRequestDto; -import jakarta.persistence.*; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandRequest; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; @Converter(autoApply = true) public class WeekBasedMaterialConverter implements AttributeConverter { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/AlertThresholdType.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/AlertThresholdType.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/AlertThresholdType.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/AlertThresholdType.java index b9234f5c..09a7a542 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/AlertThresholdType.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/AlertThresholdType.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum AlertThresholdType { ABSOLUTE, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/AlertsMonitoredObjects.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/AlertsMonitoredObjects.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/AlertsMonitoredObjects.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/AlertsMonitoredObjects.java index 4f130caa..7126d026 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/AlertsMonitoredObjects.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/AlertsMonitoredObjects.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum AlertsMonitoredObjects { ALL_DEMANDS, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CapacityDeviation.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CapacityDeviation.java similarity index 89% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CapacityDeviation.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CapacityDeviation.java index ed9af709..d455254e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CapacityDeviation.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CapacityDeviation.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum CapacityDeviation { BOTTLENECK(StatusColor.RED), diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CapacityGroupStatus.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CapacityGroupStatus.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CapacityGroupStatus.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CapacityGroupStatus.java index 6a35536c..c3b5fa27 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CapacityGroupStatus.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CapacityGroupStatus.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum CapacityGroupStatus { DRAFT, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CompanyType.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CompanyType.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CompanyType.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CompanyType.java index ca07e688..1ce0cdc3 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/CompanyType.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/CompanyType.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum CompanyType { SUPPLIER, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventObjectType.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventObjectType.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventObjectType.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventObjectType.java index c756b52f..940bc770 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventObjectType.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventObjectType.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum EventObjectType { MATERIAL_DEMAND, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventStatus.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventStatus.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventStatus.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventStatus.java index 92ce5234..8557202d 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventStatus.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventStatus.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum EventStatus { FAIL, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventType.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventType.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventType.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventType.java index 219942fe..30c10ec5 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/EventType.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/EventType.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum EventType { GENERAL_EVENT, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/FavoriteType.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/FavoriteType.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/FavoriteType.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/FavoriteType.java index bb88f502..ef8b560d 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/FavoriteType.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/FavoriteType.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum FavoriteType { CAPACITY_GROUP, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/MaterialDemandStatus.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/MaterialDemandStatus.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/MaterialDemandStatus.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/MaterialDemandStatus.java index a1f60982..508cddd0 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/MaterialDemandStatus.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/MaterialDemandStatus.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum MaterialDemandStatus { DRAFT, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/Role.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/Role.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/Role.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/Role.java index 3a6d7ff5..eab10e44 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/Role.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/Role.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum Role { CUSTOMER, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/StatusColor.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/StatusColor.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/StatusColor.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/StatusColor.java index 7f91333a..330f99e3 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/StatusColor.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/StatusColor.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum StatusColor { RED, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/UserSpecificEventStatus.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/UserSpecificEventStatus.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/UserSpecificEventStatus.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/UserSpecificEventStatus.java index 89dffd67..c070f260 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/enums/UserSpecificEventStatus.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/enums/UserSpecificEventStatus.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums; public enum UserSpecificEventStatus { OPENED, diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/Capacity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/Capacity.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/Capacity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/Capacity.java index ebf6da96..aa80d1ba 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/Capacity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/Capacity.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; import lombok.Builder; import lombok.Data; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/DemandCategory.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/DemandCategory.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/DemandCategory.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/DemandCategory.java index 51e28f78..022adce4 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/DemandCategory.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/DemandCategory.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; import lombok.Builder; import lombok.Data; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/LikedDemandSeries.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/LikedDemandSeries.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/LikedDemandSeries.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/LikedDemandSeries.java index 59876b45..3f1a5a0c 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/LikedDemandSeries.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/LikedDemandSeries.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; import lombok.Builder; import lombok.Data; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/User.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/User.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/User.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/User.java index 379879d4..dd3df62a 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/User.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/User.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,11 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; import lombok.Builder; import lombok.Data; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; @Data @Builder diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekBasedCapacityGroup.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekBasedCapacityGroup.java similarity index 89% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekBasedCapacityGroup.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekBasedCapacityGroup.java index 70abb644..cad8e7eb 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekBasedCapacityGroup.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekBasedCapacityGroup.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; -import java.util.List; import lombok.Builder; import lombok.Data; +import java.util.List; + @Data @Builder public class WeekBasedCapacityGroup { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekBasedMaterialDemand.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekBasedMaterialDemand.java similarity index 89% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekBasedMaterialDemand.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekBasedMaterialDemand.java index 4a314919..3c60e7d1 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekBasedMaterialDemand.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekBasedMaterialDemand.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; -import java.util.List; import lombok.Builder; import lombok.Data; +import java.util.List; + @Data @Builder public class WeekBasedMaterialDemand { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekDemandSeries.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekDemandSeries.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekDemandSeries.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekDemandSeries.java index 984072f4..dccdda89 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekDemandSeries.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekDemandSeries.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; -import java.util.List; import lombok.Builder; import lombok.Data; +import java.util.List; + @Data @Builder public class WeekDemandSeries { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekDemandSeriesValues.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekDemandSeriesValues.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekDemandSeriesValues.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekDemandSeriesValues.java index 491bbf33..31c15e81 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/json/entities/WeekDemandSeriesValues.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/entities/json/entities/WeekDemandSeriesValues.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.json.entities; +package org.eclipse.tractusx.demandcapacitymgm.backend.entities.json.entities; -import java.time.LocalDateTime; import lombok.Builder; import lombok.Data; +import java.time.LocalDateTime; + @Data @Builder public class WeekDemandSeriesValues { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/CustomException.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/CustomException.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/CustomException.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/CustomException.java index b7baf43a..0c987e44 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/CustomException.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/CustomException.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base; public interface CustomException { String getCode(); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/ExceptionResponse.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/ExceptionResponse.java similarity index 85% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/ExceptionResponse.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/ExceptionResponse.java index efb71e26..2ed50441 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/ExceptionResponse.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/ExceptionResponse.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,6 +20,6 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base; public interface ExceptionResponse {} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/ExceptionResponseImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/ExceptionResponseImpl.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/ExceptionResponseImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/ExceptionResponseImpl.java index 711e2a24..d2092702 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/base/ExceptionResponseImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/base/ExceptionResponseImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base; public record ExceptionResponseImpl(String code, String lastDigits) implements ExceptionResponse { } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/handler/RestExceptionHandler.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/handler/RestExceptionHandler.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/handler/RestExceptionHandler.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/handler/RestExceptionHandler.java index e50a91cb..99fdb2f6 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/handler/RestExceptionHandler.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/handler/RestExceptionHandler.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,12 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.handler; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.handler; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base.ExceptionResponseImpl; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.BadRequestException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.InternalServerErrorException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.NotFoundException; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base.ExceptionResponseImpl; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.BadRequestException; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.NotFoundException; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/BadRequestException.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/BadRequestException.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/BadRequestException.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/BadRequestException.java index 04a5870c..ddcd0f2f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/BadRequestException.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/BadRequestException.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base.CustomException; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base.CustomException; public class BadRequestException extends RuntimeException implements CustomException { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/InternalServerErrorException.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/InternalServerErrorException.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/InternalServerErrorException.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/InternalServerErrorException.java index ca899152..6d5f3ae0 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/InternalServerErrorException.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/InternalServerErrorException.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base.CustomException; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base.CustomException; public class InternalServerErrorException extends RuntimeException implements CustomException { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/NotFoundException.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/NotFoundException.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/NotFoundException.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/NotFoundException.java index 1bf86a7b..7acfe563 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/exceptions/type/NotFoundException.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/exceptions/type/NotFoundException.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type; +package org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.base.CustomException; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.base.CustomException; public class NotFoundException extends RuntimeException implements CustomException { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/models/MaterialCapacityQuantity.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/models/MaterialCapacityQuantity.java similarity index 95% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/models/MaterialCapacityQuantity.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/models/MaterialCapacityQuantity.java index 545584fc..37e83d6f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/models/MaterialCapacityQuantity.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/models/MaterialCapacityQuantity.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.models; +package org.eclipse.tractusx.demandcapacitymgm.backend.models; import java.time.LocalDateTime; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/AddressBookRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/AddressBookRepository.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/AddressBookRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/AddressBookRepository.java index a0d9a8c5..dd28565d 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/AddressBookRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/AddressBookRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.AddressBookRecordEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.AddressBookRecordEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.lang.NonNull; import org.springframework.stereotype.Repository; +import java.util.List; +import java.util.UUID; + @Repository public interface AddressBookRepository extends JpaRepository { List findByNameOrCompanyId(@NonNull String name, @NonNull UUID companyId); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/AlertsRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/AlertsRepository.java similarity index 78% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/AlertsRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/AlertsRepository.java index 066b46ac..01cadbde 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/AlertsRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/AlertsRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,14 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; + +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.AlertEntity; +import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; import java.util.Optional; import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.AlertEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.StatusesEntity; -import org.springframework.data.jpa.repository.JpaRepository; public interface AlertsRepository extends JpaRepository { Optional findByUserID(UUID userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/ArchivedLogsRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/ArchivedLogsRepository.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/ArchivedLogsRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/ArchivedLogsRepository.java index e9a70a98..1ea1e671 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/ArchivedLogsRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/ArchivedLogsRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.ArchivedLogEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.ArchivedLogEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CapacityGroupRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CapacityGroupRepository.java similarity index 85% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CapacityGroupRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CapacityGroupRepository.java index 7595589a..335b33e6 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CapacityGroupRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CapacityGroupRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CapacityGroupEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CapacityGroupEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.lang.NonNull; import org.springframework.stereotype.Repository; +import java.util.List; +import java.util.UUID; + @Repository public interface CapacityGroupRepository extends JpaRepository { List findByUserID(@NonNull UUID userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CapacityGroupRuleSetRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CapacityGroupRuleSetRepository.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CapacityGroupRuleSetRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CapacityGroupRuleSetRepository.java index 6c8f92dc..10ea5ee7 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CapacityGroupRuleSetRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CapacityGroupRuleSetRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.Optional; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CapacityGroupRuleSetEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CapacityGroupRuleSetEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -32,6 +30,9 @@ import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import java.util.UUID; + @Repository public interface CapacityGroupRuleSetRepository extends JpaRepository { @Transactional diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CompanyRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CompanyRepository.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CompanyRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CompanyRepository.java index 76392aad..9cb79be2 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CompanyRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CompanyRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,15 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CompanyEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CompanyEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; +import java.util.UUID; + @Repository public interface CompanyRepository extends JpaRepository { List findTop5ByOrderByCountDesc(); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CompanyRuleSetRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CompanyRuleSetRepository.java similarity index 86% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CompanyRuleSetRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CompanyRuleSetRepository.java index 8d4ead20..2cad1658 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/CompanyRuleSetRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/CompanyRuleSetRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.Optional; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CompanyRuleSetEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CompanyRuleSetEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -32,6 +30,9 @@ import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import java.util.UUID; + @Repository public interface CompanyRuleSetRepository extends JpaRepository { @Transactional diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/DemandCategoryRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/DemandCategoryRepository.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/DemandCategoryRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/DemandCategoryRepository.java index 35aeeaeb..45c168a9 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/DemandCategoryRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/DemandCategoryRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,11 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.DemandCategoryEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.DemandCategoryEntity; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.UUID; + public interface DemandCategoryRepository extends JpaRepository {} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/DemandSeriesRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/DemandSeriesRepository.java similarity index 73% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/DemandSeriesRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/DemandSeriesRepository.java index 71b9808b..b8d0e0ac 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/DemandSeriesRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/DemandSeriesRepository.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.DemandSeries; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.DemandSeries; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.lang.NonNull; +import java.util.List; +import java.util.UUID; + public interface DemandSeriesRepository extends JpaRepository { @Query( """ - select d from DemandSeries d - where d.customerLocation.id = ?1 and d.demandCategory.id = ?2 and d.materialDemand.materialNumberCustomer = ?3""" + select d from DemandSeries d + where d.customerLocation.id = ?1 and d.demandCategory.id = ?2 and d.materialDemand.materialNumberCustomer = ?3""" ) List ByCategoryIDCustomerIDMaterialNrCustomer( @NonNull UUID id, @@ -43,9 +44,9 @@ List ByCategoryIDCustomerIDMaterialNrCustomer( @Query( """ - select d from DemandSeries d - where d.capacityGroupId = ?1 and d.materialDemand.id = ?2 - """ + select d from DemandSeries d + where d.capacityGroupId = ?1 and d.materialDemand.id = ?2 + """ ) DemandSeries fetchByCGIDandMatID(@NonNull UUID id, @NonNull UUID id2); } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/FavoriteRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/FavoriteRepository.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/FavoriteRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/FavoriteRepository.java index d5a1f5fb..b78b7857 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/FavoriteRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/FavoriteRepository.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.FavoriteEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.FavoriteEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.FavoriteType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.lang.NonNull; import org.springframework.transaction.annotation.Transactional; +import java.util.List; +import java.util.UUID; + public interface FavoriteRepository extends JpaRepository { @Transactional @Modifying diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LinkDemandRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LinkDemandRepository.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LinkDemandRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LinkDemandRepository.java index 97d8a273..741eb93f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LinkDemandRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LinkDemandRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.LinkDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.LinkDemandEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.UUID; + @Repository public interface LinkDemandRepository extends JpaRepository {} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LinkedCapacityGroupMaterialDemandRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LinkedCapacityGroupMaterialDemandRepository.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LinkedCapacityGroupMaterialDemandRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LinkedCapacityGroupMaterialDemandRepository.java index 883734a4..6cc09c65 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LinkedCapacityGroupMaterialDemandRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LinkedCapacityGroupMaterialDemandRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,19 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; import jakarta.transaction.Transactional; -import java.math.BigDecimal; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.LinkedCapacityGroupMaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.LinkedCapacityGroupMaterialDemandEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.lang.NonNull; import org.springframework.stereotype.Repository; +import java.math.BigDecimal; +import java.util.List; +import java.util.UUID; + @Repository public interface LinkedCapacityGroupMaterialDemandRepository extends JpaRepository { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LoggingHistoryRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LoggingHistoryRepository.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LoggingHistoryRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LoggingHistoryRepository.java index 44c7926b..23108313 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/LoggingHistoryRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/LoggingHistoryRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,15 +20,16 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.LoggingHistoryEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.LoggingHistoryEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.lang.NonNull; import org.springframework.stereotype.Repository; +import java.util.UUID; + @Repository public interface LoggingHistoryRepository extends JpaRepository { @Query("select l from LoggingHistoryEntity l where l.logID = ?1") diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/MaterialDemandRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/MaterialDemandRepository.java similarity index 85% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/MaterialDemandRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/MaterialDemandRepository.java index 375a7b3a..77e3bddb 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/MaterialDemandRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/MaterialDemandRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,17 +20,18 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; import jakarta.persistence.Cacheable; -import java.util.List; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.MaterialDemandStatus; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.MaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.MaterialDemandStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; +import java.util.List; +import java.util.UUID; + @Repository @Cacheable(false) public interface MaterialDemandRepository extends JpaRepository { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/RulesetRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/RulesetRepository.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/RulesetRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/RulesetRepository.java index 2cc6d677..f1543667 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/RulesetRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/RulesetRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.Rule; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.Rule; import org.springframework.data.jpa.repository.JpaRepository; public interface RulesetRepository extends JpaRepository { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/StatusesRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/StatusesRepository.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/StatusesRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/StatusesRepository.java index d2116bdf..2c6a6d14 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/StatusesRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/StatusesRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; + +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.StatusesEntity; +import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional; import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.StatusesEntity; -import org.springframework.data.jpa.repository.JpaRepository; public interface StatusesRepository extends JpaRepository { Optional findByUserID(UUID userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/TriggeredAlertsRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/TriggeredAlertsRepository.java similarity index 67% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/TriggeredAlertsRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/TriggeredAlertsRepository.java index 2172f097..4569c81e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/TriggeredAlertsRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/TriggeredAlertsRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,9 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.AlertEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.StatusesEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.TriggeredAlertEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.TriggeredAlertEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface TriggeredAlertsRepository extends JpaRepository {} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/UnitMeasureRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/UnitMeasureRepository.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/UnitMeasureRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/UnitMeasureRepository.java index c211dffa..22a6c68d 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/UnitMeasureRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/UnitMeasureRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UnitMeasureEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UnitMeasureEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.UUID; + @Repository public interface UnitMeasureRepository extends JpaRepository {} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/UserRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/UserRepository.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/UserRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/UserRepository.java index 53ec1a7f..41ab93bf 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/UserRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/UserRepository.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,11 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UserEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UserEntity; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.UUID; + public interface UserRepository extends JpaRepository {} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/WeekBasedCapacityGroupRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/WeekBasedCapacityGroupRepository.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/WeekBasedCapacityGroupRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/WeekBasedCapacityGroupRepository.java index ba633036..59dab862 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/WeekBasedCapacityGroupRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/WeekBasedCapacityGroupRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,14 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedCapacityGroupEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedCapacityGroupEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface WeekBasedCapacityGroupRepository extends JpaRepository { List getAllByViewed(Boolean viewed); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/WeekBasedMaterialDemandRepository.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/WeekBasedMaterialDemandRepository.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/WeekBasedMaterialDemandRepository.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/WeekBasedMaterialDemandRepository.java index fe931733..bb9eb694 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/repositories/WeekBasedMaterialDemandRepository.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/repositories/WeekBasedMaterialDemandRepository.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,14 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories; +package org.eclipse.tractusx.demandcapacitymgm.backend.repositories; -import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedMaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedMaterialDemandEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface WeekBasedMaterialDemandRepository extends JpaRepository { List getAllByViewed(Boolean viewed); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/received/WeekBasedCapacityGroupSchedulerReceived.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/received/WeekBasedCapacityGroupSchedulerReceived.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/received/WeekBasedCapacityGroupSchedulerReceived.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/received/WeekBasedCapacityGroupSchedulerReceived.java index e66c5e48..26b0a176 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/received/WeekBasedCapacityGroupSchedulerReceived.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/received/WeekBasedCapacityGroupSchedulerReceived.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.schedulers.received; +package org.eclipse.tractusx.demandcapacitymgm.backend.schedulers.received; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedCapacityGroupService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedCapacityGroupService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/received/WeekBasedMaterialSchedulerReceived.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/received/WeekBasedMaterialSchedulerReceived.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/received/WeekBasedMaterialSchedulerReceived.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/received/WeekBasedMaterialSchedulerReceived.java index e46e850c..a593b599 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/received/WeekBasedMaterialSchedulerReceived.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/received/WeekBasedMaterialSchedulerReceived.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,14 +20,15 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.schedulers.received; +package org.eclipse.tractusx.demandcapacitymgm.backend.schedulers.received; -import java.net.URISyntaxException; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedMaterialService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedMaterialService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.net.URISyntaxException; + @Component @AllArgsConstructor public class WeekBasedMaterialSchedulerReceived { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/send/WeekBasedCapacityGroupScheduler.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/send/WeekBasedCapacityGroupScheduler.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/send/WeekBasedCapacityGroupScheduler.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/send/WeekBasedCapacityGroupScheduler.java index 85cf7a1e..794d14b4 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/send/WeekBasedCapacityGroupScheduler.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/send/WeekBasedCapacityGroupScheduler.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.schedulers.send; +package org.eclipse.tractusx.demandcapacitymgm.backend.schedulers.send; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedCapacityGroupService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedCapacityGroupService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/send/WeekBasedMaterialScheduler.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/send/WeekBasedMaterialScheduler.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/send/WeekBasedMaterialScheduler.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/send/WeekBasedMaterialScheduler.java index 41440e28..f5506fe8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/schedulers/send/WeekBasedMaterialScheduler.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/schedulers/send/WeekBasedMaterialScheduler.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.schedulers.send; +package org.eclipse.tractusx.demandcapacitymgm.backend.schedulers.send; -import java.net.URISyntaxException; import lombok.AllArgsConstructor; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedMaterialService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedMaterialService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/AppSecurityConfigProperties.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/AppSecurityConfigProperties.java similarity index 93% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/AppSecurityConfigProperties.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/AppSecurityConfigProperties.java index 8cbde5a5..efea85e9 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/AppSecurityConfigProperties.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/AppSecurityConfigProperties.java @@ -19,7 +19,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.security; +package org.eclipse.tractusx.demandcapacitymgm.backend.security; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/SecurityConfig.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/SecurityConfig.java similarity index 96% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/SecurityConfig.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/SecurityConfig.java index cadd95b6..67c057c8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/SecurityConfig.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/SecurityConfig.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,8 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.security; +package org.eclipse.tractusx.demandcapacitymgm.backend.security; -import java.util.Arrays; -import java.util.List; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; @@ -37,6 +35,9 @@ import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import java.util.Arrays; +import java.util.List; + @Configuration @EnableWebSecurity public class SecurityConfig { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/WebClientConfig.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/WebClientConfig.java similarity index 87% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/WebClientConfig.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/WebClientConfig.java index 5e8b05e5..072e242d 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/security/WebClientConfig.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/security/WebClientConfig.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.security; +package org.eclipse.tractusx.demandcapacitymgm.backend.security; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -33,8 +33,7 @@ public class WebClientConfig { @Bean public WebClient webClient() { - return WebClient - .builder() + return WebClient.builder() .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE) .build(); } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/AddressBookService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/AddressBookService.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/AddressBookService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/AddressBookService.java index 59841ea7..64fa1616 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/AddressBookService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/AddressBookService.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,11 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookResponse; import java.util.List; public interface AddressBookService { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/AlertService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/AlertService.java similarity index 76% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/AlertService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/AlertService.java index 40cf9395..134f3e87 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/AlertService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/AlertService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,14 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.AlertRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.AlertResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.TriggeredAlertRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.TriggeredAlertResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.util.List; -import java.util.concurrent.atomic.AtomicReference; public interface AlertService { AlertResponse configureAlert(AlertRequest alertRequest); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/BottleneckManager.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/BottleneckManager.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/BottleneckManager.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/BottleneckManager.java index 38c24a10..bd05e3b3 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/BottleneckManager.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/BottleneckManager.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,10 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.YearReportResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.YearReportResponse; import java.time.LocalDate; public interface BottleneckManager { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CapacityGroupRuleSetService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CapacityGroupRuleSetService.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CapacityGroupRuleSetService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CapacityGroupRuleSetService.java index 42574d61..e2c0e9fd 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CapacityGroupRuleSetService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CapacityGroupRuleSetService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CGRulesetRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CGRulesetResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.CGRulesetRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.CGRulesetResponse; public interface CapacityGroupRuleSetService { CGRulesetResponse getCapacityGroupRuleSets(String cgID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CapacityGroupService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CapacityGroupService.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CapacityGroupService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CapacityGroupService.java index 55a10f4b..d007a892 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CapacityGroupService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CapacityGroupService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,12 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; public interface CapacityGroupService { CapacityGroupResponse createCapacityGroup(CapacityGroupRequest capacityGroupRequest, String userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CompanyRuleSetService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CompanyRuleSetService.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CompanyRuleSetService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CompanyRuleSetService.java index 6c52cf75..0f230202 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CompanyRuleSetService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CompanyRuleSetService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CDRulesetRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CDRulesetResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.CDRulesetRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.CDRulesetResponse; public interface CompanyRuleSetService { CDRulesetResponse getCompanyRuleSets(String companyID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CompanyService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CompanyService.java similarity index 80% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CompanyService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CompanyService.java index b1902cd8..037e0729 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/CompanyService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/CompanyService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.CompanyDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CompanyEntity; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CompanyDto; import java.util.List; import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CompanyEntity; public interface CompanyService { CompanyDto createCompany(CompanyDto companyDto); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/DemandCategoryService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/DemandCategoryService.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/DemandCategoryService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/DemandCategoryService.java index a30117db..314e5d48 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/DemandCategoryService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/DemandCategoryService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.DemandCategoryResponse; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.DemandCategoryEntity; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.DemandCategoryResponse; import java.util.List; import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.DemandCategoryEntity; public interface DemandCategoryService { DemandCategoryEntity findById(UUID id); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/DemandService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/DemandService.java similarity index 80% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/DemandService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/DemandService.java index d69f2885..aaae2c40 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/DemandService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/DemandService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.MaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.MaterialDemandStatus; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.MaterialDemandStatus; public interface DemandService { MaterialDemandResponse createDemand(MaterialDemandRequest materialDemandRequest, String userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/EDCService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/EDCService.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/EDCService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/EDCService.java index 0cc1cf4f..10bf8339 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/EDCService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/EDCService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,14 +19,15 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; -import java.util.List; -import javax.xml.catalog.Catalog; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import javax.xml.catalog.Catalog; +import java.util.List; + public interface EDCService { Mono createAsset(AssetEntryNewDto dto); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/FavoriteService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/FavoriteService.java similarity index 74% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/FavoriteService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/FavoriteService.java index 6631dd43..03bb4cec 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/FavoriteService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/FavoriteService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,11 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.FavoriteRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.FavoriteResponse; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; +import eclipse.tractusx.demandcapacitymgm.specification.model.FavoriteRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.FavoriteResponse; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.FavoriteType; public interface FavoriteService { FavoriteResponse getAllFavorites(String userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/GoldenRecordManager.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/GoldenRecordManager.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/GoldenRecordManager.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/GoldenRecordManager.java index f024364f..30b0320b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/GoldenRecordManager.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/GoldenRecordManager.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookRequest; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.AddressBookRecordEntity; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookRequest; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.AddressBookRecordEntity; public interface GoldenRecordManager { AddressBookRecordEntity queryGoldenRecord(String recordQuery); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/LinkDemandService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/LinkDemandService.java similarity index 80% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/LinkDemandService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/LinkDemandService.java index 807b892b..4b017d4b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/LinkDemandService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/LinkDemandService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,11 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedMaterialDemandEntity; import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedMaterialDemandEntity; public interface LinkDemandService { public void createLinkDemands(List weekBasedMaterialDemandEntities); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/LoggingHistoryService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/LoggingHistoryService.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/LoggingHistoryService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/LoggingHistoryService.java index 0d2177a6..e3ac921e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/LoggingHistoryService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/LoggingHistoryService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,12 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.ArchivedLoggingHistoryResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.LoggingHistoryRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.LoggingHistoryResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.util.List; public interface LoggingHistoryService { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/RulesetService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/RulesetService.java similarity index 76% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/RulesetService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/RulesetService.java index 43557528..fd77718c 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/RulesetService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/RulesetService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,11 +20,12 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.AddRuleRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.RuleRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.RuleResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddRuleRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.RuleRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.RuleResponse; import java.util.List; public interface RulesetService { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/SecurityTokenService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/SecurityTokenService.java similarity index 80% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/SecurityTokenService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/SecurityTokenService.java index 9dc2292f..c75c6be7 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/SecurityTokenService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/SecurityTokenService.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.IntrospectTokenResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.User; +import eclipse.tractusx.demandcapacitymgm.specification.model.IntrospectTokenResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.User; import org.springframework.http.ResponseEntity; public interface SecurityTokenService { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/StatusesService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/StatusesService.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/StatusesService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/StatusesService.java index 6f706125..014e38ee 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/StatusesService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/StatusesService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,10 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusesResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.StatusRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.StatusesResponse; public interface StatusesService { StatusesResponse postStatuses(StatusRequest statusRequest, String userID); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/UnityOfMeasureService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/UnityOfMeasureService.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/UnityOfMeasureService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/UnityOfMeasureService.java index 2a28f0b3..9b24b8e2 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/UnityOfMeasureService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/UnityOfMeasureService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.UnitMeasure; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UnitMeasureEntity; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UnitMeasure; import java.util.List; import java.util.UUID; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UnitMeasureEntity; public interface UnityOfMeasureService { UnitMeasure findById(UUID id); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/UserOperationsService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/UserOperationsService.java similarity index 77% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/UserOperationsService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/UserOperationsService.java index 009e30bb..c4da3e70 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/UserOperationsService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/UserOperationsService.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,10 +19,11 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.UserRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.UserResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UserRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UserResponse; import java.util.List; public interface UserOperationsService { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/WeekBasedCapacityGroupService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/WeekBasedCapacityGroupService.java similarity index 74% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/WeekBasedCapacityGroupService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/WeekBasedCapacityGroupService.java index eba1cec2..2916b8e8 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/WeekBasedCapacityGroupService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/WeekBasedCapacityGroupService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,13 +20,14 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupDtoRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupDtoResponse; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CapacityGroupEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedCapacityGroupEntity; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupDtoRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupDtoResponse; import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CapacityGroupEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedCapacityGroupEntity; public interface WeekBasedCapacityGroupService { void createWeekBasedCapacityGroup( diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/WeekBasedMaterialService.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/WeekBasedMaterialService.java similarity index 79% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/WeekBasedMaterialService.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/WeekBasedMaterialService.java index 6e5fba7f..0c3bb647 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/WeekBasedMaterialService.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/WeekBasedMaterialService.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,12 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services; +package org.eclipse.tractusx.demandcapacitymgm.backend.services; + +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandRequestDto; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandResponseDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.MaterialDemandEntity; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandRequestDto; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandResponseDto; import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity; public interface WeekBasedMaterialService { void createWeekBasedMaterial( diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/AddressBookServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/AddressBookServiceImpl.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/AddressBookServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/AddressBookServiceImpl.java index ebe006cb..90f64e12 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/AddressBookServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/AddressBookServiceImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,21 +20,22 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.AddressBookRecordEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.AddressBookRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.AddressBookService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.GoldenRecordManager; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookResponse; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.UUID; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.AddressBookRecordEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.AddressBookRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.AddressBookService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.GoldenRecordManager; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/AlertServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/AlertServiceImpl.java new file mode 100644 index 00000000..3f71c205 --- /dev/null +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/AlertServiceImpl.java @@ -0,0 +1,293 @@ +/* + * ****************************************************************************** + * Copyright (c) 2023 BMW AG + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ******************************************************************************* + */ +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.AlertEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.DedicatedAlertEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.TriggeredAlertEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.AlertThresholdType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.AlertsMonitoredObjects; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.AlertsRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.TriggeredAlertsRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.AlertService; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + +@Lazy +@RequiredArgsConstructor +@Service +@Slf4j +public class AlertServiceImpl implements AlertService { + + private final AlertsRepository alertsRepository; + private final TriggeredAlertsRepository triggeredAlertsRepository; + + @Override + public AlertResponse configureAlert(AlertRequest alertRequest) { + AlertEntity alertEntity = convertDtoToEntity(alertRequest); + alertsRepository.save(alertEntity); + return convertAlertsResponseDto(alertEntity); + } + + @Override + public void triggerDemandAlertsIfNeeded( + String userID, + boolean isMaterialDemandChange, + double oldValue, + double newValue, + String materialDemandId + ) { + List alerts = alertsRepository.findAllByUserID(UUID.fromString(userID)); + alerts.forEach(alertEntity -> { + TriggeredAlertEntity triggeredAlertEntity = new TriggeredAlertEntity(); + triggeredAlertEntity.setId(UUID.randomUUID()); + triggeredAlertEntity.setAlertName(alertEntity.getAlertName()); + triggeredAlertEntity.setType(alertEntity.getType()); + triggeredAlertEntity.setUserID(alertEntity.getUserID()); + triggeredAlertEntity.setMonitoredObjects(alertEntity.getMonitoredObjects()); + triggeredAlertEntity.setThreshold(alertEntity.getThreshold()); + LocalDateTime currentLocalDateTime = LocalDateTime.now(); + triggeredAlertEntity.setCreated(Timestamp.valueOf(currentLocalDateTime).toString()); + if (isGlobalAlert(isMaterialDemandChange, alertEntity)) { + if (alertEntity.getType().equals(AlertThresholdType.RELATIVE)) { + double threshold = alertEntity.getThreshold() / 100; + double demandDelta = threshold * oldValue; + if (threshold >= 0 && (newValue - oldValue >= demandDelta)) { + fillTriggeredAlert( + triggeredAlertEntity, + "Increased by ", + alertEntity.getThreshold(), + true, + alertEntity + ); + } else if ((threshold < 0 && (newValue - oldValue <= demandDelta))) { + fillTriggeredAlert( + triggeredAlertEntity, + "Decreased by ", + alertEntity.getThreshold(), + true, + alertEntity + ); + } + } else if (alertEntity.getType().equals(AlertThresholdType.ABSOLUTE)) { + double threshold = alertEntity.getThreshold(); + if (threshold >= 0 && (newValue - oldValue >= threshold)) { + fillTriggeredAlert(triggeredAlertEntity, "Increased by ", threshold, false, alertEntity); + } else if ((threshold < 0 && (newValue - oldValue <= threshold))) { + fillTriggeredAlert(triggeredAlertEntity, "Decreased by ", threshold, false, alertEntity); + } + } + } else if (alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.DEDICATED)) { + alertEntity + .getDedicatedAlerts() + .forEach(dedicatedAlert -> { + if (Objects.equals(materialDemandId, dedicatedAlert.getObjectId().toString())) { + if (alertEntity.getType().equals(AlertThresholdType.ABSOLUTE)) { + double threshold = alertEntity.getThreshold(); + if (threshold >= 0 && (newValue - oldValue >= threshold)) { + fillTriggeredAlert( + triggeredAlertEntity, + "Increased by ", + threshold, + false, + alertEntity + ); + } else if ((threshold < 0 && (newValue - oldValue <= threshold))) { + fillTriggeredAlert( + triggeredAlertEntity, + "Decreased by ", + threshold, + false, + alertEntity + ); + } + } else { + double threshold = alertEntity.getThreshold() / 100; + double demandDelta = alertEntity.getThreshold() * oldValue; + if (threshold >= 0 && (newValue - oldValue >= demandDelta)) { + fillTriggeredAlert( + triggeredAlertEntity, + "Increased by ", + threshold, + true, + alertEntity + ); + } else if ((threshold < 0 && (newValue - oldValue <= demandDelta))) { + fillTriggeredAlert( + triggeredAlertEntity, + "Decreased by ", + threshold, + true, + alertEntity + ); + } + } + } + }); + } + }); + } + + private void fillTriggeredAlert( + TriggeredAlertEntity triggeredAlertEntity, + String message, + double threshold, + boolean isRelative, + AlertEntity alertEntity + ) { + triggeredAlertEntity.setDescription(message + threshold + (isRelative ? "%" : " units")); + alertEntity.setTriggeredTimes(alertEntity.getTriggeredTimes() + 1); + alertsRepository.save(alertEntity); + triggeredAlertsRepository.save(triggeredAlertEntity); + } + + private static boolean isGlobalAlert(boolean isMaterialDemandChange, AlertEntity alertEntity) { + return ( + alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.ALL_DEMANDS) || + (alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.ALL_CAPACITIES) && + !isMaterialDemandChange) || + alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.ALL_OBJECTS) + ); + } + + @Override + public List getAlerts(String userID) { + List alerts = alertsRepository.findAll(); + + getAlertByUserId(userID, alerts); + return alerts.stream().map(this::convertAlertsResponseDto).toList(); + } + + private static void getTriggeredAlertByUserId(String userID, List alerts) { + alerts + .stream() + .filter(alertEntity -> { + if (alertEntity.getUserID().toString().equals(userID)) { + alerts.add(alertEntity); + } + return false; + }); + } + + private static void getAlertByUserId(String userID, List alerts) { + alerts + .stream() + .filter(alertEntity -> { + if (alertEntity.getUserID().toString().equals(userID)) { + alerts.add(alertEntity); + } + return false; + }); + } + + @Override + public List getTriggeredAlerts(String userID) { + List alerts = triggeredAlertsRepository.findAll(); + getTriggeredAlertByUserId(userID, alerts); + return alerts.stream().map(this::convertTriggeredAlertsResponseDto).toList(); + } + + @Override + public TriggeredAlertResponse postTriggeredAlerts(TriggeredAlertRequest triggeredAlertRequest) { + return null; + } + + private AlertResponse convertAlertsResponseDto(AlertEntity alertEntity) { + List dedicatedAlerts = alertEntity + .getDedicatedAlerts() + .stream() + .map(this::enrichDedicateAlertResponse) + .toList(); + + AlertResponse responseDto = new AlertResponse(); + responseDto.setType(alertEntity.getType().name()); + responseDto.setAlertId("" + alertEntity.getId()); + responseDto.setAlertName(alertEntity.getAlertName()); + responseDto.setCreated(alertEntity.getCreated()); + responseDto.setMonitoredObjects(alertEntity.getMonitoredObjects().name()); + responseDto.setThreshold(String.valueOf(alertEntity.getThreshold())); + responseDto.setUser(alertEntity.getUserID().toString()); + //responseDto.setTriggerTimes(alertEntity.getTriggeredTimes()); + responseDto.setDedicatedAlerts(dedicatedAlerts); + return responseDto; + } + + DedicatedAlert enrichDedicateAlertResponse(DedicatedAlertEntity alertEntity) { + DedicatedAlert dedicatedAlert = new DedicatedAlert(); + dedicatedAlert.setId(alertEntity.getId().toString()); + dedicatedAlert.setType(alertEntity.getType().toString()); + dedicatedAlert.setObjectId(alertEntity.getObjectId().toString()); + return dedicatedAlert; + } + + private TriggeredAlertResponse convertTriggeredAlertsResponseDto(TriggeredAlertEntity alertEntity) { + TriggeredAlertResponse responseDto = new TriggeredAlertResponse(); + responseDto.setType(alertEntity.getType().name()); + responseDto.setAlertId("" + alertEntity.getId()); + responseDto.setAlertName(alertEntity.getAlertName()); + responseDto.setCreated(alertEntity.getCreated()); + responseDto.setDescription(alertEntity.getDescription()); + responseDto.setMonitoredObjects(alertEntity.getMonitoredObjects().name()); + responseDto.setThreshold(String.valueOf(alertEntity.getThreshold())); + responseDto.setUser(alertEntity.getUserID().toString()); + return responseDto; + } + + DedicatedAlertEntity convertDedicatedAlertsDtoToEntity(DedicatedAlert dedicatedAlert) { + return DedicatedAlertEntity.builder() + .id(UUID.randomUUID()) + .type(EventObjectType.valueOf(dedicatedAlert.getType())) + .objectId(UUID.fromString(dedicatedAlert.getObjectId())) + .build(); + } + + private AlertEntity convertDtoToEntity(AlertRequest alertRequest) { + List dedicatedAlertEntities = alertRequest + .getDedicatedAlerts() + .stream() + .map(this::convertDedicatedAlertsDtoToEntity) + .toList(); + LocalDateTime currentLocalDateTime = LocalDateTime.now(); + + return AlertEntity.builder() + .id(UUID.randomUUID()) + .alertName(alertRequest.getAlertName()) + .created(Timestamp.valueOf(currentLocalDateTime).toString()) + .monitoredObjects(AlertsMonitoredObjects.valueOf(alertRequest.getMonitoredObjects())) + .threshold(Double.parseDouble(alertRequest.getThreshold().toString())) + .triggeredTimes(0) + .userID(UUID.fromString(alertRequest.getUser())) + .type(AlertThresholdType.valueOf(alertRequest.getType())) + .dedicatedAlerts(dedicatedAlertEntities) + .build(); + } +} diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/BottleneckManagerImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/BottleneckManagerImpl.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/BottleneckManagerImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/BottleneckManagerImpl.java index 6ac9366e..897251ae 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/BottleneckManagerImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/BottleneckManagerImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,16 +20,17 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.YearReportResponse; -import java.time.LocalDate; +import eclipse.tractusx.demandcapacitymgm.specification.model.YearReportResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.BottleneckManager; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.BottleneckDetectorUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.BottleneckManager; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.BottleneckDetectorUtil; import org.springframework.stereotype.Service; +import java.time.LocalDate; + @RequiredArgsConstructor @Service @Slf4j diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CapacityGroupRuleSetServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CapacityGroupRuleSetServiceImpl.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CapacityGroupRuleSetServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CapacityGroupRuleSetServiceImpl.java index 60297094..c1f6939c 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CapacityGroupRuleSetServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CapacityGroupRuleSetServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,19 +20,20 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CGRulesetRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CGRulesetResponse; -import java.util.Optional; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.CGRulesetRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.CGRulesetResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CapacityGroupRuleSetEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.CapacityGroupRuleSetRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CapacityGroupRuleSetService; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CapacityGroupRuleSetEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.CapacityGroupRuleSetRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CapacityGroupRuleSetService; import org.springframework.stereotype.Service; +import java.util.Optional; +import java.util.UUID; + @RequiredArgsConstructor @Service @Slf4j diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CapacityGroupServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CapacityGroupServiceImpl.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CapacityGroupServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CapacityGroupServiceImpl.java index f7c8c749..6a373df1 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CapacityGroupServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CapacityGroupServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,21 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.NotFoundException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UUIDUtil; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.math.BigDecimal; import java.time.LocalDate; import java.time.format.DateTimeFormatter; @@ -31,17 +43,6 @@ import java.util.Optional; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.NotFoundException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UUIDUtil; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service @@ -261,13 +262,11 @@ private CapacityGroupEntity getCapacityGroupEntity(String capacityGroupId) { private CapacityGroupResponse convertCapacityGroupDto(CapacityGroupEntity capacityGroupEntity) { final CapacityGroupResponse responseDto = new CapacityGroupResponse(); - final CompanyDto customer = Optional - .ofNullable(capacityGroupEntity.getCustomer()) + final CompanyDto customer = Optional.ofNullable(capacityGroupEntity.getCustomer()) .map(companyService::convertEntityToDto) .orElse(null); - final CompanyDto supplier = Optional - .ofNullable(capacityGroupEntity.getSupplier()) + final CompanyDto supplier = Optional.ofNullable(capacityGroupEntity.getSupplier()) .map(companyService::convertEntityToDto) .orElse(null); @@ -285,9 +284,10 @@ private CapacityGroupResponse convertCapacityGroupDto(CapacityGroupEntity capaci ); responseDto.setCustomer(customer); responseDto.setSupplier(supplier); - List linkedCGMD = linkedCapacityGroupMaterialDemandRepository.findLinkedCapacityGroupMaterialDemandEntitiesByCapacityGroupID( - capacityGroupEntity.getId() - ); + List linkedCGMD = + linkedCapacityGroupMaterialDemandRepository.findLinkedCapacityGroupMaterialDemandEntitiesByCapacityGroupID( + capacityGroupEntity.getId() + ); List linkedDemands = new ArrayList<>(); for (LinkedCapacityGroupMaterialDemandEntity ent : linkedCGMD) { linkedDemands.add(ent.getMaterialDemandID()); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CompanyRuleSetServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CompanyRuleSetServiceImpl.java similarity index 81% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CompanyRuleSetServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CompanyRuleSetServiceImpl.java index 63e8e591..1897345e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CompanyRuleSetServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CompanyRuleSetServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,19 +20,20 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CDRulesetRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CDRulesetResponse; -import java.util.Optional; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.CDRulesetRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.CDRulesetResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CompanyRuleSetEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.CompanyRuleSetRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CompanyRuleSetService; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CompanyRuleSetEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.CompanyRuleSetRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CompanyRuleSetService; import org.springframework.stereotype.Service; +import java.util.Optional; +import java.util.UUID; + @RequiredArgsConstructor @Service @Slf4j diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CompanyServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CompanyServiceImpl.java similarity index 82% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CompanyServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CompanyServiceImpl.java index 4796ca29..f900d94e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/CompanyServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/CompanyServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,25 +20,25 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.CompanyDto; +import eclipse.tractusx.demandcapacitymgm.specification.model.LoggingHistoryRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CompanyEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.NotFoundException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.CompanyRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.CompanyService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LoggingHistoryService; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.CompanyDto; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.LoggingHistoryRequest; -import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.UUID; import java.util.stream.Collectors; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CompanyEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.NotFoundException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.CompanyRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CompanyService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LoggingHistoryService; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/DemandCategoryServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/DemandCategoryServiceImpl.java similarity index 78% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/DemandCategoryServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/DemandCategoryServiceImpl.java index f85a6278..a12a6e39 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/DemandCategoryServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/DemandCategoryServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.DemandCategoryResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.DemandCategoryEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.NotFoundException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.DemandCategoryRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.DemandCategoryService; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.DemandCategoryResponse; import java.util.List; import java.util.Optional; import java.util.UUID; import java.util.stream.Collectors; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.DemandCategoryEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.NotFoundException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.DemandCategoryRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.DemandCategoryService; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/DemandServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/DemandServiceImpl.java similarity index 73% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/DemandServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/DemandServiceImpl.java index 9cf4cab7..f18d0900 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/DemandServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/DemandServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,34 +20,31 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.MaterialDemandStatus; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.BadRequestException; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.NotFoundException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.DataConverterUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UUIDUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; +import org.springframework.stereotype.Service; + import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.MaterialDemandStatus; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.BadRequestException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.NotFoundException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.DataConverterUtil; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UUIDUtil; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service @@ -148,21 +145,17 @@ public MaterialDemandResponse updateDemand( } linkedCapacityGroupMaterialDemandRepository .findAll() - .forEach( - linkedCapacityGroupMaterialDemandEntity -> { - if (demandId.equals(linkedCapacityGroupMaterialDemandEntity.getMaterialDemandID().toString())) { - Optional capacityGroupEntity = capacityGroupRepository.findById( - linkedCapacityGroupMaterialDemandEntity.getCapacityGroupID() - ); - capacityGroupEntity.ifPresent( - groupEntity -> { - groupEntity.setLinkStatus(EventType.LINKED); - capacityGroupRepository.save(capacityGroupEntity.get()); - } - ); - } - } - ); + .forEach(linkedCapacityGroupMaterialDemandEntity -> { + if (demandId.equals(linkedCapacityGroupMaterialDemandEntity.getMaterialDemandID().toString())) { + Optional capacityGroupEntity = capacityGroupRepository.findById( + linkedCapacityGroupMaterialDemandEntity.getCapacityGroupID() + ); + capacityGroupEntity.ifPresent(groupEntity -> { + groupEntity.setLinkStatus(EventType.LINKED); + capacityGroupRepository.save(capacityGroupEntity.get()); + }); + } + }); triggerDemandAlertsIfNeeded(demandId, userID, demand); @@ -181,57 +174,44 @@ private void triggerDemandAlertsIfNeeded(String demandId, String userID, Materia demand .getDemandSeries() - .forEach( - demandSeries -> { - demandSeries - .getDemandSeriesValues() - .forEach( - demandSeriesValues -> { - newDemandValues.add(demandSeriesValues.getDemand()); - } - ); - newDemandValuesMap.put(demandSeries.getDemandCategory().getId(), newDemandValues.stream().toList()); - newDemandValues.clear(); - } - ); + .forEach(demandSeries -> { + demandSeries + .getDemandSeriesValues() + .forEach(demandSeriesValues -> { + newDemandValues.add(demandSeriesValues.getDemand()); + }); + newDemandValuesMap.put(demandSeries.getDemandCategory().getId(), newDemandValues.stream().toList()); + newDemandValues.clear(); + }); materialDemandRepository .findById(UUID.fromString(demandId)) .get() .getDemandSeries() - .forEach( - demandSeries1 -> { - demandSeries1 - .getDemandSeriesValues() - .forEach( - demandSeriesValues -> { - oldDemandValues.add(demandSeriesValues.getDemand()); - } - ); - oldDemandValuesMap.put( - demandSeries1.getDemandCategory().getId(), - oldDemandValues.stream().toList() - ); - oldDemandValues.clear(); - } - ); - - newDemandValuesMap.forEach( - (newDemandKey, newValuesArray) -> { - int minSize = Math.min(newValuesArray.size(), oldDemandValuesMap.get(newDemandKey).size()); - for (int i = 0; i < minSize; i++) { - if (!Objects.equals(oldDemandValuesMap.get(newDemandKey).get(i), newValuesArray.get(i))) { - alertService.triggerDemandAlertsIfNeeded( - userID, - true, - oldDemandValuesMap.get(newDemandKey).get(i), - newValuesArray.get(i), - demandId - ); - } - } - } - ); + .forEach(demandSeries1 -> { + demandSeries1 + .getDemandSeriesValues() + .forEach(demandSeriesValues -> { + oldDemandValues.add(demandSeriesValues.getDemand()); + }); + oldDemandValuesMap.put(demandSeries1.getDemandCategory().getId(), oldDemandValues.stream().toList()); + oldDemandValues.clear(); + }); + + newDemandValuesMap.forEach((newDemandKey, newValuesArray) -> { + int minSize = Math.min(newValuesArray.size(), oldDemandValuesMap.get(newDemandKey).size()); + for (int i = 0; i < minSize; i++) { + if (!Objects.equals(oldDemandValuesMap.get(newDemandKey).get(i), newValuesArray.get(i))) { + alertService.triggerDemandAlertsIfNeeded( + userID, + true, + oldDemandValuesMap.get(newDemandKey).get(i), + newValuesArray.get(i), + demandId + ); + } + } + }); } private List getAllDemands() { @@ -374,19 +354,15 @@ private MaterialDemandResponse convertDemandResponseDto(MaterialDemandEntity mat if (materialDemandEntity.getLinkStatus() != null) { if ( - ( - materialDemandEntity.getLinkStatus().equals(EventType.TODO) || - (materialDemandEntity.getLinkStatus().equals(EventType.UN_LINKED)) && - user.getRole().equals(Role.CUSTOMER) - ) + (materialDemandEntity.getLinkStatus().equals(EventType.TODO) || + ((materialDemandEntity.getLinkStatus().equals(EventType.UN_LINKED)) && + user.getRole().equals(Role.CUSTOMER))) ) { responseDto.setLinkStatus(String.valueOf(EventType.UN_LINKED)); } else if ( - ( - materialDemandEntity.getLinkStatus().equals(EventType.TODO) || - (materialDemandEntity.getLinkStatus().equals(EventType.UN_LINKED)) && - user.getRole().equals(Role.SUPPLIER) - ) + (materialDemandEntity.getLinkStatus().equals(EventType.TODO) || + ((materialDemandEntity.getLinkStatus().equals(EventType.UN_LINKED)) && + user.getRole().equals(Role.SUPPLIER))) ) { responseDto.setLinkStatus(String.valueOf(EventType.TODO)); } else { @@ -423,51 +399,49 @@ private void validateMaterialDemandRequestFields(MaterialDemandRequest materialD materialDemandRequest .getMaterialDemandSeries() - .forEach( - materialDemandSeries -> { - if (!UUIDUtil.checkValidUUID(materialDemandSeries.getCustomerLocationId())) { - throw new BadRequestException("2", "13"); - } - if (!UUIDUtil.checkValidUUID(materialDemandSeries.getDemandCategoryId())) { - throw new BadRequestException("8", "22"); - } - - List dates = materialDemandSeries - .getDemandSeriesValues() - .stream() - .map( - materialDemandSeriesValue -> - DataConverterUtil.convertFromString(materialDemandSeriesValue.getCalendarWeek()) - ) - .toList(); - - if ( - Boolean.TRUE.equals(!DataConverterUtil.checkListAllMonday(dates)) || - Boolean.TRUE.equals(!DataConverterUtil.checkDatesSequence(dates)) - ) { - throw new BadRequestException("1", "11"); - } - - materialDemandSeries.getExpectedSupplierLocationId().forEach(UUIDUtil::checkValidUUID); - - List expectedSuppliersLocation = materialDemandSeries - .getExpectedSupplierLocationId() - .stream() - .map(UUIDUtil::generateUUIDFromString) - .toList(); - - List companyEntities = companyService.getCompanyIn(expectedSuppliersLocation); - - boolean hasAllCompanies = companyEntities - .stream() - .map(CompanyEntity::getId) - .allMatch(expectedSuppliersLocation::contains); - - if (!hasAllCompanies) { - throw new BadRequestException("1", "12"); - } - } - ); + .forEach(materialDemandSeries -> { + if (!UUIDUtil.checkValidUUID(materialDemandSeries.getCustomerLocationId())) { + throw new BadRequestException("2", "13"); + } + if (!UUIDUtil.checkValidUUID(materialDemandSeries.getDemandCategoryId())) { + throw new BadRequestException("8", "22"); + } + + List dates = materialDemandSeries + .getDemandSeriesValues() + .stream() + .map( + materialDemandSeriesValue -> + DataConverterUtil.convertFromString(materialDemandSeriesValue.getCalendarWeek()) + ) + .toList(); + + if ( + Boolean.TRUE.equals(!DataConverterUtil.checkListAllMonday(dates)) || + Boolean.TRUE.equals(!DataConverterUtil.checkDatesSequence(dates)) + ) { + throw new BadRequestException("1", "11"); + } + + materialDemandSeries.getExpectedSupplierLocationId().forEach(UUIDUtil::checkValidUUID); + + List expectedSuppliersLocation = materialDemandSeries + .getExpectedSupplierLocationId() + .stream() + .map(UUIDUtil::generateUUIDFromString) + .toList(); + + List companyEntities = companyService.getCompanyIn(expectedSuppliersLocation); + + boolean hasAllCompanies = companyEntities + .stream() + .map(CompanyEntity::getId) + .allMatch(expectedSuppliersLocation::contains); + + if (!hasAllCompanies) { + throw new BadRequestException("1", "12"); + } + }); } private MaterialDemandEntity convertDtoToEntity(MaterialDemandRequest materialDemandRequest, String id) { @@ -486,19 +460,16 @@ private MaterialDemandEntity convertDtoToEntity(MaterialDemandRequest materialDe List demandSeriesList = materialDemandRequest .getMaterialDemandSeries() .stream() - .map( - materialDemandSeries -> { - DemandCategoryEntity demandCategory = demandCategoryService.findById( - UUIDUtil.generateUUIDFromString(materialDemandSeries.getDemandCategoryId()) - ); - materialDemandSeries.setId(materialDemandSeries.getDemandCategoryId()); - return enrichDemandSeries(materialDemandSeries, customerEntity, demandCategory); - } - ) + .map(materialDemandSeries -> { + DemandCategoryEntity demandCategory = demandCategoryService.findById( + UUIDUtil.generateUUIDFromString(materialDemandSeries.getDemandCategoryId()) + ); + materialDemandSeries.setId(materialDemandSeries.getDemandCategoryId()); + return enrichDemandSeries(materialDemandSeries, customerEntity, demandCategory); + }) .toList(); - return MaterialDemandEntity - .builder() + return MaterialDemandEntity.builder() .materialDescriptionCustomer(materialDemandRequest.getMaterialDescriptionCustomer()) .materialNumberCustomer(materialDemandRequest.getMaterialNumberCustomer()) .materialNumberSupplier(materialDemandRequest.getMaterialNumberSupplier()) @@ -519,8 +490,7 @@ private DemandSeries enrichDemandSeries( materialDemandSeries.getDemandSeriesValues() ); - return DemandSeries - .builder() + return DemandSeries.builder() .expectedSupplierLocation(materialDemandSeries.getExpectedSupplierLocationId()) .id(UUID.fromString(materialDemandSeries.getId())) .customerLocation(customerEntity) @@ -534,8 +504,7 @@ private List enrichDemandSeriesValues(List - DemandSeriesValues - .builder() + DemandSeriesValues.builder() .demand(materialDemandSeriesValue.getDemand().doubleValue()) .calendarWeek(LocalDate.parse(materialDemandSeriesValue.getCalendarWeek())) .build() diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/EDCServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/EDCServiceImpl.java similarity index 94% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/EDCServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/EDCServiceImpl.java index 4de5a27b..f10701aa 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/EDCServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/EDCServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,18 +20,15 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import io.github.cdimascio.dotenv.Dotenv; -import java.time.Duration; -import java.time.Instant; -import java.util.List; -import javax.xml.catalog.Catalog; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.EDCService; -import org.springframework.http.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.EDCService; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; import org.springframework.stereotype.Service; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient; @@ -39,6 +36,11 @@ import reactor.core.publisher.Mono; import reactor.util.retry.Retry; +import javax.xml.catalog.Catalog; +import java.time.Duration; +import java.time.Instant; +import java.util.List; + @RequiredArgsConstructor @Service @Slf4j @@ -70,8 +72,7 @@ public Mono getToken() { @Override public Mono getAccessToken() { - WebClient client = WebClient - .builder() + WebClient client = WebClient.builder() .baseUrl(tokenEndpoint) .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE) .build(); @@ -79,20 +80,17 @@ public Mono getAccessToken() { return client .post() .body( - BodyInserters - .fromFormData("grant_type", grantType) + BodyInserters.fromFormData("grant_type", grantType) .with("client_id", clientId) .with("client_secret", clientSecret) ) .retrieve() .bodyToMono(AccessTokenResponse.class) - .doOnSuccess( - response -> { - accessToken = response.getAccessToken(); - // Set token expiration time (assuming response provides expiresIn in seconds) - tokenExpiration = Instant.now().plusSeconds(response.getExpiresIn().longValue()); - } - ); + .doOnSuccess(response -> { + accessToken = response.getAccessToken(); + // Set token expiration time (assuming response provides expiresIn in seconds) + tokenExpiration = Instant.now().plusSeconds(response.getExpiresIn().longValue()); + }); } private boolean isTokenExpired() { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/FavoriteServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/FavoriteServiceImpl.java similarity index 94% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/FavoriteServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/FavoriteServiceImpl.java index 7bcb00fa..69c415a5 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/FavoriteServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/FavoriteServiceImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,18 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.FavoriteType; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.FavoriteService; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.sql.Timestamp; import java.time.Instant; import java.time.LocalDate; @@ -30,14 +39,6 @@ import java.util.List; import java.util.Optional; import java.util.UUID; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.FavoriteService; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service @@ -286,8 +287,7 @@ public void deleteFavorite(String userID, String favoriteID) { } private FavoriteEntity generateFavoriteEntity(FavoriteRequest request, String cookieUserID) { - return FavoriteEntity - .builder() + return FavoriteEntity.builder() .userID(UUID.fromString(cookieUserID)) .favorited_at(Timestamp.from(Instant.now())) .favoriteId(UUID.fromString(request.getFavoriteId())) diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/GoldenRecordManagerImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/GoldenRecordManagerImpl.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/GoldenRecordManagerImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/GoldenRecordManagerImpl.java index 9eb1d00b..a03a4c92 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/GoldenRecordManagerImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/GoldenRecordManagerImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,17 +20,18 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookRequest; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddressBookRequest; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.AddressBookRecordEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.AddressBookRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.GoldenRecordManager; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.AddressBookRecordEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.AddressBookRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.GoldenRecordManager; import org.springframework.stereotype.Service; +import java.util.UUID; + @Slf4j @Service @RequiredArgsConstructor diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/LinkDemandServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/LinkDemandServiceImpl.java similarity index 54% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/LinkDemandServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/LinkDemandServiceImpl.java index 489915df..2ca04fec 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/LinkDemandServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/LinkDemandServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,23 +20,24 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.LoggingHistoryRequest; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.LoggingHistoryRequest; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.LinkDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedMaterialDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.LinkDemandRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LinkDemandService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LoggingHistoryService; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.LinkDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedMaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.LinkDemandRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LinkDemandService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LoggingHistoryService; import org.springframework.stereotype.Service; +import java.util.LinkedList; +import java.util.List; +import java.util.UUID; + @RequiredArgsConstructor @Service @Slf4j @@ -50,13 +51,11 @@ public class LinkDemandServiceImpl implements LinkDemandService { public void createLinkDemands(List weekBasedMaterialDemandEntities) { List linkDemandEntityList = new LinkedList<>(); - weekBasedMaterialDemandEntities.forEach( - weekBasedMaterialDemand -> { - List linkDemandEntity = convertFromWeekBasedMaterial(weekBasedMaterialDemand); + weekBasedMaterialDemandEntities.forEach(weekBasedMaterialDemand -> { + List linkDemandEntity = convertFromWeekBasedMaterial(weekBasedMaterialDemand); - linkDemandEntityList.addAll(linkDemandEntity); - } - ); + linkDemandEntityList.addAll(linkDemandEntity); + }); postLogs(); linkDemandRepository.saveAll(linkDemandEntityList); } @@ -75,21 +74,18 @@ private List convertFromWeekBasedMaterial(WeekBasedMaterialDem .getWeekBasedMaterialDemand() .getDemandSeries() .stream() - .map( - demandWeekSeriesDto -> - LinkDemandEntity - .builder() - .linked(false) //Id =id - .demandCategoryId(demandWeekSeriesDto.getDemandCategory().getId()) - .weekBasedMaterialDemand(weekBasedMaterialDemand) - .materialNumberSupplier( - weekBasedMaterialDemand.getWeekBasedMaterialDemand().getMaterialNumberSupplier() - ) - .materialNumberCustomer( - weekBasedMaterialDemand.getWeekBasedMaterialDemand().getMaterialNumberCustomer() - ) - .build() - ) + .map(demandWeekSeriesDto -> + LinkDemandEntity.builder() + .linked(false) //Id =id + .demandCategoryId(demandWeekSeriesDto.getDemandCategory().getId()) + .weekBasedMaterialDemand(weekBasedMaterialDemand) + .materialNumberSupplier( + weekBasedMaterialDemand.getWeekBasedMaterialDemand().getMaterialNumberSupplier() + ) + .materialNumberCustomer( + weekBasedMaterialDemand.getWeekBasedMaterialDemand().getMaterialNumberCustomer() + ) + .build()) .toList(); } } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/LoggingHistoryServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/LoggingHistoryServiceImpl.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/LoggingHistoryServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/LoggingHistoryServiceImpl.java index 64e2d2dd..906ab84a 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/LoggingHistoryServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/LoggingHistoryServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,28 +20,29 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.ArchivedLogEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.LoggingHistoryEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UserEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.ArchivedLogsRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.LoggingHistoryRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.UserRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.FavoriteService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LoggingHistoryService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UserUtil; +import org.springframework.stereotype.Service; + import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.ArchivedLogEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.LoggingHistoryEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UserEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.ArchivedLogsRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.LoggingHistoryRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.UserRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.FavoriteService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LoggingHistoryService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service @@ -156,22 +157,20 @@ private ArchivedLogEntity convertDtoToArchivedEntity(LoggingHistoryRequest loggi // @Override public List getLoggingHistoryByCapacityId(String capacityGroupId) { List loggingHistoryResponses = getAllLoggingHistory(); - loggingHistoryResponses = - loggingHistoryResponses - .stream() - .filter(log -> (Objects.equals(log.getCapacityGroupId(), capacityGroupId))) - .collect(Collectors.toList()); + loggingHistoryResponses = loggingHistoryResponses + .stream() + .filter(log -> (Objects.equals(log.getCapacityGroupId(), capacityGroupId))) + .collect(Collectors.toList()); return loggingHistoryResponses; } // @Override public List getLoggingHistoryByMaterialDemandId(String materialDemandId) { List loggingHistoryResponses = getAllLoggingHistory(); - loggingHistoryResponses = - loggingHistoryResponses - .stream() - .filter(log -> Objects.equals(log.getMaterialDemandId(), materialDemandId)) - .collect(Collectors.toList()); + loggingHistoryResponses = loggingHistoryResponses + .stream() + .filter(log -> Objects.equals(log.getMaterialDemandId(), materialDemandId)) + .collect(Collectors.toList()); return loggingHistoryResponses; } diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/RulesetServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/RulesetServiceImpl.java similarity index 85% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/RulesetServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/RulesetServiceImpl.java index 546eee1b..9ed9be15 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/RulesetServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/RulesetServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,21 +20,22 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddRuleRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.RuleRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.RuleResponse; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; +import eclipse.tractusx.demandcapacitymgm.specification.model.AddRuleRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.RuleRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.RuleResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.Rule; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.RulesetRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.RulesetService; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.Rule; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.RulesetRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.RulesetService; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + @RequiredArgsConstructor @Service @Slf4j diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/SecurityTokenServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/SecurityTokenServiceImpl.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/SecurityTokenServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/SecurityTokenServiceImpl.java index e2c07cac..4d33e7df 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/SecurityTokenServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/SecurityTokenServiceImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,22 +20,21 @@ * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; import com.auth0.jwt.JWT; import com.auth0.jwt.interfaces.Claim; import com.auth0.jwt.interfaces.DecodedJWT; import com.fasterxml.uuid.Logger; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.IntrospectTokenResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.Role; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.TokenResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.User; -import java.util.*; +import eclipse.tractusx.demandcapacitymgm.specification.model.IntrospectTokenResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.Role; +import eclipse.tractusx.demandcapacitymgm.specification.model.TokenResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.User; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UserEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.UserRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.SecurityTokenService; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UserEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.UserRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.SecurityTokenService; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; @@ -47,6 +46,8 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; +import java.util.*; + @RequiredArgsConstructor @Service @Slf4j @@ -200,13 +201,11 @@ private User fetchUser(TokenResponse token) { String userID = decodedJWT.getSubject(); UserEntity entity = userRepository .findById(UUID.fromString(userID)) - .orElseGet( - () -> { - UserEntity newUserEntity = generateUser(userID, decodedJWT); - userRepository.save(newUserEntity); - return newUserEntity; - } - ); + .orElseGet(() -> { + UserEntity newUserEntity = generateUser(userID, decodedJWT); + userRepository.save(newUserEntity); + return newUserEntity; + }); return convertUserEntity(entity, token.getAccessToken(), token.getRefreshToken(), token.getExpiresIn()); } @@ -223,8 +222,7 @@ private UserEntity generateUser(String userID, DecodedJWT decodedJWT) { ); Claim rolesClaim = decodedJWT.getClaim("realm_access"); - Map realmAccessMap = Optional - .ofNullable(rolesClaim) + Map realmAccessMap = Optional.ofNullable(rolesClaim) .map(Claim::asMap) .orElse(Collections.emptyMap()); @@ -236,9 +234,10 @@ private UserEntity generateUser(String userID, DecodedJWT decodedJWT) { if (roleObj instanceof String) { String roleStr = (String) roleObj; try { - org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role role = org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role.valueOf( - roleStr - ); + org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role role = + org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role.valueOf( + roleStr + ); newUserEntity.setRole(role); break; } catch (Exception e) { diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/StatusesServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/StatusesServiceImpl.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/StatusesServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/StatusesServiceImpl.java index 9cbbd72c..fad4391c 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/StatusesServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/StatusesServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.StatusesResponse; -import java.util.Optional; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.StatusRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.StatusesResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.StatusesEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.StatusesRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.StatusesService; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.StatusesEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.StatusesRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.StatusesService; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; +import java.util.Optional; +import java.util.UUID; + @Lazy @RequiredArgsConstructor @Service @@ -43,8 +44,7 @@ public class StatusesServiceImpl implements StatusesService { private final StatusesRepository statusesRepository; private StatusesEntity convertDtoToEntity(StatusRequest statusRequest, String userID) { - return StatusesEntity - .builder() + return StatusesEntity.builder() .userID(UUID.fromString(userID)) .todosCount(statusRequest.getTodos()) .generalCount(statusRequest.getGeneral()) diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/UnityOfMeasureServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/UnityOfMeasureServiceImpl.java similarity index 83% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/UnityOfMeasureServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/UnityOfMeasureServiceImpl.java index be5b5da6..21cd579e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/UnityOfMeasureServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/UnityOfMeasureServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,20 +20,21 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.UnitMeasure; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UnitMeasureEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.BadRequestException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.UnitMeasureRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.UnityOfMeasureService; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UnitMeasure; import java.util.List; import java.util.Optional; import java.util.UUID; import java.util.stream.Collectors; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UnitMeasureEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.BadRequestException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.UnitMeasureRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.UnityOfMeasureService; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/UserOperationsServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/UserOperationsServiceImpl.java similarity index 74% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/UserOperationsServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/UserOperationsServiceImpl.java index efe32e9c..2b6a9207 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/UserOperationsServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/UserOperationsServiceImpl.java @@ -1,7 +1,7 @@ /* * ****************************************************************************** * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,21 +19,22 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************* */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; + +import eclipse.tractusx.demandcapacitymgm.specification.model.UserRequest; +import eclipse.tractusx.demandcapacitymgm.specification.model.UserResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.UserEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.UserRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.UserOperationsService; +import org.springframework.stereotype.Service; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UserRequest; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.UserResponse; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.UUID; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UserEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.UserRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.UserOperationsService; -import org.springframework.stereotype.Service; @RequiredArgsConstructor @Service @@ -71,9 +72,8 @@ private UserResponse convertToDto(UserEntity entity) { user.setUserID(entity.getId().toString()); user.setEmail(entity.getEmail()); user.setName(entity.getName()); - eclipse.tractusx.demand_capacity_mgmt_specification.model.Role role = eclipse.tractusx.demand_capacity_mgmt_specification.model.Role.fromValue( - entity.getRole().name() - ); + eclipse.tractusx.demandcapacitymgm.specification.model.Role role = + eclipse.tractusx.demandcapacitymgm.specification.model.Role.fromValue(entity.getRole().name()); user.setRole(role); user.setUsername(entity.getUsername()); user.setCompanyID(String.valueOf(entity.getCompanyID())); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/WeekBasedCapacityGroupServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/WeekBasedCapacityGroupServiceImpl.java similarity index 57% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/WeekBasedCapacityGroupServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/WeekBasedCapacityGroupServiceImpl.java index c0f763b8..ca751a6e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/WeekBasedCapacityGroupServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/WeekBasedCapacityGroupServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,28 +20,29 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; -import java.util.List; -import java.util.Optional; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CapacityGroupEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedCapacityGroupEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.NotFoundException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.MaterialDemandRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.WeekBasedCapacityGroupRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LoggingHistoryService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedCapacityGroupService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.DataConverterUtil; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UUIDUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.CapacityGroupEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.MaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedCapacityGroupEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.NotFoundException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.MaterialDemandRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.WeekBasedCapacityGroupRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LoggingHistoryService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedCapacityGroupService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.DataConverterUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UUIDUtil; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + @RequiredArgsConstructor @Service @Slf4j @@ -58,16 +59,14 @@ public void createWeekBasedCapacityGroup( List weekBasedCapacityGroupRequestList, String userID ) { - weekBasedCapacityGroupRequestList.forEach( - weekBasedCapacityGroupRequest -> { - validateFields(weekBasedCapacityGroupRequest.getWeekBasedCapacityGroupRequest()); - WeekBasedCapacityGroupEntity weekBasedCapacityGroup = convertEntity( - weekBasedCapacityGroupRequest.getWeekBasedCapacityGroupRequest() - ); - postLogs(weekBasedCapacityGroup.getId().toString()); - weekBasedCapacityGroupRepository.save(weekBasedCapacityGroup); - } - ); + weekBasedCapacityGroupRequestList.forEach(weekBasedCapacityGroupRequest -> { + validateFields(weekBasedCapacityGroupRequest.getWeekBasedCapacityGroupRequest()); + WeekBasedCapacityGroupEntity weekBasedCapacityGroup = convertEntity( + weekBasedCapacityGroupRequest.getWeekBasedCapacityGroupRequest() + ); + postLogs(weekBasedCapacityGroup.getId().toString()); + weekBasedCapacityGroupRepository.save(weekBasedCapacityGroup); + }); } private void postLogs(String weekBasedCapacityGroupId) { @@ -83,48 +82,42 @@ private void postLogs(String weekBasedCapacityGroupId) { @Override public void receiveWeekBasedCapacityGroup() { try { - List weekBasedCapacityGroupEntities = weekBasedCapacityGroupRepository.getAllByViewed( - false - ); + List weekBasedCapacityGroupEntities = + weekBasedCapacityGroupRepository.getAllByViewed(false); - weekBasedCapacityGroupEntities.forEach( - weekBasedCapacityGroupEntity -> { - WeekBasedCapacityGroupRequest weekBasedCapacityGroup = weekBasedCapacityGroupEntity.getWeekBasedCapacityGroup(); + weekBasedCapacityGroupEntities.forEach(weekBasedCapacityGroupEntity -> { + WeekBasedCapacityGroupRequest weekBasedCapacityGroup = + weekBasedCapacityGroupEntity.getWeekBasedCapacityGroup(); - if (weekBasedCapacityGroup != null) { - List likedDemandSeriesList = weekBasedCapacityGroup.getLinkedDemandSeries(); + if (weekBasedCapacityGroup != null) { + List likedDemandSeriesList = + weekBasedCapacityGroup.getLinkedDemandSeries(); - if (likedDemandSeriesList != null) { - for (LinkedDemandSeriesRequest likedDemandSeries : likedDemandSeriesList) { - String materialNumberCustomer = likedDemandSeries.getMaterialNumberCustomer(); - String customerLocation = likedDemandSeries.getCustomerLocation(); - String demandCategoryCode = likedDemandSeries.getDemandCategory().getDemandCategory(); + if (likedDemandSeriesList != null) { + for (LinkedDemandSeriesRequest likedDemandSeries : likedDemandSeriesList) { + String materialNumberCustomer = likedDemandSeries.getMaterialNumberCustomer(); + String customerLocation = likedDemandSeries.getCustomerLocation(); + String demandCategoryCode = likedDemandSeries.getDemandCategory().getDemandCategory(); - List matchingDemands = materialDemandRepository.findAllByMaterialNumberCustomerAndDemandSeriesCustomerLocationAndDemandCategory( + List matchingDemands = + materialDemandRepository.findAllByMaterialNumberCustomerAndDemandSeriesCustomerLocationAndDemandCategory( materialNumberCustomer, customerLocation, demandCategoryCode ); - matchingDemands.forEach( - materialDemandEntity -> - materialDemandEntity - .getDemandSeries() - .forEach( - demandSeries -> { - demandSeries.setCapacityGroupId( - weekBasedCapacityGroup.getCapacityGroupId() - ); - } - ) - ); - - materialDemandRepository.saveAll(matchingDemands); - } - } - } - } - ); + matchingDemands.forEach(materialDemandEntity -> + materialDemandEntity + .getDemandSeries() + .forEach(demandSeries -> { + demandSeries.setCapacityGroupId(weekBasedCapacityGroup.getCapacityGroupId()); + })); + + materialDemandRepository.saveAll(matchingDemands); + } + } + } + }); // updateStatus(); TODO: remove the comment when the EDC is ready } catch (Exception e) { //Probably sql initialize error here. @@ -188,9 +181,8 @@ private WeekBasedCapacityGroupDtoResponse convertToWeekBasedCapacityGroupDto( @Override public WeekBasedCapacityGroupEntity findById(String capacityGroupId) { - Optional weekBasedCapacityGroupEntityOptional = weekBasedCapacityGroupRepository.findById( - Integer.getInteger(capacityGroupId) - ); + Optional weekBasedCapacityGroupEntityOptional = + weekBasedCapacityGroupRepository.findById(Integer.getInteger(capacityGroupId)); if (weekBasedCapacityGroupEntityOptional.isEmpty()) { throw new NotFoundException("4", "04"); @@ -206,8 +198,7 @@ private void validateFields(WeekBasedCapacityGroupRequest weekBasedCapacityGroup } private WeekBasedCapacityGroupEntity convertEntity(WeekBasedCapacityGroupRequest weekBasedCapacityGroupRequest) { - return WeekBasedCapacityGroupEntity - .builder() + return WeekBasedCapacityGroupEntity.builder() .id(UUID.randomUUID()) .weekBasedCapacityGroup(weekBasedCapacityGroupRequest) .viewed(false) diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/WeekBasedMaterialServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/WeekBasedMaterialServiceImpl.java similarity index 54% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/WeekBasedMaterialServiceImpl.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/WeekBasedMaterialServiceImpl.java index f56b6704..73718f2b 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/WeekBasedMaterialServiceImpl.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/services/impl/WeekBasedMaterialServiceImpl.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,26 +20,27 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; +package org.eclipse.tractusx.demandcapacitymgm.backend.services.impl; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; +import eclipse.tractusx.demandcapacitymgm.specification.model.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedMaterialDemandEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.type.BadRequestException; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.WeekBasedMaterialDemandRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LoggingHistoryService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedMaterialService; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.DataConverterUtil; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UUIDUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.MaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedMaterialDemandEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.exceptions.type.BadRequestException; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.WeekBasedMaterialDemandRepository; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.LoggingHistoryService; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.WeekBasedMaterialService; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.DataConverterUtil; +import org.eclipse.tractusx.demandcapacitymgm.backend.utils.UUIDUtil; import org.springframework.stereotype.Service; +import java.util.LinkedList; +import java.util.List; +import java.util.UUID; + @RequiredArgsConstructor @Service @Slf4j @@ -55,21 +56,21 @@ public void createWeekBasedMaterial( List weekBasedMaterialDemandRequestDtoList, String userID ) { - oldWeekBasedMaterialDemands = - DataConverterUtil.convertToWeekBasedMaterialDemandDtoList(weekBasedMaterialDemandRepository.findAll()); - weekBasedMaterialDemandRequestDtoList.forEach( - weekBasedMaterialDemandRequestDto -> { - validateFields(weekBasedMaterialDemandRequestDto); - - WeekBasedMaterialDemandEntity weekBasedMaterialDemand = convertEntity( - weekBasedMaterialDemandRequestDto.getWeekBasedMaterialDemandRequest() - ); - postLogs(weekBasedMaterialDemand.getId().toString()); - weekBasedMaterialDemandRepository.save(weekBasedMaterialDemand); - } + oldWeekBasedMaterialDemands = DataConverterUtil.convertToWeekBasedMaterialDemandDtoList( + weekBasedMaterialDemandRepository.findAll() + ); + weekBasedMaterialDemandRequestDtoList.forEach(weekBasedMaterialDemandRequestDto -> { + validateFields(weekBasedMaterialDemandRequestDto); + + WeekBasedMaterialDemandEntity weekBasedMaterialDemand = convertEntity( + weekBasedMaterialDemandRequestDto.getWeekBasedMaterialDemandRequest() + ); + postLogs(weekBasedMaterialDemand.getId().toString()); + weekBasedMaterialDemandRepository.save(weekBasedMaterialDemand); + }); + newWeekBasedMaterialDemands = DataConverterUtil.convertToWeekBasedMaterialDemandDtoList( + weekBasedMaterialDemandRepository.findAll() ); - newWeekBasedMaterialDemands = - DataConverterUtil.convertToWeekBasedMaterialDemandDtoList(weekBasedMaterialDemandRepository.findAll()); } private void postLogs(String weekBasedMaterialDemandId) { @@ -89,9 +90,8 @@ public void sendWeekBasedMaterial() {} @Override public void receiveWeekBasedMaterial() { - List weekBasedMaterialDemandEntities = weekBasedMaterialDemandRepository.getAllByViewed( - false - ); + List weekBasedMaterialDemandEntities = + weekBasedMaterialDemandRepository.getAllByViewed(false); } @Override @@ -121,15 +121,17 @@ public WeekBasedMaterialDemandResponseDto updateWeekBasedMaterial( WeekBasedMaterialDemandRequestDto weekBasedCapacityGroupRequest, String userID ) { - oldWeekBasedMaterialDemands = - DataConverterUtil.convertToWeekBasedMaterialDemandDtoList(weekBasedMaterialDemandRepository.findAll()); + oldWeekBasedMaterialDemands = DataConverterUtil.convertToWeekBasedMaterialDemandDtoList( + weekBasedMaterialDemandRepository.findAll() + ); WeekBasedMaterialDemandEntity weekBasedCapacityGroupEntity = convertWeekMaterialDemandToEntity( weekBasedCapacityGroupRequest ); weekBasedCapacityGroupEntity.setId(UUID.fromString(id)); weekBasedCapacityGroupEntity = weekBasedMaterialDemandRepository.save(weekBasedCapacityGroupEntity); - newWeekBasedMaterialDemands = - DataConverterUtil.convertToWeekBasedMaterialDemandDtoList(weekBasedMaterialDemandRepository.findAll()); + newWeekBasedMaterialDemands = DataConverterUtil.convertToWeekBasedMaterialDemandDtoList( + weekBasedMaterialDemandRepository.findAll() + ); return convertToWeekBasedCapacityGroupDto(weekBasedCapacityGroupEntity); } @@ -155,40 +157,34 @@ public void createWeekBasedMaterialRequestFromEntity(MaterialDemandEntity materi materialDemandEntity .getDemandSeries() - .forEach( - demandSeries -> { - DemandWeekSeriesDto demandWeekSeriesDto = new DemandWeekSeriesDto(); + .forEach(demandSeries -> { + DemandWeekSeriesDto demandWeekSeriesDto = new DemandWeekSeriesDto(); - demandWeekSeriesDto.setCustomerLocation(demandSeries.getCustomerLocation().getBpn()); - demandWeekSeriesDto.setExpectedSupplierLocation( - demandSeries.getExpectedSupplierLocation().toString() - ); + demandWeekSeriesDto.setCustomerLocation(demandSeries.getCustomerLocation().getBpn()); + demandWeekSeriesDto.setExpectedSupplierLocation(demandSeries.getExpectedSupplierLocation().toString()); - DemandSeriesCategoryDto demandSeriesCategoryDto = new DemandSeriesCategoryDto(); - demandSeriesCategoryDto.setId(demandSeries.getDemandCategory().getId().toString()); + DemandSeriesCategoryDto demandSeriesCategoryDto = new DemandSeriesCategoryDto(); + demandSeriesCategoryDto.setId(demandSeries.getDemandCategory().getId().toString()); - demandWeekSeriesDto.setDemandCategory(demandSeriesCategoryDto); + demandWeekSeriesDto.setDemandCategory(demandSeriesCategoryDto); - List demandSeriesDtos = demandSeries - .getDemandSeriesValues() - .stream() - .map( - demandSeriesValues -> { - DemandSeriesDto demandSeriesDto = new DemandSeriesDto(); + List demandSeriesDtos = demandSeries + .getDemandSeriesValues() + .stream() + .map(demandSeriesValues -> { + DemandSeriesDto demandSeriesDto = new DemandSeriesDto(); - demandSeriesDto.setCalendarWeek(demandSeriesValues.getCalendarWeek().toString()); - demandSeriesValues.setDemand(demandSeriesValues.getDemand()); + demandSeriesDto.setCalendarWeek(demandSeriesValues.getCalendarWeek().toString()); + demandSeriesValues.setDemand(demandSeriesValues.getDemand()); - return demandSeriesDto; - } - ) - .toList(); + return demandSeriesDto; + }) + .toList(); - demandWeekSeriesDto.setDemands(demandSeriesDtos); + demandWeekSeriesDto.setDemands(demandSeriesDtos); - demandWeekSeriesDtoList.add(demandWeekSeriesDto); - } - ); + demandWeekSeriesDtoList.add(demandWeekSeriesDto); + }); } private void validateFields(WeekBasedMaterialDemandRequestDto weekBasedMaterialDemandRequestDto) { @@ -203,25 +199,18 @@ private void validateFields(WeekBasedMaterialDemandRequestDto weekBasedMaterialD weekBasedMaterialDemandRequestDto .getWeekBasedMaterialDemandRequest() .getDemandSeries() - .forEach( - demandWeekSeriesDto -> - demandWeekSeriesDto - .getDemands() - .forEach( - demandSeriesDto -> { - if ( - Boolean.FALSE.equals(DataConverterUtil.itsMonday(demandSeriesDto.getCalendarWeek())) - ) { - throw new BadRequestException("1", "11"); - } - } - ) - ); + .forEach(demandWeekSeriesDto -> + demandWeekSeriesDto + .getDemands() + .forEach(demandSeriesDto -> { + if (Boolean.FALSE.equals(DataConverterUtil.itsMonday(demandSeriesDto.getCalendarWeek()))) { + throw new BadRequestException("1", "11"); + } + })); } private WeekBasedMaterialDemandEntity convertEntity(WeekBasedMaterialDemandRequest weekBasedMaterialDemandRequest) { - return WeekBasedMaterialDemandEntity - .builder() + return WeekBasedMaterialDemandEntity.builder() .id(UUID.randomUUID()) .weekBasedMaterialDemand(weekBasedMaterialDemandRequest) .viewed(false) diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/BottleneckDetectorUtil.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/BottleneckDetectorUtil.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/BottleneckDetectorUtil.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/BottleneckDetectorUtil.java index d13800b3..bf1e5581 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/BottleneckDetectorUtil.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/BottleneckDetectorUtil.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,9 +20,23 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils; +package org.eclipse.tractusx.demandcapacitymgm.backend.utils; + +import eclipse.tractusx.demandcapacitymgm.specification.model.*; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.tuple.Pair; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks.CategoryDeltaDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks.MonthReportDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks.WeekReportDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.bottlenecks.YearReportDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventObjectType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.EventType; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; +import org.eclipse.tractusx.demandcapacitymgm.backend.repositories.*; +import org.eclipse.tractusx.demandcapacitymgm.backend.services.BottleneckManager; +import org.springframework.stereotype.Component; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; import java.sql.Timestamp; import java.time.DayOfWeek; import java.time.LocalDate; @@ -31,19 +45,6 @@ import java.time.temporal.WeekFields; import java.util.*; import java.util.stream.Collectors; -import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.tuple.Pair; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks.CategoryDeltaDto; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks.MonthReportDto; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks.WeekReportDto; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.bottlenecks.YearReportDto; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.BottleneckManager; -import org.springframework.stereotype.Component; @RequiredArgsConstructor @Component @@ -65,18 +66,16 @@ public class BottleneckDetectorUtil implements BottleneckManager { public void calculateTodos(String userID) { userRepository .findById(UUID.fromString(userID)) - .ifPresent( - user -> { - List demands = fetchDemandsBasedOnRole(user, userID); + .ifPresent(user -> { + List demands = fetchDemandsBasedOnRole(user, userID); - StatusesEntity statusesEntity = statusesRepository - .findByUserID(UUID.fromString(userID)) - .orElseGet(() -> generateNewEntity(userID)); + StatusesEntity statusesEntity = statusesRepository + .findByUserID(UUID.fromString(userID)) + .orElseGet(() -> generateNewEntity(userID)); - statusesEntity.setTodosCount(demands.size()); - statusesRepository.save(statusesEntity); - } - ); + statusesEntity.setTodosCount(demands.size()); + statusesRepository.save(statusesEntity); + }); } private StatusesEntity generateNewEntity(String userID) { @@ -87,31 +86,26 @@ private List fetchDemandsBasedOnRole(UserEntity user, Stri List demands = new ArrayList<>(); if (user.getRole().equals(Role.CUSTOMER)) { - demands = - materialDemandRepository - .findAll() //TODO SUPPLIER AQUI findbysupplierID - .stream() - .filter( - d -> - d - .getDemandSeries() - .stream() - .allMatch( - series -> - series - .getDemandSeriesValues() - .stream() - .allMatch(value -> value.getDemand() == 0) - ) - ) - .collect(Collectors.toList()); + demands = materialDemandRepository + .findAll() //TODO SUPPLIER AQUI findbysupplierID + .stream() + .filter( + d -> + d + .getDemandSeries() + .stream() + .allMatch( + series -> + series.getDemandSeriesValues().stream().allMatch(value -> value.getDemand() == 0) + ) + ) + .collect(Collectors.toList()); } else if (user.getRole().equals(Role.SUPPLIER)) { - demands = - materialDemandRepository - .findAll() //TODO CUSTOMER AQUI findbycustomerID - .stream() - .filter(d -> d.getLinkStatus() == EventType.UN_LINKED) - .collect(Collectors.toList()); + demands = materialDemandRepository + .findAll() //TODO CUSTOMER AQUI findbycustomerID + .stream() + .filter(d -> d.getLinkStatus() == EventType.UN_LINKED) + .collect(Collectors.toList()); } return demands; } @@ -404,9 +398,8 @@ public YearReportResponse generateYearReport( for (int year = startDate.getYear(); year <= endDate.getYear(); year++) { YearReportDto yearReport = new YearReportDto(); CapacityGroupEntity cgs = capacityGroupRepository.findById(UUID.fromString(capacityGroupID)).get(); - List matchedEntities = matchedDemandsRepository.findByCapacityGroupID( - cgs.getId() - ); + List matchedEntities = + matchedDemandsRepository.findByCapacityGroupID(cgs.getId()); yearReport.setYear(year); yearReport.setCapacityGroupId(capacityGroupID); yearReport.setTotalWeeksCurrentYear(getWeeksInYear(year)); @@ -532,29 +525,25 @@ private List getDemandsForWeek( Optional materialDemandOpt = materialDemandRepository.findById( entity.getMaterialDemandID() ); - materialDemandOpt.ifPresent( - materialDemand -> { - for (DemandSeries demandSeries : materialDemand.getDemandSeries()) { - // Filter the demand series values based on the weekOfYear and year - List filteredValues = demandSeries - .getDemandSeriesValues() - .stream() - .filter( - dsv -> { - LocalDate demandDate = dsv.getCalendarWeek(); - return ( - demandDate.get(WeekFields.of(Locale.getDefault()).weekOfWeekBasedYear()) == - weekOfYear && - demandDate.getYear() == year - ); - } - ) - .toList(); - - weekDemandValues.addAll(filteredValues); - } + materialDemandOpt.ifPresent(materialDemand -> { + for (DemandSeries demandSeries : materialDemand.getDemandSeries()) { + // Filter the demand series values based on the weekOfYear and year + List filteredValues = demandSeries + .getDemandSeriesValues() + .stream() + .filter(dsv -> { + LocalDate demandDate = dsv.getCalendarWeek(); + return ( + demandDate.get(WeekFields.of(Locale.getDefault()).weekOfWeekBasedYear()) == + weekOfYear && + demandDate.getYear() == year + ); + }) + .toList(); + + weekDemandValues.addAll(filteredValues); } - ); + }); } return weekDemandValues; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/CorsConfig.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/CorsConfig.java similarity index 92% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/CorsConfig.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/CorsConfig.java index 655458da..1b769f0e 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/CorsConfig.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/CorsConfig.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils; +package org.eclipse.tractusx.demandcapacitymgm.backend.utils; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/DataConverterUtil.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/DataConverterUtil.java similarity index 88% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/DataConverterUtil.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/DataConverterUtil.java index 626514c9..b560878d 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/DataConverterUtil.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/DataConverterUtil.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,13 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils; +package org.eclipse.tractusx.demandcapacitymgm.backend.utils; + +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedCapacityGroupDtoResponse; +import eclipse.tractusx.demandcapacitymgm.specification.model.WeekBasedMaterialDemandResponseDto; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedCapacityGroupEntity; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.WeekBasedMaterialDemandEntity; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupDtoResponse; -import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandResponseDto; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; @@ -31,8 +34,6 @@ import java.time.temporal.ChronoField; import java.util.ArrayList; import java.util.List; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedCapacityGroupEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedMaterialDemandEntity; public class DataConverterUtil { @@ -60,8 +61,7 @@ public static Boolean checkDatesSequence(List dates) { LocalDateTime nextDateTime = dates.get(i + 1); if ( nextDateTime.getLong(ChronoField.ALIGNED_WEEK_OF_YEAR) != - currentDateTime.getLong(ChronoField.ALIGNED_WEEK_OF_YEAR) + - 1 + currentDateTime.getLong(ChronoField.ALIGNED_WEEK_OF_YEAR) + 1 ) { isSequentialWeeks = false; break; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/UUIDUtil.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/UUIDUtil.java similarity index 91% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/UUIDUtil.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/UUIDUtil.java index b670e0d5..07be7b58 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/UUIDUtil.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/UUIDUtil.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,7 +20,7 @@ * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils; +package org.eclipse.tractusx.demandcapacitymgm.backend.utils; import java.util.UUID; import java.util.regex.Pattern; diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/UserUtil.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/UserUtil.java similarity index 84% rename from demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/UserUtil.java rename to demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/UserUtil.java index 24f5bc40..242ed12f 100644 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/utils/UserUtil.java +++ b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgm/backend/utils/UserUtil.java @@ -1,7 +1,7 @@ /* * ******************************************************************************* * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -19,17 +19,16 @@ * SPDX-License-Identifier: Apache-2.0 * ******************************************************************************** */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils; +package org.eclipse.tractusx.demandcapacitymgm.backend.utils; import com.auth0.jwt.JWT; import com.auth0.jwt.interfaces.Claim; import com.auth0.jwt.interfaces.DecodedJWT; import com.fasterxml.uuid.Logger; import jakarta.servlet.http.HttpServletRequest; +import org.eclipse.tractusx.demandcapacitymgm.backend.entities.enums.Role; + import java.util.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.UserEntity; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.UserRepository; public class UserUtil { @@ -54,8 +53,7 @@ public static Role getUserRole(HttpServletRequest request) { try { DecodedJWT decodedJWT = JWT.decode(Objects.requireNonNull(getTokenFromHeader(request))); Claim rolesClaim = decodedJWT.getClaim("realm_access"); - Map realmAccessMap = Optional - .ofNullable(rolesClaim) + Map realmAccessMap = Optional.ofNullable(rolesClaim) .map(Claim::asMap) .orElse(Collections.emptyMap()); diff --git a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/AlertServiceImpl.java b/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/AlertServiceImpl.java deleted file mode 100644 index 269c2e5f..00000000 --- a/demand-capacity-mgmt-backend/src/main/java/org/eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/services/impl/AlertServiceImpl.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * ****************************************************************************** - * Copyright (c) 2023 BMW AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ******************************************************************************* - */ -package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl; - -import eclipse.tractusx.demand_capacity_mgmt_specification.model.*; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Objects; -import java.util.UUID; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.*; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.AlertThresholdType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.AlertsMonitoredObjects; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.EventObjectType; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.AlertsRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.TriggeredAlertsRepository; -import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.AlertService; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; - -@Lazy -@RequiredArgsConstructor -@Service -@Slf4j -public class AlertServiceImpl implements AlertService { - - private final AlertsRepository alertsRepository; - private final TriggeredAlertsRepository triggeredAlertsRepository; - - @Override - public AlertResponse configureAlert(AlertRequest alertRequest) { - AlertEntity alertEntity = convertDtoToEntity(alertRequest); - alertsRepository.save(alertEntity); - return convertAlertsResponseDto(alertEntity); - } - - @Override - public void triggerDemandAlertsIfNeeded( - String userID, - boolean isMaterialDemandChange, - double oldValue, - double newValue, - String materialDemandId - ) { - List alerts = alertsRepository.findAllByUserID(UUID.fromString(userID)); - alerts.forEach( - alertEntity -> { - TriggeredAlertEntity triggeredAlertEntity = new TriggeredAlertEntity(); - triggeredAlertEntity.setId(UUID.randomUUID()); - triggeredAlertEntity.setAlertName(alertEntity.getAlertName()); - triggeredAlertEntity.setType(alertEntity.getType()); - triggeredAlertEntity.setUserID(alertEntity.getUserID()); - triggeredAlertEntity.setMonitoredObjects(alertEntity.getMonitoredObjects()); - triggeredAlertEntity.setThreshold(alertEntity.getThreshold()); - LocalDateTime currentLocalDateTime = LocalDateTime.now(); - triggeredAlertEntity.setCreated(Timestamp.valueOf(currentLocalDateTime).toString()); - if (isGlobalAlert(isMaterialDemandChange, alertEntity)) { - if (alertEntity.getType().equals(AlertThresholdType.RELATIVE)) { - double threshold = alertEntity.getThreshold() / 100; - double demandDelta = threshold * oldValue; - if (threshold >= 0 && (newValue - oldValue >= demandDelta)) { - fillTriggeredAlert( - triggeredAlertEntity, - "Increased by ", - alertEntity.getThreshold(), - true, - alertEntity - ); - } else if ((threshold < 0 && (newValue - oldValue <= demandDelta))) { - fillTriggeredAlert( - triggeredAlertEntity, - "Decreased by ", - alertEntity.getThreshold(), - true, - alertEntity - ); - } - } else if (alertEntity.getType().equals(AlertThresholdType.ABSOLUTE)) { - double threshold = alertEntity.getThreshold(); - if (threshold >= 0 && (newValue - oldValue >= threshold)) { - fillTriggeredAlert(triggeredAlertEntity, "Increased by ", threshold, false, alertEntity); - } else if ((threshold < 0 && (newValue - oldValue <= threshold))) { - fillTriggeredAlert(triggeredAlertEntity, "Decreased by ", threshold, false, alertEntity); - } - } - } else if (alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.DEDICATED)) { - alertEntity - .getDedicatedAlerts() - .forEach( - dedicatedAlert -> { - if (Objects.equals(materialDemandId, dedicatedAlert.getObjectId().toString())) { - if (alertEntity.getType().equals(AlertThresholdType.ABSOLUTE)) { - double threshold = alertEntity.getThreshold(); - if (threshold >= 0 && (newValue - oldValue >= threshold)) { - fillTriggeredAlert( - triggeredAlertEntity, - "Increased by ", - threshold, - false, - alertEntity - ); - } else if ((threshold < 0 && (newValue - oldValue <= threshold))) { - fillTriggeredAlert( - triggeredAlertEntity, - "Decreased by ", - threshold, - false, - alertEntity - ); - } - } else { - double threshold = alertEntity.getThreshold() / 100; - double demandDelta = alertEntity.getThreshold() * oldValue; - if (threshold >= 0 && (newValue - oldValue >= demandDelta)) { - fillTriggeredAlert( - triggeredAlertEntity, - "Increased by ", - threshold, - true, - alertEntity - ); - } else if ((threshold < 0 && (newValue - oldValue <= demandDelta))) { - fillTriggeredAlert( - triggeredAlertEntity, - "Decreased by ", - threshold, - true, - alertEntity - ); - } - } - } - } - ); - } - } - ); - } - - private void fillTriggeredAlert( - TriggeredAlertEntity triggeredAlertEntity, - String message, - double threshold, - boolean isRelative, - AlertEntity alertEntity - ) { - triggeredAlertEntity.setDescription(message + threshold + (isRelative ? "%" : " units")); - alertEntity.setTriggeredTimes(alertEntity.getTriggeredTimes() + 1); - alertsRepository.save(alertEntity); - triggeredAlertsRepository.save(triggeredAlertEntity); - } - - private static boolean isGlobalAlert(boolean isMaterialDemandChange, AlertEntity alertEntity) { - return ( - alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.ALL_DEMANDS) || - ( - alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.ALL_CAPACITIES) && - !isMaterialDemandChange - ) || - alertEntity.getMonitoredObjects().equals(AlertsMonitoredObjects.ALL_OBJECTS) - ); - } - - @Override - public List getAlerts(String userID) { - List alerts = alertsRepository.findAll(); - - getAlertByUserId(userID, alerts); - return alerts.stream().map(this::convertAlertsResponseDto).toList(); - } - - private static void getTriggeredAlertByUserId(String userID, List alerts) { - alerts - .stream() - .filter( - alertEntity -> { - if (alertEntity.getUserID().toString().equals(userID)) { - alerts.add(alertEntity); - } - return false; - } - ); - } - - private static void getAlertByUserId(String userID, List alerts) { - alerts - .stream() - .filter( - alertEntity -> { - if (alertEntity.getUserID().toString().equals(userID)) { - alerts.add(alertEntity); - } - return false; - } - ); - } - - @Override - public List getTriggeredAlerts(String userID) { - List alerts = triggeredAlertsRepository.findAll(); - getTriggeredAlertByUserId(userID, alerts); - return alerts.stream().map(this::convertTriggeredAlertsResponseDto).toList(); - } - - @Override - public TriggeredAlertResponse postTriggeredAlerts(TriggeredAlertRequest triggeredAlertRequest) { - return null; - } - - private AlertResponse convertAlertsResponseDto(AlertEntity alertEntity) { - List dedicatedAlerts = alertEntity - .getDedicatedAlerts() - .stream() - .map(this::enrichDedicateAlertResponse) - .toList(); - - AlertResponse responseDto = new AlertResponse(); - responseDto.setType(alertEntity.getType().name()); - responseDto.setAlertId("" + alertEntity.getId()); - responseDto.setAlertName(alertEntity.getAlertName()); - responseDto.setCreated(alertEntity.getCreated()); - responseDto.setMonitoredObjects(alertEntity.getMonitoredObjects().name()); - responseDto.setThreshold(String.valueOf(alertEntity.getThreshold())); - responseDto.setUser(alertEntity.getUserID().toString()); - //responseDto.setTriggerTimes(alertEntity.getTriggeredTimes()); - responseDto.setDedicatedAlerts(dedicatedAlerts); - return responseDto; - } - - DedicatedAlert enrichDedicateAlertResponse(DedicatedAlertEntity alertEntity) { - DedicatedAlert dedicatedAlert = new DedicatedAlert(); - dedicatedAlert.setId(alertEntity.getId().toString()); - dedicatedAlert.setType(alertEntity.getType().toString()); - dedicatedAlert.setObjectId(alertEntity.getObjectId().toString()); - return dedicatedAlert; - } - - private TriggeredAlertResponse convertTriggeredAlertsResponseDto(TriggeredAlertEntity alertEntity) { - TriggeredAlertResponse responseDto = new TriggeredAlertResponse(); - responseDto.setType(alertEntity.getType().name()); - responseDto.setAlertId("" + alertEntity.getId()); - responseDto.setAlertName(alertEntity.getAlertName()); - responseDto.setCreated(alertEntity.getCreated()); - responseDto.setDescription(alertEntity.getDescription()); - responseDto.setMonitoredObjects(alertEntity.getMonitoredObjects().name()); - responseDto.setThreshold(String.valueOf(alertEntity.getThreshold())); - responseDto.setUser(alertEntity.getUserID().toString()); - return responseDto; - } - - DedicatedAlertEntity convertDedicatedAlertsDtoToEntity(DedicatedAlert dedicatedAlert) { - return DedicatedAlertEntity - .builder() - .id(UUID.randomUUID()) - .type(EventObjectType.valueOf(dedicatedAlert.getType())) - .objectId(UUID.fromString(dedicatedAlert.getObjectId())) - .build(); - } - - private AlertEntity convertDtoToEntity(AlertRequest alertRequest) { - List dedicatedAlertEntities = alertRequest - .getDedicatedAlerts() - .stream() - .map(this::convertDedicatedAlertsDtoToEntity) - .toList(); - LocalDateTime currentLocalDateTime = LocalDateTime.now(); - - return AlertEntity - .builder() - .id(UUID.randomUUID()) - .alertName(alertRequest.getAlertName()) - .created(Timestamp.valueOf(currentLocalDateTime).toString()) - .monitoredObjects(AlertsMonitoredObjects.valueOf(alertRequest.getMonitoredObjects())) - .threshold(Double.parseDouble(alertRequest.getThreshold().toString())) - .triggeredTimes(0) - .userID(UUID.fromString(alertRequest.getUser())) - .type(AlertThresholdType.valueOf(alertRequest.getType())) - .dedicatedAlerts(dedicatedAlertEntities) - .build(); - } -} diff --git a/demand-capacity-mgmt-specification/pom.xml b/demand-capacity-mgmt-specification/pom.xml index a44ec3c6..9f6b23b5 100644 --- a/demand-capacity-mgmt-specification/pom.xml +++ b/demand-capacity-mgmt-specification/pom.xml @@ -2,7 +2,7 @@