diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/DeliveryContractMapping.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/DeliveryContractMapping.java new file mode 100644 index 00000000..b37675ea --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/DeliveryContractMapping.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.common.edc.domain.model; + + import jakarta.persistence.Entity; + import lombok.ToString; + + @Entity + @ToString(callSuper = true) + public class DeliveryContractMapping extends ContractMapping { + } + \ No newline at end of file diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/DemandContractMapping.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/DemandContractMapping.java new file mode 100644 index 00000000..de51c2ae --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/DemandContractMapping.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.common.edc.domain.model; + + import jakarta.persistence.Entity; + import lombok.ToString; + + @Entity + @ToString(callSuper = true) + public class DemandContractMapping extends ContractMapping { + } + \ No newline at end of file diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/ProductionContractMapping.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/ProductionContractMapping.java new file mode 100644 index 00000000..3e721d57 --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/ProductionContractMapping.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.common.edc.domain.model; + + import jakarta.persistence.Entity; + import lombok.ToString; + + @Entity + @ToString(callSuper = true) + public class ProductionContractMapping extends ContractMapping { + } + \ No newline at end of file diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/SubmodelType.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/SubmodelType.java index 455aafa1..ffef3e69 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/SubmodelType.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/model/SubmodelType.java @@ -23,6 +23,9 @@ public enum SubmodelType { DTR("none", "none"), ITEM_STOCK("urn:samm:io.catenax.item_stock:2.0.0#ItemStock", "$value"), + PRODUCTION("urn:samm:io.catenax.planned_production_output:2.0.0#PlannedProductionOutput", "$value"), + DEMAND("urn:samm:io.catenax.short_term_material_demand:1.0.0#ShortTermMaterialDemand", "$value"), + DELIVERY("urn:samm:io.catenax.delivery_information:2.0.0#DeliveryInformation", "$value"), PART_TYPE_INFORMATION("urn:samm:io.catenax.part_type_information:1.0.0#PartTypeInformation", "$value"); public final String URN_SEMANTIC_ID; diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/DeliveryContractMappingRepository.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/DeliveryContractMappingRepository.java new file mode 100644 index 00000000..5f501a9a --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/DeliveryContractMappingRepository.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.common.edc.domain.repository; + + import org.eclipse.tractusx.puris.backend.common.edc.domain.model.ContractMapping; +import org.eclipse.tractusx.puris.backend.common.edc.domain.model.DeliveryContractMapping; +import org.springframework.stereotype.Repository; + + @Repository + public interface DeliveryContractMappingRepository extends GeneralContractMappingRepository { + + @Override + default Class getType() { + return DeliveryContractMapping.class; + } + } + \ No newline at end of file diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/DemandContractMappingRepository.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/DemandContractMappingRepository.java new file mode 100644 index 00000000..17889edf --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/DemandContractMappingRepository.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.common.edc.domain.repository; + + import org.eclipse.tractusx.puris.backend.common.edc.domain.model.ContractMapping; +import org.eclipse.tractusx.puris.backend.common.edc.domain.model.DemandContractMapping; +import org.springframework.stereotype.Repository; + + @Repository + public interface DemandContractMappingRepository extends GeneralContractMappingRepository { + + @Override + default Class getType() { + return DemandContractMapping.class; + } + } + \ No newline at end of file diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/ProductionContractMappingRepository.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/ProductionContractMappingRepository.java new file mode 100644 index 00000000..6254bf8c --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/domain/repository/ProductionContractMappingRepository.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.common.edc.domain.repository; + + import org.eclipse.tractusx.puris.backend.common.edc.domain.model.ContractMapping; +import org.eclipse.tractusx.puris.backend.common.edc.domain.model.ProductionContractMapping; +import org.springframework.stereotype.Repository; + + @Repository + public interface ProductionContractMappingRepository extends GeneralContractMappingRepository { + + @Override + default Class getType() { + return ProductionContractMapping.class; + } + } + \ No newline at end of file diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java index d398e10c..be5d0d15 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java @@ -61,8 +61,6 @@ public class EdcAdapterService { @Autowired private EdcContractMappingService edcContractMappingService; - private Pattern urnPattern = PatternStore.URN_OR_UUID_PATTERN; - private Pattern urlPattern = PatternStore.URL_PATTERN; public EdcAdapterService(ObjectMapper objectMapper) { @@ -130,7 +128,26 @@ public boolean registerAssetsInitially() { boolean assetRegistration; log.info("Registration of DTR Asset successful {}", (assetRegistration = registerDtrAsset())); result &= assetRegistration; - log.info("Registration of ItemStock 2.0.0 submodel successful {}", (assetRegistration = registerItemStockSubmodel())); + log.info("Registration of ItemStock 2.0.0 submodel successful {}", (assetRegistration = registerSubmodelAsset( + variablesService.getItemStockSubmodelApiAssetId(), + variablesService.getItemStockSubmodelEndpoint(), + SubmodelType.ITEM_STOCK.URN_SEMANTIC_ID + ))); + log.info("Registration of Planned Production 2.0.0 submodel successful {}", (assetRegistration = registerSubmodelAsset( + variablesService.getProductionSubmodelApiAssetId(), + variablesService.getProductionSubmodelEndpoint(), + SubmodelType.PRODUCTION.URN_SEMANTIC_ID + ))); + log.info("Registration of Short Term Material Demand 1.0.0 submodel successful {}", (assetRegistration = registerSubmodelAsset( + variablesService.getDemandSubmodelApiAssetId(), + variablesService.getDemandSubmodelEndpoint(), + SubmodelType.DEMAND.URN_SEMANTIC_ID + ))); + log.info("Registration of Delivery Information 2.0.0 submodel successful {}", (assetRegistration = registerSubmodelAsset( + variablesService.getDeliverySubmodelApiAssetId(), + variablesService.getDeliverySubmodelEndpoint(), + SubmodelType.DELIVERY.URN_SEMANTIC_ID + ))); result &= assetRegistration; log.info("Registration of PartTypeInformation 1.0.0 submodel successful {}", (assetRegistration = registerPartTypeInfoSubmodelAsset())); result &= assetRegistration; @@ -147,17 +164,19 @@ public boolean registerAssetsInitially() { */ public boolean createPolicyAndContractDefForPartner(Partner partner) { boolean result = createBpnlAndMembershipPolicyDefinitionForPartner(partner); - result &= createItemStockSubmodelContractDefinitionForPartner(partner); + result &= createSubmodelContractDefinitionForPartner(SubmodelType.ITEM_STOCK.URN_SEMANTIC_ID, variablesService.getItemStockSubmodelApiAssetId(), partner); + result &= createSubmodelContractDefinitionForPartner(SubmodelType.PRODUCTION.URN_SEMANTIC_ID, variablesService.getProductionSubmodelApiAssetId(), partner); + result &= createSubmodelContractDefinitionForPartner(SubmodelType.DEMAND.URN_SEMANTIC_ID, variablesService.getDemandSubmodelApiAssetId(), partner); + result &= createSubmodelContractDefinitionForPartner(SubmodelType.DELIVERY.URN_SEMANTIC_ID, variablesService.getDeliverySubmodelApiAssetId(), partner); result &= createDtrContractDefinitionForPartner(partner); - return createPartTypeInfoContractDefForPartner(partner) && result; - + return createSubmodelContractDefinitionForPartner(SubmodelType.PART_TYPE_INFORMATION.URN_SEMANTIC_ID, variablesService.getPartTypeSubmodelApiAssetId(), partner) && result; } - private boolean createItemStockSubmodelContractDefinitionForPartner(Partner partner) { - var body = edcRequestBodyBuilder.buildItemStockSubmodelContractDefinitionWithBpnRestrictedPolicy(partner); + private boolean createSubmodelContractDefinitionForPartner(String semanticId, String assetId, Partner partner) { + var body = edcRequestBodyBuilder.buildSubmodelContractDefinitionWithBpnRestrictedPolicy(assetId, partner); try (var response = sendPostRequest(body, List.of("v2", "contractdefinitions"))) { if (!response.isSuccessful()) { - log.warn("Contract definition registration failed for partner " + partner.getBpnl() + " and ItemStock Submodel"); + log.warn("Contract definition registration failed for partner " + partner.getBpnl() + " and {} Submodel", semanticId); if (response.body() != null) { log.warn("Response: \n" + response.body().string()); } @@ -165,7 +184,7 @@ private boolean createItemStockSubmodelContractDefinitionForPartner(Partner part } return true; } catch (Exception e) { - log.error("Contract definition registration failed for partner " + partner.getBpnl() + " and ItemStock Submodel"); + log.error("Contract definition registration failed for partner " + partner.getBpnl() + " and {} Submodel", semanticId); return false; } } @@ -184,22 +203,6 @@ private boolean createDtrContractDefinitionForPartner(Partner partner) { } } - private boolean createPartTypeInfoContractDefForPartner(Partner partner) { - var body = edcRequestBodyBuilder.buildPartTypeInfoContractDefinitionForPartner(partner); - try (var response = sendPostRequest(body, List.of("v2", "contractdefinitions"))) { - if (!response.isSuccessful()) { - log.warn("Contract definition registration failed for partner " + partner.getBpnl() + " and PartTypeInfo asset"); - return false; - } - log.info("Contract definition successful for PartTypeAsset and partner " + partner.getBpnl()); - return true; - } catch (Exception e) { - log.error("Contract definition registration failed for partner " + partner.getBpnl() + " and PartTypeInfo asset", e); - return false; - } - } - - /** * Registers a policy definition that evaluates to true in case all the following conditions apply: * 1. The BPNL of the requesting connector is equal to the BPNL of the partner @@ -283,11 +286,11 @@ private boolean registerPartTypeInfoSubmodelAsset() { } } - private boolean registerItemStockSubmodel() { - var body = edcRequestBodyBuilder.buildItemStockSubmodelRegistrationBody(); + private boolean registerSubmodelAsset(String assetId, String endpoint, String semanticId) { + var body = edcRequestBodyBuilder.buildSubmodelRegistrationBody(assetId, endpoint, semanticId); try (var response = sendPostRequest(body, List.of("v3", "assets"))) { if (!response.isSuccessful()) { - log.warn("ItemStock Submodel Asset registration failed"); + log.warn("{} Submodel Asset registration failed", semanticId); if (response.body() != null) { log.warn("Response: \n" + response.body().string()); } @@ -295,12 +298,11 @@ private boolean registerItemStockSubmodel() { } return true; } catch (Exception e) { - log.error("Failed to register ItemStock Submodel", e); + log.error("Failed to register {} Submodel", semanticId, e); return false; } } - /** * Retrieve the response to an unfiltered catalog request from the partner * with the given dspUrl @@ -489,7 +491,10 @@ private JsonNode getSubmodelFromPartner(MaterialPartnerRelation mpr, SubmodelTyp Partner partner = mpr.getPartner(); SubmodelData submodelData = switch (type) { case DTR -> throw new IllegalArgumentException("DTR not supported"); - case ITEM_STOCK -> fetchItemStockSubmodelData(mpr, direction); + case ITEM_STOCK -> fetchSubmodelDataByDirection(mpr, SubmodelType.ITEM_STOCK.URN_SEMANTIC_ID, direction); + case PRODUCTION -> fetchSubmodelDataByDirection(mpr, SubmodelType.PRODUCTION.URN_SEMANTIC_ID, direction); + case DEMAND -> fetchSubmodelDataByDirection(mpr, SubmodelType.DEMAND.URN_SEMANTIC_ID, direction); + case DELIVERY -> fetchSubmodelDataByDirection(mpr, SubmodelType.DELIVERY.URN_SEMANTIC_ID, direction); case PART_TYPE_INFORMATION -> fetchPartTypeSubmodelData(mpr); }; boolean failed = true; @@ -627,7 +632,7 @@ private boolean negotiateForPartnerDtr(Partner partner) { } } - private SubmodelData fetchItemStockSubmodelData(MaterialPartnerRelation mpr, DirectionCharacteristic direction) { + private SubmodelData fetchSubmodelDataByDirection(MaterialPartnerRelation mpr, String semanticId, DirectionCharacteristic direction) { String manufacturerPartId = switch (direction) { case INBOUND -> mpr.getMaterial().getOwnMaterialNumber(); case OUTBOUND -> mpr.getPartnerMaterialNumber(); @@ -636,7 +641,7 @@ private SubmodelData fetchItemStockSubmodelData(MaterialPartnerRelation mpr, Dir case INBOUND -> variablesService.getOwnBpnl(); case OUTBOUND -> mpr.getPartner().getBpnl(); }; - return fetchSubmodelData(mpr, "urn:samm:io.catenax.item_stock:2.0.0#ItemStock", manufacturerPartId, manufacturerId); + return fetchSubmodelData(mpr, semanticId, manufacturerPartId, manufacturerId); } private SubmodelData fetchPartTypeSubmodelData(MaterialPartnerRelation mpr) { @@ -789,7 +794,10 @@ private boolean negotiateForSubmodel(MaterialPartnerRelation mpr, SubmodelType t Partner partner = mpr.getPartner(); SubmodelData submodelData = switch (type) { case DTR -> throw new IllegalArgumentException("DTR not supported"); - case ITEM_STOCK -> fetchItemStockSubmodelData(mpr, direction); + case ITEM_STOCK -> fetchSubmodelDataByDirection(mpr, SubmodelType.ITEM_STOCK.URN_SEMANTIC_ID, direction); + case PRODUCTION -> fetchSubmodelDataByDirection(mpr, SubmodelType.PRODUCTION.URN_SEMANTIC_ID, direction); + case DEMAND -> fetchSubmodelDataByDirection(mpr, SubmodelType.DEMAND.URN_SEMANTIC_ID, direction); + case DELIVERY -> fetchSubmodelDataByDirection(mpr, SubmodelType.DELIVERY.URN_SEMANTIC_ID, direction); case PART_TYPE_INFORMATION -> fetchPartTypeSubmodelData(mpr); }; try { diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcContractMappingService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcContractMappingService.java index 5e4c3940..bd78d89d 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcContractMappingService.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcContractMappingService.java @@ -24,10 +24,13 @@ import org.eclipse.tractusx.puris.backend.common.edc.domain.model.ContractMapping; import org.eclipse.tractusx.puris.backend.common.edc.domain.model.DtrContractMapping; import org.eclipse.tractusx.puris.backend.common.edc.domain.model.SubmodelType; +import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.DeliveryContractMappingRepository; +import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.DemandContractMappingRepository; import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.DtrContractMappingRepository; import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.GeneralContractMappingRepository; import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.ItemStockContractMappingRepository; import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.PartTypeContractMappingRepository; +import org.eclipse.tractusx.puris.backend.common.edc.domain.repository.ProductionContractMappingRepository; import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Partner; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -44,6 +47,15 @@ public class EdcContractMappingService { @Autowired private ItemStockContractMappingRepository itemStockContractMappingRepository; + @Autowired + private ProductionContractMappingRepository productionContractMappingRepository; + + @Autowired + private DemandContractMappingRepository demandContractMappingRepository; + + @Autowired + private DeliveryContractMappingRepository deliveryContractMappingRepository; + @Autowired private PartTypeContractMappingRepository partTypeContractMappingRepository; @@ -104,6 +116,9 @@ private GeneralContractMappingRepository getContractM GeneralContractMappingRepository repository = switch (type) { case DTR -> dtrContractMappingRepository; case ITEM_STOCK -> itemStockContractMappingRepository; + case PRODUCTION -> productionContractMappingRepository; + case DEMAND -> demandContractMappingRepository; + case DELIVERY -> deliveryContractMappingRepository; case PART_TYPE_INFORMATION -> partTypeContractMappingRepository; }; return repository; diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/EdcRequestBodyBuilder.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/EdcRequestBodyBuilder.java index 30846e60..b516d6b6 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/EdcRequestBodyBuilder.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/EdcRequestBodyBuilder.java @@ -24,7 +24,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; + import lombok.extern.slf4j.Slf4j; + import org.eclipse.tractusx.puris.backend.common.util.VariablesService; import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Partner; import org.springframework.beans.factory.annotation.Autowired; @@ -173,9 +175,9 @@ public JsonNode buildFrameworkPolicy() { return body; } - public JsonNode buildItemStockSubmodelContractDefinitionWithBpnRestrictedPolicy(Partner partner) { + public JsonNode buildSubmodelContractDefinitionWithBpnRestrictedPolicy(String assetId, Partner partner) { var body = getEdcContextObject(); - body.put("@id", partner.getBpnl() + "_contractdefinition_for_" + getItemStockSubmodelAssetId()); + body.put("@id", partner.getBpnl() + "_contractdefinition_for_" + assetId); body.put("accessPolicyId", getBpnPolicyId(partner)); body.put("contractPolicyId", CONTRACT_POLICY_ID); var assetsSelector = MAPPER.createObjectNode(); @@ -183,7 +185,7 @@ public JsonNode buildItemStockSubmodelContractDefinitionWithBpnRestrictedPolicy( assetsSelector.put("@type", "CriterionDto"); assetsSelector.put("operandLeft", EDC_NAMESPACE + "id"); assetsSelector.put("operator", "="); - assetsSelector.put("operandRight", getItemStockSubmodelAssetId()); + assetsSelector.put("operandRight", assetId); return body; } @@ -339,28 +341,27 @@ public JsonNode buildDtrRegistrationBody() { return body; } - public JsonNode buildItemStockSubmodelRegistrationBody() { + public JsonNode buildSubmodelRegistrationBody(String assetId, String endpoint, String semanticId) { var body = getAssetRegistrationContext(); - body.put("@id", getItemStockSubmodelAssetId()); + body.put("@id", assetId); var propertiesObject = MAPPER.createObjectNode(); body.set("properties", propertiesObject); var dctTypeObject = MAPPER.createObjectNode(); propertiesObject.set("dct:type", dctTypeObject); dctTypeObject.put("@id", "cx-taxo:Submodel"); propertiesObject.put("cx-common:version", "3.0"); - var semanticId = MAPPER.createObjectNode(); - propertiesObject.set("aas-semantics:semanticId", semanticId); - semanticId.put("@id", "urn:samm:io.catenax.item_stock:2.0.0#ItemStock"); + var semanticIdObject = MAPPER.createObjectNode(); + propertiesObject.set("aas-semantics:semanticId", semanticIdObject); + semanticIdObject.put("@id", semanticId); body.set("privateProperties", MAPPER.createObjectNode()); - String url = variablesService.getItemStockSubmodelEndpoint(); var dataAddress = MAPPER.createObjectNode(); dataAddress.put("@type", "DataAddress"); dataAddress.put("proxyPath", "true"); dataAddress.put("proxyQueryParams", "false"); dataAddress.put("proxyMethod", "false"); dataAddress.put("type", "HttpData"); - dataAddress.put("baseUrl", url); + dataAddress.put("baseUrl", endpoint); dataAddress.put("authKey", "x-api-key"); dataAddress.put("authCode", variablesService.getApiKey()); body.set("dataAddress", dataAddress); @@ -397,10 +398,6 @@ public JsonNode buildPartTypeInfoSubmodelRegistrationBody() { return body; } - private String getItemStockSubmodelAssetId() { - return variablesService.getItemStockSubmodelApiAssetId(); - } - private String getDtrAssetId() { return "DigitalTwinRegistryId@" + variablesService.getOwnBpnl(); } diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java index 2c9ec2f7..7fbb25e7 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java @@ -77,6 +77,48 @@ public class VariablesService { */ private String itemStockSubmodelAssetId; + @Value("${puris.baseurl}" + "catena/planned-production/request") + /** + * The url under which this application's request endpoint can + * be reached by external machines. + */ + private String productionSubmodelEndpoint; + + @Value("${puris.productionsubmodel.apiassetid}") + /** + * The assetId that shall be assigned to the request API + * during asset creation. + */ + private String productionSubmodelAssetId; + + @Value("${puris.baseurl}" + "catena/material-demand/request") + /** + * The url under which this application's request endpoint can + * be reached by external machines. + */ + private String demandSubmodelEndpoint; + + @Value("${puris.demandsubmodel.apiassetid}") + /** + * The assetId that shall be assigned to the request API + * during asset creation. + */ + private String demandSubmodelAssetId; + + @Value("${puris.baseurl}" + "catena/delivery-information/request") + /** + * The url under which this application's request endpoint can + * be reached by external machines. + */ + private String deliverySubmodelEndpoint; + + @Value("${puris.deliverysubmodel.apiassetid}") + /** + * The assetId that shall be assigned to the request API + * during asset creation. + */ + private String deliverySubmodelAssetId; + @Value("${puris.frameworkagreement.credential}") /** * The name of the framework agreement to be used. @@ -184,8 +226,19 @@ public String getItemStockSubmodelApiAssetId() { return itemStockSubmodelAssetId + "@" + ownBpnl; } + public String getProductionSubmodelApiAssetId() { + return productionSubmodelAssetId + "@" + ownBpnl; + } + + public String getDemandSubmodelApiAssetId() { + return demandSubmodelAssetId + "@" + ownBpnl; + } + + public String getDeliverySubmodelApiAssetId() { + return deliverySubmodelAssetId + "@" + ownBpnl; + } + public String getPartTypeSubmodelApiAssetId() { return "PartTypeInformationSubmodelApi@" + getOwnBpnl(); } - } diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/AllocatedPlannedProductionOutput.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/AllocatedPlannedProductionOutput.java new file mode 100644 index 00000000..5a3eb114 --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/AllocatedPlannedProductionOutput.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.production.logic.dto.plannedproductionsamm; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +import java.util.Date; +import java.util.Objects; + +import org.eclipse.tractusx.puris.backend.common.util.PatternStore; +import org.eclipse.tractusx.puris.backend.common.domain.model.measurement.ItemQuantityEntity; + +/** + * Generated class for Planned and Allocated Production Output. Quantity, site + * of the supplier and date with time at which a production of a certain + * material for a certain customer is planned to be finished. + */ + +@Getter +@Setter +@NoArgsConstructor +@ToString +public class AllocatedPlannedProductionOutput { + + @NotNull + @Valid + private ItemQuantityEntity plannedProductionQuantity; + + @NotNull + @Pattern(regexp = PatternStore.BPNS_STRING) + private String productionSiteBpns; + + @NotNull + private Date estimatedTimeOfCompletion; + + @JsonCreator + public AllocatedPlannedProductionOutput( + @JsonProperty(value = "plannedProductionQuantity") ItemQuantityEntity plannedProductionQuantity, + @JsonProperty(value = "productionSiteBpns") String productionSiteBpns, + @JsonProperty(value = "estimatedTimeOfCompletion") Date estimatedTimeOfCompletion) { + super(); + this.plannedProductionQuantity = plannedProductionQuantity; + this.productionSiteBpns = productionSiteBpns; + this.estimatedTimeOfCompletion = estimatedTimeOfCompletion; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + final AllocatedPlannedProductionOutput that = (AllocatedPlannedProductionOutput) o; + return Objects.equals(plannedProductionQuantity, that.plannedProductionQuantity) + && Objects.equals(productionSiteBpns, that.productionSiteBpns) + && Objects.equals(estimatedTimeOfCompletion, that.estimatedTimeOfCompletion); + } + + @Override + public int hashCode() { + return Objects.hash(plannedProductionQuantity, productionSiteBpns, estimatedTimeOfCompletion); + } +} diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/OrderPositionReference.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/OrderPositionReference.java new file mode 100644 index 00000000..dc2ba32d --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/OrderPositionReference.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.production.logic.dto.plannedproductionsamm; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.Objects; + +import org.eclipse.tractusx.puris.backend.common.util.PatternStore; + +/** + * Generated class for Reference to Order Position. Encapsulates the references + * to identify a position within an order. + */ + +@Getter +@Setter +@ToString +public class OrderPositionReference { + + @Pattern(regexp = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_STRING) + private String supplierOrderId; + + @NotNull + @Pattern(regexp = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_STRING) + private String customerOrderId; + + @NotNull + @Pattern(regexp = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_STRING) + private String customerOrderPositionId; + + @JsonCreator + public OrderPositionReference(@JsonProperty(value = "supplierOrderId") String supplierOrderId, + @JsonProperty(value = "customerOrderId") String customerOrderId, + @JsonProperty(value = "customerOrderPositionId") String customerOrderPositionId) { + super(); + this.supplierOrderId = supplierOrderId; + this.customerOrderId = customerOrderId; + this.customerOrderPositionId = customerOrderPositionId; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + final OrderPositionReference that = (OrderPositionReference) o; + return Objects.equals(supplierOrderId, that.supplierOrderId) + && Objects.equals(customerOrderId, that.customerOrderId) + && Objects.equals(customerOrderPositionId, that.customerOrderPositionId); + } + + @Override + public int hashCode() { + return Objects.hash(supplierOrderId, customerOrderId, customerOrderPositionId); + } +} diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/PlannedProductionOutput.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/PlannedProductionOutput.java new file mode 100644 index 00000000..9367c060 --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/PlannedProductionOutput.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.production.logic.dto.plannedproductionsamm; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import org.eclipse.tractusx.puris.backend.common.util.PatternStore; + +import java.util.HashSet; +import java.util.Objects; + +/** + * Generated class for Planned Production Output of a Supplier. This aspect + * represents the remaining and planned production outputs of a supplier + * allocated to a customer. An allocated planned production output is described + * by a quantity, the site of the supplier and the date with time at which a + * production of a certain material for a certain customer is planned to be + * finished. The allocated planned production outputs may be linked to customer + * order position they have been scheduled for. + */ +@Getter +@Setter +@NoArgsConstructor +@ToString +public class PlannedProductionOutput { + + @NotNull + @Valid + private HashSet positions; + + @Pattern(regexp = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_STRING) + private String materialNumberCustomer; + + @NotNull + @Pattern(regexp = PatternStore.URN_OR_UUID_STRING) + private String materialGlobalAssetId; + + @Pattern(regexp = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_STRING) + private String materialNumberSupplier; + + @JsonCreator + public PlannedProductionOutput(@JsonProperty(value = "positions") HashSet positions, + @JsonProperty(value = "materialNumberCustomer") String materialNumberCustomer, + @JsonProperty(value = "materialGlobalAssetId") String materialGlobalAssetId, + @JsonProperty(value = "materialNumberSupplier") String materialNumberSupplier) { + super(); + this.positions = positions; + this.materialNumberCustomer = materialNumberCustomer; + this.materialGlobalAssetId = materialGlobalAssetId; + this.materialNumberSupplier = materialNumberSupplier; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + final PlannedProductionOutput that = (PlannedProductionOutput) o; + return Objects.equals(positions, that.positions) + && Objects.equals(materialNumberCustomer, that.materialNumberCustomer) + && Objects.equals(materialGlobalAssetId, that.materialGlobalAssetId) + && Objects.equals(materialNumberSupplier, that.materialNumberSupplier); + } + + @Override + public int hashCode() { + return Objects.hash(positions, materialNumberCustomer, materialGlobalAssetId, materialNumberSupplier); + } +} diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/Position.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/Position.java new file mode 100644 index 00000000..9ba7fa5e --- /dev/null +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/production/logic/dto/plannedproductionsamm/Position.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Volkswagen AG + * Copyright (c) 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.puris.backend.production.logic.dto.plannedproductionsamm; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +import java.util.Date; +import java.util.HashSet; +import java.util.Objects; + +/** + * Generated class for Position. The Position can be planned for production at + * several sites. A position may be anonymous or may reference a position within + * an order. + */ + +@Getter +@Setter +@NoArgsConstructor +@ToString +public class Position { + @Valid + private OrderPositionReference orderPositionReference; + + @NotNull + private Date lastUpdatedOnDateTime; + + @NotNull + @Valid + private HashSet allocatedPlannedProductionOutputs; + + @JsonCreator + public Position( + @JsonProperty(value = "orderPositionReference") OrderPositionReference orderPositionReference, + @JsonProperty(value = "lastUpdatedOnDateTime") Date lastUpdatedOnDateTime, + @JsonProperty(value = "allocatedPlannedProductionOutputs") HashSet allocatedPlannedProductionOutputs) { + super(); + this.orderPositionReference = orderPositionReference; + this.lastUpdatedOnDateTime = lastUpdatedOnDateTime; + this.allocatedPlannedProductionOutputs = allocatedPlannedProductionOutputs; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + final Position that = (Position) o; + return Objects.equals(orderPositionReference, that.orderPositionReference) + && Objects.equals(lastUpdatedOnDateTime, that.lastUpdatedOnDateTime) + && Objects.equals(allocatedPlannedProductionOutputs, that.allocatedPlannedProductionOutputs); + } + + @Override + public int hashCode() { + return Objects.hash(orderPositionReference, lastUpdatedOnDateTime, allocatedPlannedProductionOutputs); + } +} diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index c3078ec5..afec35e0 100755 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -7,6 +7,9 @@ puris.baseurl=${PURIS_BASEURL:http://customer-backend:8081/} puris.demonstrator.role=${PURIS_DEMONSTRATOR_ROLE:customer} puris.edr.deletiontimer=${PURIS_EDR_DELETIONTIMER:2} puris.itemstocksubmodel.apiassetid=${PURIS_ITEMSTOCKSUBMODEL_APIASSETID:itemstocksubmodel-api-asset} +puris.productionsubmodel.apiassetid=${PURIS_PRODUCTIONSUBMODEL_APIASSETID:productionsubmodel-api-asset} +puris.demandsubmodel.apiassetid=${PURIS_DEMANDSUBMODEL_APIASSETID:demandsubmodel-api-asset} +puris.deliverysubmodel.apiassetid=${PURIS_DELIVERYSUBMODEL_APIASSETID:deliverysubmodel-api-asset} puris.frameworkagreement.use=${PURIS_FRAMEWORKAGREEMENT_USE:false} puris.frameworkagreement.credential=${PURIS_FRAMEWORKAGREEMENT_CREDENTIAL:FrameworkAgreement.traceability} puris.api.key=${PURIS_API_KEY:test} diff --git a/backend/src/test/resources/application.properties b/backend/src/test/resources/application.properties index 1e3d3ae9..91252480 100755 --- a/backend/src/test/resources/application.properties +++ b/backend/src/test/resources/application.properties @@ -4,6 +4,9 @@ puris.demonstrator.role=${PURIS_DEMONSTRATOR_ROLE:customer} puris.baseurl=${PURIS_BASEURL:http://customer-backend:8081/} puris.edr.deletiontimer=${PURIS_EDR_DELETIONTIMER:2} puris.itemstocksubmodel.apiassetid=${PURIS_ITEMSTOCKSUBMODEL_APIASSETID:itemstocksubmodel-api-asset} +puris.productionsubmodel.apiassetid=${PURIS_PRODUCTIONSUBMODEL_APIASSETID:productionsubmodel-api-asset} +puris.demandsubmodel.apiassetid=${PURIS_DEMANDSUBMODEL_APIASSETID:demandsubmodel-api-asset} +puris.deliverysubmodel.apiassetid=${PURIS_DELIVERYSUBMODEL_APIASSETID:deliverysubmodel-api-asset} puris.frameworkagreement.use=${PURIS_FRAMEWORKAGREEMENT_USE:false} puris.frameworkagreement.credential=${PURIS_FRAMEWORKAGREEMENT_CREDENTIAL:FrameworkAgreement.traceability} puris.api.key=${PURIS_API_KEY:test} diff --git a/charts/puris/Chart.yaml b/charts/puris/Chart.yaml index ae902c75..a6ada138 100644 --- a/charts/puris/Chart.yaml +++ b/charts/puris/Chart.yaml @@ -35,7 +35,7 @@ dependencies: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.0 +version: 2.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/puris/templates/backend-deployment.yaml b/charts/puris/templates/backend-deployment.yaml index 57d93214..4fe0bfb2 100644 --- a/charts/puris/templates/backend-deployment.yaml +++ b/charts/puris/templates/backend-deployment.yaml @@ -139,6 +139,12 @@ spec: value: "{{ .Values.backend.puris.edr.deletiontimer }}" - name: PURIS_ITEMSTOCKSUBMODEL_APIASSETID value: "{{ .Values.backend.puris.itemstocksubmodel.apiassetid }}" + - name: PURIS_PRODUCTIONSUBMODEL_APIASSETID + value: "{{ .Values.backend.puris.productionsubmodel.apiassetid }}" + - name: PURIS_DEMANDSUBMODEL_APIASSETID + value: "{{ .Values.backend.puris.demandsubmodel.apiassetid }}" + - name: PURIS_DELIVERYSUBMODEL_APIASSETID + value: "{{ .Values.backend.puris.deliverysubmodel.apiassetid }}" - name: PURIS_FRAMEWORKAGREEMENT_USE value: "{{ .Values.backend.puris.frameworkagreement.use }}" - name: PURIS_FRAMEWORKAGREEMENT_CREDENTIAL diff --git a/charts/puris/values.yaml b/charts/puris/values.yaml index d69ffc0b..0785491f 100644 --- a/charts/puris/values.yaml +++ b/charts/puris/values.yaml @@ -414,6 +414,15 @@ backend: itemstocksubmodel: # -- Asset ID for ItemStockSubmodel API apiassetid: itemstocksubmodel-api-asset + productionsubmodel: + # -- Asset ID for ProductionSubmodel API + apiassetid: productionsubmodel-api-asset + demandsubmodel: + # -- Asset ID for DemandSubmodel API + apiassetid: demandsubmodel-api-asset + deliverysubmodel: + # -- Asset ID for DeliverySubmodel API + apiassetid: deliverysubmodel-api-asset frameworkagreement: # -- The name of the framework agreement credential: FrameworkAgreement.traceability diff --git a/local/tractus-x-edc/config/customer/puris-backend.properties b/local/tractus-x-edc/config/customer/puris-backend.properties index 2f02a1f6..8ed2802c 100644 --- a/local/tractus-x-edc/config/customer/puris-backend.properties +++ b/local/tractus-x-edc/config/customer/puris-backend.properties @@ -1,8 +1,12 @@ server.port=8081 +server.error.include-message=always puris.demonstrator.role=customer puris.baseurl=http://customer-backend:8081/ puris.edr.deletiontimer=2 puris.itemstocksubmodel.apiassetid=itemstocksubmodel-api-asset +puris.productionsubmodel.apiassetid=productionsubmodel-api-asset +puris.demandsubmodel.apiassetid=demandsubmodel-api-asset +puris.deliverysubmodel.apiassetid=deliverysubmodel-api-asset puris.frameworkagreement.credential=FrameworkAgreement.traceability puris.api.key=${CUSTOMER_BACKEND_API_KEY} puris.dtr.url=http://dtr-customer:4243 diff --git a/local/tractus-x-edc/config/supplier/puris-backend.properties b/local/tractus-x-edc/config/supplier/puris-backend.properties index ce930e5b..4c704874 100644 --- a/local/tractus-x-edc/config/supplier/puris-backend.properties +++ b/local/tractus-x-edc/config/supplier/puris-backend.properties @@ -1,8 +1,12 @@ server.port=8082 +server.error.include-message=always puris.demonstrator.role=supplier puris.baseurl=http://supplier-backend:8082/ puris.edr.deletiontimer=2 puris.itemstocksubmodel.apiassetid=itemstocksubmodel-api-asset +puris.productionsubmodel.apiassetid=productionsubmodel-api-asset +puris.demandsubmodel.apiassetid=demandsubmodel-api-asset +puris.deliverysubmodel.apiassetid=deliverysubmodel-api-asset puris.frameworkagreement.credential=FrameworkAgreement.traceability puris.api.key=${SUPPLIER_BACKEND_API_KEY} puris.dtr.url=http://dtr-supplier:4243