From 96a0686dd69fb438a322dc6998bfc4b34f6a5e78 Mon Sep 17 00:00:00 2001 From: "Amol.Dashwant" Date: Tue, 20 Jun 2023 15:33:25 +0530 Subject: [PATCH 1/4] A1SDS-2444_adapting new changes to sub models --- .../assembly-part-relationship.md | 13 ++++--- .../resources/assembly-part-relationship.json | 35 ++++--------------- .../serial-part-typization.md | 14 ++++---- .../resources/serial-part-typization.json | 12 +++---- 4 files changed, 25 insertions(+), 49 deletions(-) diff --git a/modules/sde-submodules/assembly-part-relationship/assembly-part-relationship.md b/modules/sde-submodules/assembly-part-relationship/assembly-part-relationship.md index b2a586ad5..e63e8b2eb 100644 --- a/modules/sde-submodules/assembly-part-relationship/assembly-part-relationship.md +++ b/modules/sde-submodules/assembly-part-relationship/assembly-part-relationship.md @@ -1,13 +1,13 @@ - # Assembly Part Relationship (SDE Maven module) + # Single Level BoM As Built (SDE Maven module) --- ## Description -This module use for AssemblyPartRelationship submodel specification and descriptors. It's contain the codes related to AssemblyPartRelationship to validate, parse and transfer data for DigitalTwins and EDC to create aspect twins and data offer. +This module use for SingleLevelBoMAsBuilt submodel specification and descriptors. It's contain the codes related to SingleLevelBoMAsBuilt to validate, parse and transfer data for DigitalTwins and EDC to create aspect twins and data offer. --- -#### Version: 1.1.1 -#### AssemblyPartRelationship Aspect Model URN: urn:bamm:io.catenax.assembly_part_relationship:1.1.1#AssemblyPartRelationship -#### Semantic Id: urn:bamm:io.catenax.assembly_part_relationship:1.1.1 +#### Version: 1.0.0 +#### SingleLevelBoMAsBuilt Aspect Model URN: urn:bamm:io.catenax.single_level_bom_as_built:1.0.0#SingleLevelBomAsBuilt +#### Semantic Id: urn:bamm:io.catenax.single_level_bom_as_built:1.0.0 --- ### Schema @@ -31,7 +31,6 @@ Please find below links for schema details: | manufacturer_part_id | Yes | 8 | | optional_identifier_key | No | 9 | | optional_identifier_value | No | 10 | -| lifecycle_context | Yes | 11 | | quantity_number | Yes | 12 | | measurement_unit | Yes | 13 | | created_on | Yes | 14 | @@ -40,7 +39,7 @@ Please find below links for schema details: #### [CSV Sample File Link] -#### Example for submodel AssemblyPartRelationship +#### Example for submodel SingleLevelBoMAsBuilt



diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json b/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json index 51cabde0e..177f406f2 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json +++ b/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json @@ -2,12 +2,12 @@ "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "http://example.com/example.json", "type": "array", - "id": "assemblypartrelationship", - "idShort": "assemblyPartRelationship", - "version": "1.1.1", - "semantic_id": "urn:bamm:io.catenax.assembly_part_relationship:1.1.1#AssemblyPartRelationship", - "title": "Assembly Part Relationship", - "shortDescription": "BoM AsBuilt - Submodel AssemblyPartRelationship", + "id": "singlelevelbomasbuilt", + "idShort": "singleLevelBoMAsBuilt", + "version": "1.0.0", + "semantic_id": "urn:bamm:io.catenax.single_level_bom_as_built:1.0.0#SingleLevelBomAsBuilt", + "title": "Single Level BoM as Built", + "shortDescription": "BoM AsBuilt - Submodel SingleLevelBoMAsBuilt", "description": "The aspect provides the child parts (one structural level down) which the given object assembles.", "items": { "type": "object", @@ -16,8 +16,6 @@ "parent_manufacturer_part_id", "part_instance_id", "manufacturer_part_id", - "manufacturer_id", - "lifecycle_context", "quantity_number", "measurement_unit", "created_on" @@ -112,7 +110,6 @@ "type": [ "string" ], - "minLength": 1, "title": "Manufacturer id", "description": "The Business Partner Number (BPNL) of the manufacturer of the serialized part, i.e., the companies main entry.", "examples": [ @@ -146,25 +143,6 @@ "Value" ] }, - "lifecycle_context": { - "type": [ - "string" - ], - "enum": [ - "AsRequired", - "AsDesigned", - "AsPlanned", - "AsBuilt", - "AsMaintained", - "AsRecycled" - ], - "minLength": 1, - "title": "Lifecycle Context", - "description": "The lifecycle context in which the child part was assembled into the parent part.", - "examples": [ - "lifecycle" - ] - }, "quantity_number": { "type": [ "number" @@ -224,7 +202,6 @@ "manufacturer_id": "BPNL00000000001", "optional_identifier_key": "", "optional_identifier_value": "", - "lifecycle_context": "AsRequired", "quantity_number": 2.5, "measurement_unit": "litre", "created_on": "2022-02-03T14:48:54.709Z", diff --git a/modules/sde-submodules/serial-part-typization/serial-part-typization.md b/modules/sde-submodules/serial-part-typization/serial-part-typization.md index d784fb296..5ab8c977d 100644 --- a/modules/sde-submodules/serial-part-typization/serial-part-typization.md +++ b/modules/sde-submodules/serial-part-typization/serial-part-typization.md @@ -1,13 +1,13 @@ - # Serial Part Typization (SDE Maven module) + # Serial Part (SDE Maven module) --- ## Description -This module use for SerialPartTypization submodel specification and descriptors. It's contain the codes related to SerialPartTypization to validate, parse and transfer data for DigitalTwins and EDC to create aspect twins and data offer. +This module use for SerialPart submodel specification and descriptors. It's contain the codes related to SerialPart to validate, parse and transfer data for DigitalTwins and EDC to create aspect twins and data offer. --- -#### Version: 1.1.0 -#### SerialPartTypization Aspect Model URN: urn:bamm:io.catenax.serial_part_typization:1.1.0#SerialPartTypization -#### Semantic Id: urn:bamm:io.catenax.serial_part_typization:1.1.0 +#### Version: 1.0.0 +#### SerialPart Aspect Model URN: urn:bamm:io.catenax.serial_part:1.0.0#SerialPart +#### Semantic Id: urn:bamm:io.catenax.serial_part:1.0.0 --- ### Schema @@ -17,7 +17,7 @@ Please find below links for schema details: - [schema](src/main/resources/serial-part-typization.json) -### SerialPartTypization CSV file headers +### SerialPart CSV file headers | Headers Name | Mandatory | Position | |------------------------------- |----------------------------- |-------- | @@ -36,7 +36,7 @@ Please find below links for schema details: #### [CSV Sample File Link] -#### Example for submodel SerialPartTypization +#### Example for submodel SerialPart



