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

feat : New maven module for part type information submodel #141

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added usecase handle implementation for multiple submodel support.
- Supported new serial part submodel with multi version support.
- Supported new single level bom as built submodel with multi version support.
- New maven module for part type information submodel support.

## [2.3.6] - 2024-03-06
### Fixed
Expand Down
1 change: 1 addition & 0 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ maven/mavencentral/org.eclipse.tractusx/digital-twins/0.0.1, Apache-2.0, approve
maven/mavencentral/org.eclipse.tractusx/edc/0.0.1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/part-as-planned/0.0.1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/part-site-information-as-planned/0.0.1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/part-type-information/0.0.1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/pcf-exchange/0.0.1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/pcf/0.0.1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/policy-hub/0.0.1, Apache-2.0, approved, automotive.tractusx
Expand Down
6 changes: 6 additions & 0 deletions modules/sde-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@
<artifactId>part-as-planned</artifactId>
<version>0.0.1</version>
</dependency>

<dependency>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>part-type-information</artifactId>
<version>0.0.1</version>
</dependency>

<dependency>
<groupId>org.eclipse.tractusx</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# PartTypeInformation (SDE Maven module)
---
## Description

This module use for PartTypeInformation submodel specification and descriptors. It's contain the codes related to PartTypeInformation to validate, parse and transfer data for DigitalTwins and EDC to create aspect twins and data offer.

---
#### Version: 1.0.0
#### PartTypeInformation Aspect Model URN: urn:bamm:io.catenax.part_as_planned:1.0.0#PartTypeInformation
#### Semantic Id: urn:samm:io.catenax.part_type_information:1.0.0#PartTypeInformation
---

### Schema

Please find below links for schema details:

- [PartTypeInformation V1.0.0 schema](src/main/resources/part-type-information-v1.0.0.json)

### CSV file headers

| Headers Name | Mandatory | Position |
|------------------------ |---------------------------|-------- |
| uuid | Yes | 1 |
| manufacturer_part_id | Yes | 2 |
| classification_standard | Yes | 3 |
| classification_id | Yes | 4 |
| classification_description | No | 5 |
| function | Yes | 6 |
| function_valid_from | No | 7 |
| function_valid_until | No | 8 |
| name_at_manufacturer | Yes | 9 |

#### [CSV Sample File Link]

#### Example for submodel PartAsPlanned

### Work Flow

- CSV to POJO
- CSV column validation and mandatory field validation
- POJO TO DTO
- UUID generate v4
- DigitalTwins API's calls
- EDC API's calls
- BPN Discovery calls
- DB Store

### External Services Call

- DigitalTwins
- EDC Connectors
- BPN Discovery
87 changes: 87 additions & 0 deletions modules/sde-submodules/part-type-information/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!--
/********************************************************************************
* Copyright (c) 2024 T-Systems International GmbH
* 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
********************************************************************************/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>sde</artifactId>
<version>0.0.1</version>
<relativePath>../../../</relativePath>
</parent>

<artifactId>part-type-information</artifactId>
<name>part-type-information</name>
<description>part-type-information</description>

<dependencies>
<dependency>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>sde-common</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>edc</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>digital-twins</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>bpn-discovery</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.processor.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<compilerArg>
-Amapstruct.unmappedTargetPolicy=IGNORE
</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/********************************************************************************
* Copyright (c) 2024 T-Systems International GmbH
* 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.sde.submodels.pti;

import java.io.InputStream;

import org.eclipse.tractusx.sde.common.extensions.SubmodelExtension;
import org.eclipse.tractusx.sde.common.model.Submodel;
import org.springframework.stereotype.Component;

import jakarta.annotation.PostConstruct;

@Component
public class PartTypeInformationV100 extends SubmodelExtension {

private Submodel submodel = null;

@PostConstruct
public void init() {

String resource = "part-type-information-v1.0.0.json";
// this is the path within the jar file
InputStream input = this.getClass().getResourceAsStream("/resources/" + resource);
Fixed Show fixed Hide fixed
if (input == null) {
// this is how we load file within editor (eg eclipse)
input = this.getClass().getClassLoader().getResourceAsStream(resource);
}

submodel = loadSubmodel(input);

submodel.addProperties("tableName", "parttypeinformation_v_100");
}

@Override
public Submodel submodel() {
return submodel;
}

}
Loading
Loading