Skip to content

Commit

Permalink
Merge pull request #451 from catenax-ng/main
Browse files Browse the repository at this point in the history
feature: add contractagreements and contractagreements/{contractAgreementId}/negotiation to irs-edc-client
  • Loading branch information
ds-mwesener authored Feb 28, 2024
2 parents 2e6f7f6 + fa870b3 commit d702c1f
Show file tree
Hide file tree
Showing 14 changed files with 540 additions and 26 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- DigitalTwinRegistryCreateShellService in irs-registry-client for creating shells in DTR directly
- POST /management/v2/contractagreements/request and GET /management/v2/contractagreements/{contractAgreementId}/negotiation to irs-edc-client lib

### Changed
- Change logo of irs

## [4.6.0] - 2024-02-20
### Added
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ![Item Relationship Service (IRS)](https://raw.githubusercontent.com/eclipse-tractusx/item-relationship-service/main/logo.png)
# ![Item Relationship Service (IRS)](https://github.com/eclipse-tractusx/item-relationship-service/blob/main/logo.png)


[![Apache 2 License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/eclipse-tractusx/item-relationship-service/blob/main/LICENSE)
[![Build](https://github.com/eclipse-tractusx/item-relationship-service/actions/workflows/irs-build.yml/badge.svg)](https://github.com/eclipse-tractusx/item-relationship-service/actions/workflows/irs-build.yml)
Expand Down
1 change: 1 addition & 0 deletions charts/irs-helm/templates/configmap-spring-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ data:
contract-negotiation: {{ .Values.edc.controlplane.endpoint.contractnegotiation | default "/v2/contractnegotiations" | quote }}
transfer-process: {{ .Values.edc.controlplane.endpoint.transferprocess | default "/v2/transferprocesses" | quote }}
state-suffix: {{ .Values.edc.controlplane.endpoint.statesuffix | default "/state" | quote }}
contract-agreements: {{ .Values.edc.controlplane.endpoint.contractAgreements | default "/v2/contractagreements" | quote }}
provider-suffix: {{ tpl .Values.edc.controlplane.provider.suffix . | quote }}
catalog-limit: {{ .Values.edc.controlplane.catalog.limit }}
catalog-page-size: {{ .Values.edc.controlplane.catalog.pagesize }}
Expand Down
1 change: 1 addition & 0 deletions charts/irs-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ edc:
contractnegotiation: /v2/contractnegotiations # EDC consumer controlplane contract negotiation path
transferprocess: /v2/transferprocesses # EDC consumer controlplane transfer process path
statesuffix: /state # Path of the state suffix for contract negotiation and transfer process
contractAgreements: /v2/contractagreements # EDC consumer controlplane contract agreements path
request:
ttl: PT10M # Requests to controlplane will time out after this duration (see https://en.wikipedia.org/wiki/ISO_8601#Durations)
provider:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,17 @@ The product IRS MUST align with the Industry Code Standard CX-126 and CX-127.

## Version matrix

| Artefact | Version | Availability | link |
|----------------------------|---------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| AAS | | | |
| PartAsPlanned | 1.0.1 | Mandatory | [PartAsPlanned 1.0.1](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.part_as_planned/1.0.1) |
| PartAsPlanned | 2.0.0 | Optional (Mandatory for next version of CX-0126) | [PartAsPlanned 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.part_as_planned/2.0.0) |
| SingleLevelBomAsPlanned | 1.1.0 | Mandatory | [SingleLevelBomAsPlanned 1.1.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.single_level_bom_as_planned/1.1.0)] |
| SingleLevelBomAsPlanned | 2.0.0 | Optional (Mandatory for next version of CX-0126) | [SingleLevelBomAsPlanned 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.single_level_bom_as_planned/2.2.0)] |
| SerialPart | 1.0.1 | Mandatory | [SerialPart 1.0.1](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.serial_part/1.0.1) |
| SerialPart | 2.0.0 | Optional | [SerialPart 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.serial_part/2.0.0) |
| Batch | 2.0.0 | Mandatory | [Batch 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.batch/2.0.0) |
| Batch | 2.0.1 | Optional | [Batch 2.0.1](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.batch/2.0.1) |
| JustInSequencePart | 2.0.0 | Optional | [JustInSequencePart 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.just_in_sequence_part/2.0.0) |
| SingleLevelBomAsBuilt | 2.0.0 | Mandatory | [SingleLevelBomAsBuilt 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.single_level_bom_as_built/2.0.0) |
| PartSiteInformationAsBuilt | 1.0.0 | Integrated in Aspects JustInSequencePart / Batch / SerialPart | https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.shared.part_site_information_as_built/1.0.0 |

|Artefact| Version | Availability | link |
|---|---------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| AAS | | | |
|PartAsPlanned | 2.0.0 | Mandatory | [PartAsPlanned 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.part_as_planned/2.0.0) |
| SingleLevelBomAsPlanned| 2.0.0 | Mandatory | [SingleLevelBomAsPlanned 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.single_level_bom_as_planned/2.0.0) |
| SerialPart| 3.0.0 | Mandatory | [SerialPart 3.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.serial_part/3.0.0) |
| Batch| 3.0.0 | Mandatory | [Batch 3.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.batch/3.0.0) |
| JustInSequencePart| 3.0.0 | Mandatory | [JustInSequencePart 3.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.just_in_sequence_part/3.0.0) |
| SingleLevelBomAsBuilt| 2.0.0 | Mandatory | [SingleLevelBomAsBuilt 2.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.single_level_bom_as_built/2.0.0) |
| PartSiteInformationAsBuilt| 1.0.0 | Integrated in Aspects JustInSequencePart / Batch / SerialPart | [PartSiteInformationAsBuilt 1.0.0](https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main/io.catenax.shared.part_site_information_as_built/1.0.0) |


- JustInSequencePart: https://github.com/eclipse-tractusx/sldt-semantic-models/pull/563
Expand All @@ -72,6 +69,9 @@ The product IRS MUST align with the Industry Code Standard CX-126 and CX-127.
For serialized parts, batches, and JIS parts this will be deprecated with new version 3.x.x of AAS.
ASS parameter assetLifecyclePhase will not be used anymore to detect BOMLifecycle. Parameter 'digitalTwinType' is used instead.

**assetLifecyclePhase is not used to detect BomLifecyle any more.**


### Use parameter 'digitalTwinType' to detect BOMLifecycle

**Parameter 'digitalTwinType'**
Expand Down Expand Up @@ -99,30 +99,23 @@ alt aas contains 'digitalTwinType'
else digitalTwinType any other value or null
BOMLifecycleDetector -->> IRS : throw Exception
end
else aas contains 'assetLifecyclePhase'
alt assetLifecyclePhase="AsBuilt"
BOMLifecycleDetector -->> IRS : return asBuilt
else assetLifecyclePhase="AsPlanned"
BOMLifecycleDetector -->> IRS : return asPlanned
else assetLifecyclePhase any other value or null
BOMLifecycleDetector -->> IRS : throw Exception
end
else
IRS -->> BOMLifecycleDetector : throw Exception (BOMLifecylce could not be detected)
BOMLifecycleDetector -->> IRS : retrun BOMLifecyle
BOMLifecycleDetector -->> IRS : return BOMLifecyle
end
````

#### Configuration of parameter 'digitalTwinType'
Parameter is configurable for dDTR instance and has to be configured for integration test.
Setup dDTR registry on used environments. INT, DEV, PEN, STABLE

- [Values.yaml](https://github.com/eclipse-tractusx/sldt-digital-twin-registry/blob/f438fe96a7ae1f1b920e8e4fb4114fb7af32643d/charts/registry/values.yaml#L51)
- [README.md](https://github.com/eclipse-tractusx/sldt-digital-twin-registry/blob/f438fe96a7ae1f1b920e8e4fb4114fb7af32643d/charts/registry/README.md#:~:text=externalSubjectIdWildcardAllowedTypes)

values.yaml
````json
registry.externalSubjectIdWildcardAllowedTypes = manufacturerPartId,assetLifecyclePhase,digitalTwinType
registry.externalSubjectIdWildcardAllowedTypes = manufacturerPartId,digitalTwinType
````


Expand Down Expand Up @@ -186,7 +179,7 @@ values.yaml
|manufacturerId | Mandatory | The Business Partner Number (BPNL) of the manufacturer of the part. |
|manufacturerPartId | Mandatory | |
|customerPartId | Optional | |
|assetLifecyclePhase | asPlanned(Mandatory) / asBuilt(Optional) | @Deprecated For serialized parts, batches, and JIS parts, use the value AsBuilt. For catalog parts in a Digital Twin As-Planned lifecycle phase, use the value AsPlanned. |
|assetLifecyclePhase | asPlanned(Mandatory) / asBuilt(Optional) | @Deprecated Not used any more. For serialized parts, batches, and JIS parts, use the value AsBuilt. For catalog parts in a Digital Twin As-Planned lifecycle phase, use the value AsPlanned. |
|digitalTwinType | Mandatory | digitalTwinType="PartType" OR digitalTwinType="PartInstance" For parts on an instance level (e.g. serialized parts, batches, and JIS parts), use the value PartInstance. For parts on a part type level (e.g. catalog parts), use the value PartType. | | |

# PartAsPlanned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static class EndpointConfig {
private String policyDefinition;
private String transferProcess;
private String stateSuffix;
private String contractAgreements;

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/********************************************************************************
* Copyright (c) 2022,2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021,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.irs.edc.client.contract.model;

import java.util.List;

import lombok.Builder;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement;

/**
* EdcContractAgreementListWrapper used for wrapping the response of
* /management/v2/contractagreements/request where a List of {@link ContractAgreement} is returned.
*/
@ToString
@Builder
@RequiredArgsConstructor
@Getter
public class EdcContractAgreementsResponse {
private final List<ContractAgreement> contractAgreementList;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/********************************************************************************
* Copyright (c) 2022,2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021,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.irs.edc.client.contract.model.exception;

import org.eclipse.tractusx.irs.edc.client.exceptions.EdcClientException;

/**
* ContractAgreementException used for failures in
* {@link org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractAgreementService}
*/
public class ContractAgreementException extends EdcClientException {

public ContractAgreementException(final String message) {
super(message);
}
}
Loading

0 comments on commit d702c1f

Please sign in to comment.