Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update notification #20

Open
wants to merge 21 commits into
base: feat/update-notification
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
64343bc
feat: implemented edc data exchange for DemandAndCapacityNotification
ReneSchroederLJ Jun 13, 2024
cc6fb9c
fix: typo in chart and removed unusued parameter
ReneSchroederLJ Jun 13, 2024
662a4f6
feat: removed submodel logic from DemandAndCapacityNotification
ReneSchroederLJ Jun 17, 2024
05453dc
chore: update application properties and helm docs
ReneSchroederLJ Jun 17, 2024
3048073
chore: improved naming and formatting
ReneSchroederLJ Jun 18, 2024
72755f6
Merge branch 'main' into feat/demand-and-capacity-notification-edc-in…
ReneSchroederLJ Jun 18, 2024
29b644a
fix: outdated constant reference
ReneSchroederLJ Jun 18, 2024
56657ce
add(updating-notification)
Jun 18, 2024
10431fd
add(content-changed): added content change property
Jun 18, 2024
84ceb5c
feat: updated notification endpoint to use context path and removed s…
ReneSchroederLJ Jun 19, 2024
a189058
Merge branch 'main' into feat/demand-and-capacity-notification-edc-in…
ReneSchroederLJ Jun 19, 2024
2a94071
add(demandnotification): added hover buttons and change property
Jun 19, 2024
b10aca3
Merge remote-tracking branch 'origin/feat/demand-and-capacity-notific…
Jun 19, 2024
0cf31b1
add(notification-react)
Jun 20, 2024
63a1be3
fix(partners): return partners without your own
Jun 20, 2024
9dda493
fix(related notification): fixed related notificaiton id
Jun 20, 2024
ca68dca
fix(package.json): added optionalDependecis to solve the error with r…
Jun 20, 2024
5b58c8c
fix(notifications): refacture
Jun 20, 2024
d87d474
fix(package-lock)
Jun 20, 2024
474ee23
fix(date-helper)
Jun 20, 2024
b8d07b5
fix(useffect)
Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.puris.backend.common.edc.domain.model.SubmodelType;
import org.eclipse.tractusx.puris.backend.common.edc.domain.model.AssetType;
import org.eclipse.tractusx.puris.backend.common.util.VariablesService;
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Material;
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.MaterialPartnerRelation;
Expand Down Expand Up @@ -95,9 +95,9 @@ public JsonNode createMaterialRegistrationRequestBody(MaterialPartnerRelation ma
href = href.endsWith("/") ? href : href + "/";
href += materialPartnerRelation.getPartnerCXNumber() + "/";

submodelDescriptorsArray.add(createSubmodelObject(SubmodelType.ITEM_STOCK.URN_SEMANTIC_ID, href + DirectionCharacteristic.INBOUND + "/", variablesService.getItemStockSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(SubmodelType.DEMAND.URN_SEMANTIC_ID, href, variablesService.getDemandSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(SubmodelType.DELIVERY.URN_SEMANTIC_ID, href, variablesService.getDeliverySubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(AssetType.ITEM_STOCK_SUBMODEL.URN_SEMANTIC_ID, href + DirectionCharacteristic.INBOUND + "/", variablesService.getItemStockSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(AssetType.DEMAND_SUBMODEL.URN_SEMANTIC_ID, href, variablesService.getDemandSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(AssetType.DELIVERY_SUBMODEL.URN_SEMANTIC_ID, href, variablesService.getDeliverySubmodelApiAssetId()));

log.debug("Created body for material " + material.getOwnMaterialNumber() + "\n" + body.toPrettyString());
return body;
Expand Down Expand Up @@ -142,9 +142,9 @@ public JsonNode createProductRegistrationRequestBody(Material material, String p
href = href.endsWith("/") ? href : href + "/";
href += material.getMaterialNumberCx() + "/";

submodelDescriptorsArray.add(createSubmodelObject(SubmodelType.ITEM_STOCK.URN_SEMANTIC_ID, href + DirectionCharacteristic.OUTBOUND + "/", variablesService.getItemStockSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(SubmodelType.PRODUCTION.URN_SEMANTIC_ID, href, variablesService.getProductionSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(SubmodelType.DELIVERY.URN_SEMANTIC_ID, href, variablesService.getDeliverySubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(AssetType.ITEM_STOCK_SUBMODEL.URN_SEMANTIC_ID, href + DirectionCharacteristic.OUTBOUND + "/", variablesService.getItemStockSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(AssetType.PRODUCTION_SUBMODEL.URN_SEMANTIC_ID, href, variablesService.getProductionSubmodelApiAssetId()));
submodelDescriptorsArray.add(createSubmodelObject(AssetType.DELIVERY_SUBMODEL.URN_SEMANTIC_ID, href, variablesService.getDeliverySubmodelApiAssetId()));
submodelDescriptorsArray.add(createPartTypeSubmodelObject(material.getOwnMaterialNumber()));

log.debug("Created body for product " + material.getOwnMaterialNumber() + "\n" + body.toPrettyString());
Expand Down Expand Up @@ -238,7 +238,7 @@ private JsonNode createPartTypeSubmodelObject(String materialId) {
String href = variablesService.getEdcDataplanePublicUrl();
href = href.endsWith("/") ? href : href + "/";
href += Base64.getEncoder().encodeToString(materialId.getBytes(StandardCharsets.UTF_8));
return createSubmodelObject(SubmodelType.PART_TYPE_INFORMATION.URN_SEMANTIC_ID, href, variablesService.getPartTypeSubmodelApiAssetId());
return createSubmodelObject(AssetType.PART_TYPE_INFORMATION_SUBMODEL.URN_SEMANTIC_ID, href, variablesService.getPartTypeSubmodelApiAssetId());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@

package org.eclipse.tractusx.puris.backend.common.edc.domain.model;

public enum SubmodelType {
public enum AssetType {
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");
ITEM_STOCK_SUBMODEL("urn:samm:io.catenax.item_stock:2.0.0#ItemStock", "$value"),
PRODUCTION_SUBMODEL("urn:samm:io.catenax.planned_production_output:2.0.0#PlannedProductionOutput", "$value"),
DEMAND_SUBMODEL("urn:samm:io.catenax.short_term_material_demand:1.0.0#ShortTermMaterialDemand", "$value"),
DELIVERY_SUBMODEL("urn:samm:io.catenax.delivery_information:2.0.0#DeliveryInformation", "$value"),
NOTIFICATION("urn:samm:io.catenax.demand_and_capacity_notification:2.0.0#DemandAndCapacityNotification", "none"),
PART_TYPE_INFORMATION_SUBMODEL("urn:samm:io.catenax.part_type_information:1.0.0#PartTypeInformation", "$value");

public final String URN_SEMANTIC_ID;
public final String REPRESENTATION;

SubmodelType(String URN_SEMANTIC_ID, String REPRESENTATION) {
AssetType(String URN_SEMANTIC_ID, String REPRESENTATION) {
this.URN_SEMANTIC_ID = URN_SEMANTIC_ID;
this.REPRESENTATION = REPRESENTATION;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
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 DemandAndCapacityNotificationContractMapping extends ContractMapping {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
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.DemandAndCapacityNotificationContractMapping;
import org.springframework.stereotype.Repository;

@Repository
public interface DemandAndCapacityNotificationContractMappingRepository extends GeneralContractMappingRepository<DemandAndCapacityNotificationContractMapping> {
@Override
default Class<? extends ContractMapping> getType() {
return DemandAndCapacityNotificationContractMapping.class;
}
}
Loading