Skip to content

Commit

Permalink
Merge pull request #1214 from eclipse-tractusx/feature/1190-update-ca…
Browse files Browse the repository at this point in the history
…talog-offers

Feature/1190 update catalog offers
  • Loading branch information
ds-mwesener authored Jul 18, 2024
2 parents d51736c + 545cbd9 commit b61dfb9
Show file tree
Hide file tree
Showing 27 changed files with 469 additions and 243 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
### Added

- #999 Added notification processing feedback in FE
- #1190 update notification contracts on policy updates

### Changed
- #1173 Update IRS-Helm from 7.1.4 to 7.2.0 - updated Compatibility Matrix
Expand All @@ -19,6 +20,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- #1188 prevent retry requests for notification actions to prevent duplicate error messages in history
- #1025 fix overlapping table actions
- #941 made the naming for quality notifications consistent throughout the FE app
- #1190 store accepted policies in catalog offers on startup

## [12.0.0 - 05.07.2024]

Expand All @@ -35,7 +37,6 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- #1112 Added association int-a/int-b environment to argo workflow

### Changed
- XXX update legal notice for documents arc42, admin and user manual to years 2024
- #965 Implement proxy functionality of the IRS policy store
- #962 Changed notification model to new one in frontend/backend
- #962 Removed initial notification message for notification flow
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ SPDX-License-Identifier: Apache-2.0
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
<maven-site-plugin.version>4.0.0-M11</maven-site-plugin.version>
<edc-library.version>0.2.1</edc-library.version>
<!-- versions for 3rd party dependecies -->
<logback.version>1.5.6</logback.version>
<eclipse-dash-ip.version>1.1.0</eclipse-dash-ip.version>
Expand Down Expand Up @@ -90,7 +89,7 @@ SPDX-License-Identifier: Apache-2.0
<junit-bom.version>5.10.2</junit-bom.version>
<awaitility.version>4.2.1</awaitility.version>
<!-- TODO https://github.com/eclipse-tractusx/traceability-foss/issues/978 update to the cx release version of irs lib IMPORTANT NO SNAPSHOT-->
<irs-client-lib.version>2.1.4</irs-client-lib.version>
<irs-client-lib.version>2.1.9</irs-client-lib.version>
<json-schema-validator.version>5.4.0</json-schema-validator.version>
<!-- Sonar related properties -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
import org.eclipse.tractusx.traceability.contracts.application.service.ContractService;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractAgreement;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractType;
import org.eclipse.tractusx.traceability.notification.application.contract.model.CreateNotificationContractRequest;
import org.eclipse.tractusx.traceability.notification.application.contract.model.NotificationMethod;
import org.eclipse.tractusx.traceability.notification.application.contract.model.NotificationType;
import org.eclipse.tractusx.traceability.notification.domain.contract.EdcNotificationContractService;
import org.eclipse.tractusx.traceability.policies.domain.PolicyRepository;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -44,6 +41,7 @@
import java.util.stream.Stream;

import static org.eclipse.tractusx.traceability.common.config.ApplicationProfiles.NOT_INTEGRATION_TESTS;
import static org.eclipse.tractusx.traceability.notification.domain.contract.EdcNotificationContractService.NOTIFICATION_CONTRACTS;


@Slf4j
Expand All @@ -69,12 +67,7 @@ public ApplicationStartupConfig(PolicyRepository policyRepository,
}

private final EdcNotificationContractService edcNotificationContractService;
private static final List<CreateNotificationContractRequest> NOTIFICATION_CONTRACTS = List.of(
new CreateNotificationContractRequest(NotificationType.QUALITY_ALERT, NotificationMethod.UPDATE),
new CreateNotificationContractRequest(NotificationType.QUALITY_ALERT, NotificationMethod.RECEIVE),
new CreateNotificationContractRequest(NotificationType.QUALITY_INVESTIGATION, NotificationMethod.UPDATE),
new CreateNotificationContractRequest(NotificationType.QUALITY_INVESTIGATION, NotificationMethod.RECEIVE)
);