diff --git a/modules/sde-submodules/serial-part-typization/src/main/resources/serial-part-typization.json b/modules/sde-submodules/serial-part-typization/src/main/resources/serial-part-typization.json index c1b006618..f8333ec5b 100644 --- a/modules/sde-submodules/serial-part-typization/src/main/resources/serial-part-typization.json +++ b/modules/sde-submodules/serial-part-typization/src/main/resources/serial-part-typization.json @@ -2,12 +2,12 @@ "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "http://example.com/example.json", "type": "array", - "id": "serialparttypization", - "idShort": "serialPartTypization", - "version": "1.1.1", - "semantic_id": "urn:bamm:io.catenax.serial_part_typization:1.1.1#SerialPartTypization", - "title": "Serial Part Typizations", - "shortDescription": "BoM As-Built - Submodel SerialPartTypization", + "id": "serialpart", + "idShort": "serialPart", + "version": "1.0.0", + "semantic_id": "urn:bamm:io.catenax.serial_part:1.0.0#SerialPart", + "title": "Serial Part", + "shortDescription": "BoM As-Built - Submodel SerialPart", "description": "A serialized part is an instantiation of a (design-) part, where the particular instantiation can be uniquely identified by means of a serial numbers or a similar identifier (e.g. VAN) or a combination of multiple identifiers (e.g. combination of manufacturer, date and number)", "items": { "type": "object", From 2155761b6968e2e30c553fd278556e7d6fefc5a0 Mon Sep 17 00:00:00 2001 From: "Amol.Dashwant" Date: Thu, 22 Jun 2023 11:51:50 +0530 Subject: [PATCH 2/4] A1SDS-2452 Manufacturer_id added in the required list of singleLevelBoMAsBuilt --- .../src/main/resources/assembly-part-relationship.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json b/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json index 177f406f2..735737259 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json +++ b/modules/sde-submodules/assembly-part-relationship/src/main/resources/assembly-part-relationship.json @@ -16,6 +16,7 @@ "parent_manufacturer_part_id", "part_instance_id", "manufacturer_part_id", + "manufacturer_id", "quantity_number", "measurement_unit", "created_on" @@ -110,6 +111,7 @@ "type": [ "string" ], + "minLength": 1, "title": "Manufacturer id", "description": "The Business Partner Number (BPNL) of the manufacturer of the serialized part, i.e., the companies main entry.", "examples": [ From 395695196fbf25faba0647625d891715fe592d8f Mon Sep 17 00:00:00 2001 From: "Amol.Dashwant" Date: Thu, 22 Jun 2023 12:23:21 +0530 Subject: [PATCH 3/4] A1SDS-2452 response updated as per the new version --- .../sde/submodels/apr/mapper/AspectRelationshipMapper.java | 6 +++--- .../sde/submodels/apr/model/AspectRelationshipResponse.java | 2 +- .../eclipse/tractusx/sde/submodels/apr/model/ChildPart.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java index 4d1a25779..a09f20402 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java +++ b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java @@ -72,7 +72,7 @@ public JsonObject mapToResponse(String parentCatenaXUuid, List childParts = aspectRelationships.stream().map(this::toChildPart).collect(Collectors.toSet()); return new Gson().toJsonTree( - AspectRelationshipResponse.builder().catenaXId(parentCatenaXUuid).childParts(childParts).build()) + AspectRelationshipResponse.builder().catenaXId(parentCatenaXUuid).childItems(childParts).build()) .getAsJsonObject(); } @@ -87,9 +87,9 @@ private ChildPart toChildPart(AspectRelationshipEntity entity) { .build(); return ChildPart.builder() - .lifecycleContext(entity.getLifecycleContext()) .createdOn(entity.getCreatedOn()) - .childCatenaXId(entity.getChildCatenaXId()).quantity(quantity).build(); + .businessPartner(entity.getChildManufacturerId()) + .catenaXId(entity.getChildCatenaXId()).quantity(quantity).build(); } } diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java index 0ed3168f2..1c48c6426 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java +++ b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java @@ -32,5 +32,5 @@ @AllArgsConstructor public class AspectRelationshipResponse { private String catenaXId; - private Set childParts; + private Set childItems; } \ No newline at end of file diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java index cad5f4a27..09d80445b 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java +++ b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java @@ -30,9 +30,9 @@ @Builder public class ChildPart { - private String lifecycleContext; private Quantity quantity; private String createdOn; private String lastModifiedOn; - private String childCatenaXId; + private String catenaXId; + private String businessPartner; } \ No newline at end of file From 9e383315d828e66ab491c6c0125e8ff51fe56178 Mon Sep 17 00:00:00 2001 From: ChetanT-System Date: Thu, 22 Jun 2023 12:38:52 +0530 Subject: [PATCH 4/4] A1SDS-2452 Code updated for response new version --- .../apr/mapper/AspectRelationshipMapper.java | 21 ++++++++++++------- .../apr/model/AspectRelationshipResponse.java | 2 +- .../model/{ChildPart.java => ChildItems.java} | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) rename modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/{ChildPart.java => ChildItems.java} (98%) diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java index a09f20402..44eb86583 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java +++ b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/mapper/AspectRelationshipMapper.java @@ -28,7 +28,7 @@ import org.eclipse.tractusx.sde.submodels.apr.entity.AspectRelationshipEntity; import org.eclipse.tractusx.sde.submodels.apr.model.AspectRelationship; import org.eclipse.tractusx.sde.submodels.apr.model.AspectRelationshipResponse; -import org.eclipse.tractusx.sde.submodels.apr.model.ChildPart; +import org.eclipse.tractusx.sde.submodels.apr.model.ChildItems; import org.eclipse.tractusx.sde.submodels.apr.model.Quantity; import org.mapstruct.Mapper; import org.mapstruct.Mapping; @@ -70,10 +70,12 @@ public JsonObject mapToResponse(String parentCatenaXUuid, List childParts = aspectRelationships.stream().map(this::toChildPart).collect(Collectors.toSet()); + Set childItems = aspectRelationships.stream().map(this::toChildItems).collect(Collectors.toSet()); return new Gson().toJsonTree( - AspectRelationshipResponse.builder().catenaXId(parentCatenaXUuid).childItems(childParts).build()) - .getAsJsonObject(); + AspectRelationshipResponse.builder() + .catenaXId(parentCatenaXUuid) + .childItems(childItems) + .build()).getAsJsonObject(); } @@ -81,15 +83,18 @@ public AspectRelationshipResponse mapforResponse(JsonObject entity) { return new Gson().fromJson(entity, AspectRelationshipResponse.class); } - private ChildPart toChildPart(AspectRelationshipEntity entity) { - Quantity quantity = Quantity.builder().quantityNumber(entity.getQuantityNumber()) + private ChildItems toChildItems(AspectRelationshipEntity entity) { + Quantity quantity = Quantity.builder() + .quantityNumber(entity.getQuantityNumber()) .measurementUnit(entity.getMeasurementUnit()) .build(); - return ChildPart.builder() + return ChildItems.builder() .createdOn(entity.getCreatedOn()) .businessPartner(entity.getChildManufacturerId()) - .catenaXId(entity.getChildCatenaXId()).quantity(quantity).build(); + .catenaXId(entity.getChildCatenaXId()) + .quantity(quantity) + .build(); } } diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java index 1c48c6426..b2118d4d5 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java +++ b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/AspectRelationshipResponse.java @@ -32,5 +32,5 @@ @AllArgsConstructor public class AspectRelationshipResponse { private String catenaXId; - private Set childItems; + private Set childItems; } \ No newline at end of file diff --git a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildItems.java similarity index 98% rename from modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java rename to modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildItems.java index 09d80445b..8600f132b 100644 --- a/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildPart.java +++ b/modules/sde-submodules/assembly-part-relationship/src/main/java/org/eclipse/tractusx/sde/submodels/apr/model/ChildItems.java @@ -28,7 +28,7 @@ @Data @AllArgsConstructor @Builder -public class ChildPart { +public class ChildItems { private Quantity quantity; private String createdOn;