@EventListener(ApplicationReadyEvent.class)
public void registerIrsPolicy() {
Expand All @@ -97,7 +90,7 @@ public void createNotificationContracts() {
executor.execute(() -> {
log.info("on ApplicationReadyEvent create notification contracts.");
try {
NOTIFICATION_CONTRACTS.forEach(edcNotificationContractService::handle);
NOTIFICATION_CONTRACTS.forEach(edcNotificationContractService::createNotificationContract);
} catch (Exception exception) {
log.error("Failed to create notification contracts: ", exception);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ public class EdcNotificationContractController {
@PostMapping("/contract")
@ResponseStatus(HttpStatus.CREATED)
public CreateNotificationContractResponse createNotificationContract(@Valid @RequestBody CreateNotificationContractRequest request) {
return edcNotificationContractService.handle(request);
return edcNotificationContractService.createNotificationContract(request);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.eclipse.tractusx.irs.edc.client.EDCCatalogFacade;
import org.eclipse.tractusx.irs.edc.client.EndpointDataReferenceStorage;
import org.eclipse.tractusx.irs.edc.client.model.CatalogItem;
import org.eclipse.tractusx.irs.edc.client.policy.PolicyCheckerService;
import org.eclipse.tractusx.traceability.common.properties.EdcProperties;
import org.eclipse.tractusx.traceability.contracts.application.service.ContractService;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractType;
Expand All @@ -47,7 +46,6 @@
import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationMessage;
import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationStatus;
import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationType;
import org.eclipse.tractusx.traceability.notification.domain.notification.repository.NotificationRepository;
import org.eclipse.tractusx.traceability.notification.infrastructure.edc.model.EDCNotification;
import org.eclipse.tractusx.traceability.notification.infrastructure.edc.model.EDCNotificationFactory;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down Expand Up @@ -84,10 +82,10 @@ public class NotificationsEDCFacade {
private final EndpointDataReferenceStorage endpointDataReferenceStorage;
private final ContractService contractService;

private static final String CX_TAXO_QUALITY_INVESTIGATION_RECEIVE = "https://w3id.org/catenax/taxonomy#ReceiveQualityInvestigationNotification";
private static final String CX_TAXO_QUALITY_INVESTIGATION_UPDATE = "https://w3id.org/catenax/taxonomy#UpdateQualityInvestigationNotification";
private static final String CX_TAXO_QUALITY_ALERT_RECEIVE = "https://w3id.org/catenax/taxonomy#ReceiveQualityAlertNotification";
private static final String CX_TAXO_QUALITY_ALERT_UPDATE = "https://w3id.org/catenax/taxonomy#UpdateQualityAlertNotification";
public static final String CX_TAXO_QUALITY_INVESTIGATION_RECEIVE = "https://w3id.org/catenax/taxonomy#ReceiveQualityInvestigationNotification";
public static final String CX_TAXO_QUALITY_INVESTIGATION_UPDATE = "https://w3id.org/catenax/taxonomy#UpdateQualityInvestigationNotification";
public static final String CX_TAXO_QUALITY_ALERT_RECEIVE = "https://w3id.org/catenax/taxonomy#ReceiveQualityAlertNotification";
public static final String CX_TAXO_QUALITY_ALERT_UPDATE = "https://w3id.org/catenax/taxonomy#UpdateQualityAlertNotification";

public void startEdcTransfer(
final NotificationMessage notificationMessage,
Expand Down Expand Up @@ -132,7 +130,7 @@ private String negotiateContractAgreement(final String receiverEdcUrl, final Cat
private CatalogItem getCatalogItem(final NotificationMessage notification, final String receiverEdcUrl) {
try {

String taxoValue = "";
String taxoValue;
if (NotificationType.ALERT.equals(notification.getType()) && notification.getNotificationStatus().equals(NotificationStatus.SENT)) {
taxoValue = CX_TAXO_QUALITY_ALERT_RECEIVE;
} else if (!NotificationType.ALERT.equals(notification.getType()) && notification.getNotificationStatus().equals(NotificationStatus.SENT)) {
Expand Down
Loading

0 comments on commit b61dfb9

Please sign in to comment.