From 35ccd34fcae0b602c08b1f49111e9049396f2dc8 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 22 Feb 2024 13:36:51 +0100 Subject: [PATCH 01/45] feature: 420 persist contract agreement id --- .../mapper/AssetAsBuiltResponseMapper.java | 1 + .../mapper/AssetAsPlannedResponseMapper.java | 1 + .../assets/domain/base/model/AssetBase.java | 1 + .../asbuilt/model/AssetAsBuiltEntity.java | 2 ++ .../asbuilt/model/AssetAsBuiltViewEntity.java | 1 + .../asplanned/model/AssetAsPlannedEntity.java | 8 ++--- .../irs/model/response/JobDetailResponse.java | 36 +++++++++++-------- .../semanticdatamodel/SemanticDataModel.java | 6 ++-- .../base/model/AssetBaseEntity.java | 1 + ...15__add_contract_agreement_id_to_asset.sql | 4 +++ .../base/IrsCallbackControllerIT.java | 15 +++++++- .../base/response/AssetBaseResponse.java | 4 +++ 12 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java index 3bac937369..c24a3c4129 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java @@ -59,6 +59,7 @@ public static AssetAsBuiltResponse from(final AssetBase asset) { .importState(toImportStateResponse(asset.getImportState())) .importNote(asset.getImportNote()) .tombstone(asset.getTombstone()) + .contractAgreementId(asset.getContractAgreementId()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java index 8bce3e5ef1..895e3ce987 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java @@ -60,6 +60,7 @@ public static AssetAsPlannedResponse from(final AssetBase asset) { .importState(toImportStateResponse(asset.getImportState())) .importNote(asset.getImportNote()) .tombstone(asset.getTombstone()) + .contractAgreementId(asset.getContractAgreementId()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java index 392d66b286..43789bedd6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java @@ -62,6 +62,7 @@ public class AssetBase { private String importNote; private String policyId; private String tombstone; + private String contractAgreementId; public BomLifecycle getBomLifecycle() { if (semanticDataModel.isAsBuilt()) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java index 1f0d91d7ad..473c1da122 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java @@ -126,6 +126,7 @@ public static AssetAsBuiltEntity from(AssetBase asset) { .importNote(asset.getImportNote()) .policyId(asset.getPolicyId()) .tombstone(asset.getTombstone()) + .contractAgreementId(asset.getContractAgreementId()) .build(); } @@ -158,6 +159,7 @@ public AssetBase toDomain() { .importNote(this.getImportNote()) .policyId(this.getPolicyId()) .tombstone(this.getTombstone()) + .contractAgreementId(this.getContractAgreementId()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltViewEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltViewEntity.java index 88f242a988..aa2a14c788 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltViewEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltViewEntity.java @@ -126,6 +126,7 @@ public AssetBase toDomain() { .sentQualityInvestigations(emptyIfNull(this.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) .receivedQualityInvestigations(emptyIfNull(this.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) .tombstone(this.getTombstone()) + .contractAgreementId(this.getContractAgreementId()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java index 3ede3ef726..3288720d37 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java @@ -24,7 +24,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToMany; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; import lombok.AllArgsConstructor; @@ -38,16 +37,11 @@ import org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel; import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.AssetBaseEntity; import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.SemanticDataModelEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.submodel.infrastructure.model.SubmodelPayloadEntity; import java.time.Instant; -import java.util.ArrayList; import java.util.List; -import static org.apache.commons.collections4.ListUtils.emptyIfNull; import static org.eclipse.tractusx.traceability.common.date.DateUtil.toInstant; @Getter @@ -114,6 +108,7 @@ public static AssetAsPlannedEntity from(AssetBase asset) { .importNote(asset.getImportNote()) .policyId(asset.getPolicyId()) .tombstone(asset.getTombstone()) + .contractAgreementId(asset.getContractAgreementId()) .build(); } @@ -139,6 +134,7 @@ public static AssetBase toDomain(AssetAsPlannedEntity entity) { .importNote(entity.getImportNote()) .policyId(entity.getPolicyId()) .tombstone(entity.getTombstone()) + .contractAgreementId(entity.getContractAgreementId()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/JobDetailResponse.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/JobDetailResponse.java index 2549fb5595..88f7bea832 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/JobDetailResponse.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/JobDetailResponse.java @@ -135,7 +135,6 @@ private List convertAssets(BomLifecycle bomLifecycle, ObjectMapper ob log.info(":: shells: {}", shells()); - Map shortIds = shells().stream() .map(shell -> Map.entry(shell.payload().globalAssetId(), shell.payload().idShort())) .collect(Collectors.toMap( @@ -144,22 +143,30 @@ private List convertAssets(BomLifecycle bomLifecycle, ObjectMapper ob (existingValue, newValue) -> existingValue )); + Map contractAgreementIds = shells().stream() + .map(shell -> Map.entry(shell.payload().globalAssetId(), shell.contractAgreementId())) + .collect(Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue, + (existingValue, newValue) -> existingValue + )); + Map bpnMapping = bpns(); List ownParts = new ArrayList<>(); List otherParts = new ArrayList<>(); if (bomLifecycle.equals(BomLifecycle.AS_BUILT)) { - ownParts = mapToOwnPartsAsBuilt(shortIds, bpnMapping); + ownParts = mapToOwnPartsAsBuilt(shortIds, bpnMapping, contractAgreementIds); if (isSupplierDirection()) { - otherParts.addAll(mapToOtherPartsAsBuilt(shortIds, Owner.SUPPLIER, bpnMapping)); + otherParts.addAll(mapToOtherPartsAsBuilt(shortIds, Owner.SUPPLIER, bpnMapping, contractAgreementIds)); } else { - otherParts.addAll(mapToOtherPartsAsBuilt(shortIds, Owner.CUSTOMER, bpnMapping)); + otherParts.addAll(mapToOtherPartsAsBuilt(shortIds, Owner.CUSTOMER, bpnMapping, contractAgreementIds)); } } if (bomLifecycle.equals(BomLifecycle.AS_PLANNED)) { - ownParts = mapToOwnPartsAsPlanned(shortIds, bpnMapping); + ownParts = mapToOwnPartsAsPlanned(shortIds, bpnMapping, contractAgreementIds); if (isSupplierDirection()) { - otherParts.addAll(mapToOtherPartsAsPlanned(shortIds, Owner.SUPPLIER, bpnMapping)); + otherParts.addAll(mapToOtherPartsAsPlanned(shortIds, Owner.SUPPLIER, bpnMapping, contractAgreementIds)); } } @@ -176,7 +183,7 @@ private boolean isSupplierDirection() { return jobStatus().parameter().direction().equalsIgnoreCase(Direction.DOWNWARD.name()); } - private List mapToOtherPartsAsBuilt(Map shortIds, Owner owner, Map bpnMapping) { + private List mapToOtherPartsAsBuilt(Map shortIds, Owner owner, Map bpnMapping, Map contractAgreementIds) { List otherParts = semanticDataModels().stream() .filter(semanticDataModel -> !(semanticDataModel instanceof DetailAspectDataTractionBatteryCode)).filter(semanticDataModel -> !isOwnPart(semanticDataModel, jobStatus)) .toList(); @@ -187,13 +194,13 @@ private List mapToOtherPartsAsBuilt(Map shortIds, Own .stream() .map(semanticDataModel -> semanticDataModel.toDomainAsBuilt(semanticDataModel.localIdentifiers(), shortIds, owner, bpnMapping, Collections.emptyList(), - Collections.emptyList(), Optional.empty(), ImportState.PERSISTENT)) + Collections.emptyList(), Optional.empty(), ImportState.PERSISTENT, contractAgreementIds)) .toList(); log.info(":: mapped assets: {}", assets); return assets; } - private List mapToOtherPartsAsPlanned(Map shortIds, Owner owner, Map bpnMapping) { + private List mapToOtherPartsAsPlanned(Map shortIds, Owner owner, Map bpnMapping, Map contractAgreementIds) { List otherParts = semanticDataModels().stream().filter(semanticDataModel -> !isOwnPart(semanticDataModel, jobStatus)).filter(semanticDataModel -> Aspect.isMainAspect(semanticDataModel.getAspectType())).toList(); List isPartSiteInformationAsPlanned = semanticDataModels().stream() @@ -214,13 +221,13 @@ private List mapToOtherPartsAsPlanned(Map shortIds, O bpnMapping, Collections.emptyList(), Collections.emptyList(), - ownerBpn, ImportState.PERSISTENT)) + ownerBpn, ImportState.PERSISTENT, contractAgreementIds)) .toList(); log.info(":: mapped assets: {}", assets); return assets; } - private List mapToOwnPartsAsPlanned(Map shortIds, Map bpnMapping) { + private List mapToOwnPartsAsPlanned(Map shortIds, Map bpnMapping, Map contractAgreementIds) { List ownPartsAsPlanned = semanticDataModels().stream() @@ -252,7 +259,8 @@ private List mapToOwnPartsAsPlanned(Map shortIds, Map Collections.emptyList(), getChildParts(singleLevelBomRelationship, shortIds, semanticDataModel.catenaXId()), ownerBpn, - ImportState.PERSISTENT + ImportState.PERSISTENT, + contractAgreementIds )) .toList(); log.info(":: mapped assets: {}", assets); @@ -269,7 +277,7 @@ public static void addPartSiteInformationAsPlannedToOwnPartsAsPlanned(List mapToOwnPartsAsBuilt(Map shortIds, Map bpnMapping) { + private List mapToOwnPartsAsBuilt(Map shortIds, Map bpnMapping, Map contractAgreementIds) { List ownParts = semanticDataModels().stream() .filter(semanticDataModel -> Aspect.isMainAspect(semanticDataModel.getAspectType())) .filter(semanticDataModel -> isOwnPart(semanticDataModel, jobStatus)) @@ -297,7 +305,7 @@ private List mapToOwnPartsAsBuilt(Map shortIds, Map semanticDataModel.toDomainAsBuilt(semanticDataModel.localIdentifiers(), shortIds, Owner.OWN, bpnMapping, getParentParts(customerPartsMap, shortIds, semanticDataModel.catenaXId()), getChildParts(supplierPartsMap, shortIds, semanticDataModel.catenaXId()), - tractionBatteryCodeOptional, ImportState.PERSISTENT)) + tractionBatteryCodeOptional, ImportState.PERSISTENT, contractAgreementIds)) .toList(); log.info(":: mapped assets: {}", assets); return assets; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java index c10381cbff..2cc6a458d9 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java @@ -101,7 +101,7 @@ public Optional getLocalIdByInput(LocalIdKey key, List localIds public AssetBase toDomainAsBuilt(List localIds, Map shortIds, Owner owner, Map bpns, List parentRelations, List childRelations, - Optional tractionBatteryCodeOptional, ImportState assetImportState) { + Optional tractionBatteryCodeOptional, ImportState assetImportState, Map contractAgreementIds) { final String manufacturerName = bpns.get(manufacturerId()); ArrayList detailAspectModels = new ArrayList<>(); @@ -148,6 +148,7 @@ public AssetBase toDomainAsBuilt(List localIds, Map sho .van(van()) .importState(assetImportState) .importNote(ImportNote.PERSISTED) + .contractAgreementId(contractAgreementIds.get(catenaXId())) .build(); } @@ -158,7 +159,7 @@ public AssetBase toDomainAsPlanned( List parentRelations, List childRelations, String ownerBpn, - ImportState assetImportState) { + ImportState assetImportState, Map contractAgreementIds) { final String manufacturerName = bpns.get(ownerBpn); List partSiteInfoAsPlanned = extractDetailAspectModelsPartSiteInformationAsPlanned(sites()); @@ -184,6 +185,7 @@ public AssetBase toDomainAsPlanned( .van(van()) .importState(assetImportState) .importNote(ImportNote.PERSISTED) + .contractAgreementId(contractAgreementIds.get(catenaXId())) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/model/AssetBaseEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/model/AssetBaseEntity.java index 1f20d05675..2e4f775d1d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/model/AssetBaseEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/model/AssetBaseEntity.java @@ -58,4 +58,5 @@ public class AssetBaseEntity { private String importNote; private String policyId; private String tombstone; + private String contractAgreementId; } diff --git a/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql b/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql new file mode 100644 index 0000000000..c0e6b086da --- /dev/null +++ b/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql @@ -0,0 +1,4 @@ +ALTER TABLE assets_as_planned + ADD COLUMN "contract_agreement_id" varchar(255) NULL; +ALTER TABLE assets_as_built + ADD COLUMN "contract_agreement_id" varchar(255) NULL; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/infrastructure/base/IrsCallbackControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/infrastructure/base/IrsCallbackControllerIT.java index d8b1cea71b..928728ae3e 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/infrastructure/base/IrsCallbackControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/infrastructure/base/IrsCallbackControllerIT.java @@ -52,8 +52,9 @@ class IrsCallbackControllerIT extends IntegrationTestSpecification { @Test - void givenNoAssets_whenCallbackReceived_thenSaveThem() { + void givenNoAssets_whenCallbackReceived_thenSaveThem() throws JoseException { // given + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); irsApiSupport.irsApiReturnsJobDetails(); String jobId = "ebb79c45-7bba-4169-bf17-3e719989ab54"; @@ -75,6 +76,18 @@ void givenNoAssets_whenCallbackReceived_thenSaveThem() { assertThat(bpnSupportRepository.findAll()).hasSize(6); assetsSupport.assertAssetAsBuiltSize(16); assetsSupport.assertAssetAsPlannedSize(0); + String contractAgreementId = given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .pathParam("assetId", "urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb") + .get("/api/assets/as-built/{assetId}") + .then() + .log().all() + .statusCode(200) + .extract().path("contractAgreementId"); + assertThat(contractAgreementId).isNotEmpty(); } @Test diff --git a/tx-models/src/main/java/assets/response/base/response/AssetBaseResponse.java b/tx-models/src/main/java/assets/response/base/response/AssetBaseResponse.java index 83d7f899cb..f31f142043 100644 --- a/tx-models/src/main/java/assets/response/base/response/AssetBaseResponse.java +++ b/tx-models/src/main/java/assets/response/base/response/AssetBaseResponse.java @@ -95,4 +95,8 @@ public class AssetBaseResponse { } """) private String tombstone; + + + @Schema(example = "TODO") + private String contractAgreementId; } From c4b507c39f69b54402c660e101a48d457e3aa845 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Fri, 1 Mar 2024 11:45:58 +0100 Subject: [PATCH 02/45] chore(notifications): 515 - adding send notification xception. --- CHANGELOG.md | 1 + .../traceability/common/config/ErrorHandlingConfig.java | 8 ++++++++ .../base/service/AbstractQualityNotificationService.java | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 726980f4f4..2bfe083446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added - Added concept #638: Contract agreement admin view - Added support for meta key for multi sorting on tables +- #515 Service Unavailable Response on Notification failure ### Changed - Spring-core bumped from 6.0.16 to 6.0.17 diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index eea36aff70..17006833e2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -43,6 +43,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractException; import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; @@ -169,6 +170,13 @@ ResponseEntity handleInvestigationReceiverBpnMismatchException(In .body(new ErrorResponse(exception.getMessage())); } + @ExceptionHandler(SendNotificationException.class) + ResponseEntity handleSendNotificationException(SendNotificationException exception) { + log.warn("handleSendNotificationException", exception); + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body(new ErrorResponse(exception.getMessage())); + } + @ExceptionHandler(ValidationException.class) ResponseEntity handleValidationException(ValidationException exception) { log.warn("handleValidationException", exception); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index cbb3ee6d16..00da3e2db8 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -57,8 +57,8 @@ public void update(Long notificationId, QualityNotificationStatus notificationSt try { updatedAlert = getNotificationPublisherService().updateNotificationPublisher(alert, notificationStatus, reason); } catch (SendNotificationException exception) { - log.info("Notification status rollback", exception); - return; + log.warn("Notification status rollback", exception); + throw new SendNotificationException(exception.getMessage()); } getQualityNotificationRepository().updateQualityNotificationEntity(updatedAlert); @@ -78,7 +78,7 @@ public void approve(Long notificationId) { approvedInvestigation = getNotificationPublisherService().approveNotification(notification); } catch (SendNotificationException exception) { log.info("Notification status rollback", exception); - return; + throw new SendNotificationException(exception.getMessage()); } getQualityNotificationRepository().updateQualityNotificationEntity(approvedInvestigation); } From 7953630929a5f702f9150254f87898082d2b79ce Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Fri, 1 Mar 2024 11:55:34 +0100 Subject: [PATCH 03/45] chore(notifications): 515 - adding send notification xception. --- .../openapi/traceability-foss-backend.json | 2024 ++++++++--------- .../AbstractQualityNotificationService.java | 6 +- 2 files changed, 1015 insertions(+), 1015 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 7ad6a3adfd..41a2a3e116 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -37,8 +37,8 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -47,8 +47,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -57,17 +57,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -82,8 +77,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -92,18 +87,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -112,8 +112,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -169,8 +169,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -179,8 +179,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -189,8 +189,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -199,8 +199,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -209,8 +209,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -219,8 +219,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -229,8 +229,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -286,8 +286,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -296,8 +296,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -306,8 +306,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -316,8 +316,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -326,8 +326,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -336,8 +336,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -346,8 +346,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -385,8 +385,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -395,8 +395,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -405,8 +405,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -415,14 +415,8 @@ } } }, - "200" : { - "description" : "Returns the paged result found", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -431,8 +425,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -441,8 +435,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the paged result found", + "content" : { + "application/json" : {} + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -451,8 +451,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -504,8 +504,8 @@ "application/json" : {} } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -514,8 +514,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -524,8 +524,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -534,14 +534,8 @@ } } }, - "200" : { - "description" : "Ok.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -550,8 +544,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -560,8 +554,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok.", + "content" : { + "application/json" : {} + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -570,8 +570,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -609,8 +609,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -619,8 +619,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -629,8 +629,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -639,8 +639,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -649,8 +649,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -659,28 +659,28 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } }, - "201" : { - "description" : "Created.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -729,11 +729,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -742,8 +739,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -752,8 +749,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -762,8 +762,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -772,8 +772,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -782,8 +785,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -792,11 +795,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -845,11 +845,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -858,8 +855,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -868,8 +865,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -878,8 +878,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -888,8 +888,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -898,8 +901,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -908,11 +911,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -951,11 +951,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -964,8 +961,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -974,8 +971,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -984,8 +981,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -994,11 +991,11 @@ } } }, - "204" : { - "description" : "No content." + "200" : { + "description" : "Ok." }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1007,8 +1004,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No content." + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1017,8 +1017,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1057,11 +1057,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1070,8 +1067,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1080,8 +1077,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1090,8 +1087,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1100,11 +1097,11 @@ } } }, - "204" : { - "description" : "No content." + "200" : { + "description" : "Ok." }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1113,8 +1110,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No content." + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1123,8 +1123,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1162,16 +1162,6 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -1182,46 +1172,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -1356,6 +1306,16 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "415" : { "description" : "Unsupported media type", "content" : { @@ -1365,6 +1325,46 @@ } } } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -1395,8 +1395,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1405,8 +1405,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1415,8 +1415,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1425,8 +1425,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1435,8 +1435,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1445,28 +1445,28 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/CreateNotificationContractResponse" } } } }, - "201" : { - "description" : "Created.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1505,8 +1505,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1515,8 +1515,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1525,8 +1525,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1535,17 +1535,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1554,8 +1545,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1564,8 +1555,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1574,8 +1571,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1621,8 +1621,8 @@ } }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1631,8 +1631,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1641,8 +1641,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1651,17 +1651,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1670,8 +1661,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1680,8 +1671,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1690,8 +1687,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1729,8 +1729,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1739,8 +1739,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1749,8 +1749,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1759,8 +1759,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1769,8 +1769,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1779,8 +1779,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created." + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1789,11 +1792,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1831,6 +1831,66 @@ "required" : true }, "responses" : { + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -2002,58 +2062,18 @@ "IN_SYNCHRONIZATION", "UNSET" ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - } - } - } - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + } + } + } + } } } } @@ -2067,26 +2087,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -2117,8 +2117,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2127,8 +2127,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2137,8 +2137,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2147,8 +2147,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2157,8 +2157,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2167,8 +2167,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created." + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2177,11 +2180,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2219,8 +2219,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2229,8 +2229,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2239,8 +2239,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2249,8 +2249,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2259,8 +2259,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2269,8 +2269,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2466,8 +2466,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2505,8 +2505,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2515,8 +2515,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2525,8 +2525,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2535,8 +2535,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2545,8 +2545,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2555,28 +2555,28 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } }, - "201" : { - "description" : "Created.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2625,8 +2625,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2635,8 +2635,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2645,8 +2645,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2655,8 +2658,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2665,8 +2668,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2675,8 +2678,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2685,11 +2688,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2738,11 +2738,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2751,8 +2748,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2761,8 +2758,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2771,8 +2771,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2781,8 +2781,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2791,8 +2794,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2801,11 +2804,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2844,11 +2844,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2857,8 +2854,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2867,8 +2864,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2877,8 +2874,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2887,11 +2884,11 @@ } } }, - "204" : { - "description" : "No content." + "200" : { + "description" : "Ok." }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2900,8 +2897,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No content." + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2910,8 +2910,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2950,11 +2950,18 @@ } ], "responses" : { - "200" : { - "description" : "Ok." + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2963,8 +2970,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2983,8 +2990,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2996,18 +3006,8 @@ "204" : { "description" : "No content." }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3016,8 +3016,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3055,8 +3055,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3065,8 +3065,18 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3085,8 +3095,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3095,8 +3105,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3233,18 +3243,8 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3282,6 +3282,66 @@ } ], "responses" : { + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -3464,46 +3524,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "401" : { "description" : "Authorization failed.", "content" : { @@ -3513,26 +3533,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -3571,8 +3571,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3581,8 +3581,18 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3601,6 +3611,16 @@ } } }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3802,26 +3822,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -4034,8 +4034,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4044,8 +4044,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4054,8 +4054,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4064,8 +4064,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4074,8 +4074,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4084,8 +4084,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4094,8 +4094,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4141,8 +4141,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4151,8 +4151,38 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4343,16 +4373,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -4372,26 +4392,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -4412,8 +4412,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4422,8 +4422,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4432,8 +4432,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4442,11 +4442,8 @@ } } }, - "202" : { - "description" : "Created registry reload job." - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4455,8 +4452,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4465,8 +4462,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "202" : { + "description" : "Created registry reload job." + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4475,8 +4475,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4504,8 +4504,8 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4514,8 +4514,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4524,12 +4524,12 @@ } } }, - "200" : { - "description" : "Returns the policies", + "415" : { + "description" : "Unsupported media type", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -4544,8 +4544,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4554,18 +4554,18 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the policies", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4574,8 +4574,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4614,24 +4614,18 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "$ref" : "#/components/schemas/InvestigationResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4640,8 +4634,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4660,18 +4654,24 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : -2147483648, + "type" : "array", + "description" : "Investigations", + "items" : { + "$ref" : "#/components/schemas/InvestigationResponse" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4680,8 +4680,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4690,8 +4690,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4759,8 +4759,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4769,8 +4769,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4779,8 +4779,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4789,8 +4789,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4799,8 +4799,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4824,8 +4824,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4834,8 +4834,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4863,18 +4863,18 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "200" : { - "description" : "Returns dashboard data", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4883,8 +4883,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4903,18 +4903,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4923,8 +4923,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4933,8 +4933,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4973,18 +4973,18 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4993,8 +4993,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5013,11 +5013,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5026,18 +5023,18 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5046,8 +5043,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5093,8 +5093,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5103,8 +5103,18 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5123,6 +5133,16 @@ } } }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -5329,26 +5349,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -5411,8 +5411,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5421,8 +5421,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5431,8 +5431,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5441,8 +5441,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5451,8 +5451,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5476,8 +5476,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5486,8 +5486,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5525,16 +5525,6 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -5545,8 +5535,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5555,8 +5545,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5565,8 +5555,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5575,8 +5565,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5767,8 +5757,18 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5814,36 +5814,6 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -6031,8 +6001,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6041,8 +6011,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6051,8 +6021,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6061,8 +6031,38 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6132,8 +6132,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6142,8 +6142,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6152,8 +6152,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6162,8 +6162,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6172,8 +6172,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6197,8 +6197,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6207,8 +6207,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6236,8 +6236,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6246,8 +6246,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6256,8 +6256,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6266,23 +6266,18 @@ } } }, - "200" : { - "description" : "Returns the assets found", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6291,18 +6286,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the assets found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6311,8 +6311,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6350,8 +6350,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6360,8 +6360,38 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6552,16 +6582,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -6581,26 +6601,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -6632,23 +6632,18 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6657,8 +6652,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6677,18 +6672,23 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "type" : "array", + "description" : "Alerts", + "items" : { + "$ref" : "#/components/schemas/AlertResponse" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6697,8 +6697,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6707,8 +6707,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6776,8 +6776,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6786,8 +6786,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6796,8 +6796,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6806,8 +6806,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6816,8 +6816,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6841,8 +6841,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6851,8 +6851,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6880,11 +6880,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6893,8 +6890,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6903,8 +6900,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6913,8 +6910,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6923,8 +6920,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6936,8 +6936,8 @@ "204" : { "description" : "No Content." }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6946,8 +6946,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6985,11 +6985,8 @@ } ], "responses" : { - "204" : { - "description" : "Deleted." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6998,8 +6995,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -7008,11 +7005,8 @@ } } }, - "200" : { - "description" : "Okay" - }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -7021,8 +7015,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7031,8 +7025,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -7041,8 +7035,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "Deleted." + }, + "200" : { + "description" : "Okay" + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -7051,8 +7051,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 00da3e2db8..cbb3ee6d16 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -57,8 +57,8 @@ public void update(Long notificationId, QualityNotificationStatus notificationSt try { updatedAlert = getNotificationPublisherService().updateNotificationPublisher(alert, notificationStatus, reason); } catch (SendNotificationException exception) { - log.warn("Notification status rollback", exception); - throw new SendNotificationException(exception.getMessage()); + log.info("Notification status rollback", exception); + return; } getQualityNotificationRepository().updateQualityNotificationEntity(updatedAlert); @@ -78,7 +78,7 @@ public void approve(Long notificationId) { approvedInvestigation = getNotificationPublisherService().approveNotification(notification); } catch (SendNotificationException exception) { log.info("Notification status rollback", exception); - throw new SendNotificationException(exception.getMessage()); + return; } getQualityNotificationRepository().updateQualityNotificationEntity(approvedInvestigation); } From 74a935e7a5bca0fe1833c20b77034f49bb04882d Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Fri, 1 Mar 2024 13:31:34 +0100 Subject: [PATCH 04/45] chore(bug): 542 bugfix filter and sorting in other parts --- CHANGELOG.md | 1 + .../customer-parts.component.html | 2 + .../customer-parts.component.ts | 35 ++++++++++++++--- .../supplier-parts.component.ts | 38 ++++++++++++++++--- .../parts-table/parts-table.component.html | 4 +- 5 files changed, 68 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 726980f4f4..779d762523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Bumped version ts-graphviz/setup-graphviz@v1 to ts-graphviz/setup-graphviz@v2 - Bumped version Schedlock 5.10.0 to 5.11.0 - updated yarn.lock file +- [#542](https://github.com/eclipse-tractusx/traceability-foss/issues/542) Fixed bug where it where filter was reset when sorting in other parts table ### Removed - Removed EDC notification asset classes and replaced with IRS lib implementation diff --git a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html index f0ea86ad5a..ede9569d94 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html +++ b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html @@ -30,6 +30,8 @@ ; + assetAsBuiltFilter: AssetAsBuiltFilter; + assetsAsPlannedFilter: AssetAsPlannedFilter; + constructor( private readonly otherPartsFacade: OtherPartsFacade, private readonly partDetailsFacade: PartDetailsFacade, @@ -91,9 +94,11 @@ export class SupplierPartsComponent implements OnInit, OnDestroy { filterActivated(isAsBuilt: boolean, assetFilter: any): void { if (isAsBuilt) { - this.otherPartsFacade.setSupplierPartsAsBuilt(0, 50, [], toAssetFilter(assetFilter, true)); + this.assetAsBuiltFilter = assetFilter; + this.otherPartsFacade.setSupplierPartsAsBuilt(0, 50, [], toAssetFilter(this.assetAsBuiltFilter, true)); } else { - this.otherPartsFacade.setSupplierPartsAsPlanned(0, 50, [], toAssetFilter(assetFilter, false)); + this.assetsAsPlannedFilter = assetFilter; + this.otherPartsFacade.setSupplierPartsAsPlanned(0, 50, [], toAssetFilter(this.assetsAsPlannedFilter, false)); } } @@ -116,13 +121,36 @@ export class SupplierPartsComponent implements OnInit, OnDestroy { } public onAsBuiltTableConfigChange({ page, pageSize, sorting }: TableEventConfig): void { + this.setTableSortingList(sorting, MainAspectType.AS_BUILT); - this.otherPartsFacade.setSupplierPartsAsBuilt(page, pageSize, this.tableSupplierAsBuiltSortList); + + let pageSizeValue = 50; + if (pageSize !== 0) { + pageSizeValue = pageSize; + } + + if (this.assetAsBuiltFilter) { + this.otherPartsFacade.setSupplierPartsAsBuilt(0, pageSizeValue, this.tableSupplierAsBuiltSortList, toAssetFilter(this.assetAsBuiltFilter, true)); + } else { + this.otherPartsFacade.setSupplierPartsAsBuilt(page, pageSizeValue, this.tableSupplierAsBuiltSortList); + } + } public onAsPlannedTableConfigChange({ page, pageSize, sorting }: TableEventConfig): void { this.setTableSortingList(sorting, MainAspectType.AS_PLANNED); - this.otherPartsFacade.setSupplierPartsAsPlanned(page, pageSize, this.tableSupplierAsPlannedSortList); + + let pageSizeValue = 50; + if (pageSize !== 0) { + pageSizeValue = pageSize; + } + + if (this.assetsAsPlannedFilter) { + this.otherPartsFacade.setSupplierPartsAsPlanned(0, pageSizeValue, this.tableSupplierAsPlannedSortList, toAssetFilter(this.assetsAsPlannedFilter, true)); + } else { + this.otherPartsFacade.setSupplierPartsAsPlanned(page, pageSizeValue, this.tableSupplierAsPlannedSortList); + } + } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 73ead38b33..b55838a54a 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -34,14 +34,14 @@ matTooltipPosition="above" [class.mdc-tooltip--multiline]="true" [matTooltipShowDelay]="1000" - [matTooltipDisabled]="roleService.hasAccess(['user','supervisor']) && mainAspectType === MainAspectType.AS_BUILT" + [matTooltipDisabled]="roleService.hasAccess(['user','supervisor']) && mainAspectType === MainAspectType.AS_BUILT && tableType != TableType.AS_BUILT_CUSTOMER" >
announcement From 943b1aa1f269ac1620c6736424cfad9a78d74f3a Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Mon, 4 Mar 2024 10:19:25 +0100 Subject: [PATCH 05/45] chore(bug): 542 add tests --- .../customer-parts.component.spec.ts | 52 ++++++++++++++---- .../supplier-parts.component.spec.ts | 54 +++++++++++++++---- 2 files changed, 87 insertions(+), 19 deletions(-) diff --git a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts index 2f698752cc..847c7b25f7 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts @@ -21,7 +21,7 @@ import { OtherPartsState } from '@page/other-parts/core/other-parts.state'; import { OtherPartsModule } from '@page/other-parts/other-parts.module'; import { PartsState } from '@page/parts/core/parts.state'; import { MainAspectType } from '@page/parts/model/mainAspectType.enum'; -import { toGlobalSearchAssetFilter } from '@shared/helper/filter-helper'; +import { toAssetFilter, toGlobalSearchAssetFilter } from '@shared/helper/filter-helper'; import { fireEvent, screen, waitFor } from '@testing-library/angular'; import { renderComponent } from '@tests/test-render.utils'; @@ -31,7 +31,7 @@ describe('CustomerPartsComponent', () => { let otherPartsState: OtherPartsState; beforeEach(() => (otherPartsState = new OtherPartsState())); - const renderCustomerParts = () => + const renderCustomerPartsAsBuilt = () => renderComponent(CustomerPartsComponent, { imports: [ OtherPartsModule ], providers: [ { provide: OtherPartsState, useFactory: () => otherPartsState }, { provide: PartsState } ], @@ -41,21 +41,31 @@ describe('CustomerPartsComponent', () => { }, }); + const renderCustomerPartsAsPlanned = () => + renderComponent(CustomerPartsComponent, { + imports: [ OtherPartsModule ], + providers: [ { provide: OtherPartsState, useFactory: () => otherPartsState }, { provide: PartsState } ], + roles: [ 'admin', 'wip' ], + componentInputs: { + bomLifecycle: MainAspectType.AS_PLANNED, + }, + }); + it('should render part table', async () => { - await renderCustomerParts(); + await renderCustomerPartsAsBuilt(); const tableElements = await waitFor(() => screen.getAllByTestId('table-component--test-id')); expect(tableElements.length).toEqual(1); }); it('should render table and display correct amount of rows', async () => { - await renderCustomerParts(); + await renderCustomerPartsAsBuilt(); const tableElement = await waitFor(() => screen.getByTestId('table-component--test-id')); expect(tableElement).toBeInTheDocument(); expect(tableElement.children[1].childElementCount).toEqual(5); }); it('sort customer parts after name column', async () => { - const { fixture } = await renderCustomerParts(); + const { fixture } = await renderCustomerPartsAsBuilt(); const customerPartsComponent = fixture.componentInstance; let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); @@ -66,7 +76,7 @@ describe('CustomerPartsComponent', () => { }); it('should multisort after column name and semanticModelId', async () => { - const { fixture } = await renderCustomerParts(); + const { fixture } = await renderCustomerPartsAsBuilt(); const customerPartsComponent = fixture.componentInstance; let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); @@ -98,7 +108,7 @@ describe('CustomerPartsComponent', () => { }); it('should reset sorting on third click', async () => { - const { fixture } = await renderCustomerParts(); + const { fixture } = await renderCustomerPartsAsBuilt(); const customerPartsComponent = fixture.componentInstance; customerPartsComponent.bomLifecycle = MainAspectType.AS_BUILT; fixture.detectChanges(); @@ -136,7 +146,7 @@ describe('CustomerPartsComponent', () => { it('should handle updateCustomerParts null', async () => { - const { fixture } = await renderCustomerParts(); + const { fixture } = await renderCustomerPartsAsBuilt(); const customerPartsComponent = fixture.componentInstance; const otherPartsFacade = (customerPartsComponent as any)['otherPartsFacade']; @@ -152,7 +162,7 @@ describe('CustomerPartsComponent', () => { }); it('should handle updateCustomerParts including search', async () => { - const { fixture } = await renderCustomerParts(); + const { fixture } = await renderCustomerPartsAsBuilt(); const customerPartsComponent = fixture.componentInstance; const otherPartsFacade = (customerPartsComponent as any)['otherPartsFacade']; @@ -168,4 +178,28 @@ describe('CustomerPartsComponent', () => { }); + it('should correctly react to table config change', async function() { + const { fixture } = await renderCustomerPartsAsPlanned(); + const customerPartsComponent = fixture.componentInstance; + const otherPartsFacade = (customerPartsComponent as any)['otherPartsFacade']; + const assetFilter = toAssetFilter({idShort: "test"}, false); + const tableSortingList = ["idShort","asc"]; + + customerPartsComponent.assetsAsPlannedFilter = assetFilter; + + let setCustomerPartsAsPlannedSpy = spyOn(otherPartsFacade,'setCustomerPartsAsPlanned'); + + customerPartsComponent.onAsPlannedTableConfigChange({page: 0, pageSize: 50, sorting: ["idShort","asc"]}); + + expect(setCustomerPartsAsPlannedSpy).toHaveBeenCalled(); + expect(setCustomerPartsAsPlannedSpy).toHaveBeenCalledWith(0,50, [tableSortingList], {idShort: 'test'}); + + customerPartsComponent.assetsAsPlannedFilter = null; + + customerPartsComponent.onAsPlannedTableConfigChange({page: 0, pageSize: 50, sorting: ["idShort", "asc"]}) + expect(setCustomerPartsAsPlannedSpy).toHaveBeenCalledWith(0,50,[tableSortingList]) + + + }) + }); diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts index 8342bccf7d..0e43d3d2d6 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts @@ -22,7 +22,7 @@ import { OtherPartsState } from '@page/other-parts/core/other-parts.state'; import { OtherPartsModule } from '@page/other-parts/other-parts.module'; import { PartsState } from '@page/parts/core/parts.state'; import { MainAspectType } from '@page/parts/model/mainAspectType.enum'; -import { toGlobalSearchAssetFilter } from '@shared/helper/filter-helper'; +import { toAssetFilter, toGlobalSearchAssetFilter } from '@shared/helper/filter-helper'; import { fireEvent, screen, waitFor } from '@testing-library/angular'; import { getTableCheckbox, renderComponent } from '@tests/test-render.utils'; @@ -32,7 +32,7 @@ describe('SupplierPartsComponent', () => { let otherPartsState: OtherPartsState; beforeEach(() => (otherPartsState = new OtherPartsState())); - const renderSupplierParts = ({ roles = [] } = {}) => + const renderSupplierPartsAsBuilt = ({ roles = [] } = {}) => renderComponent(SupplierPartsComponent, { imports: [ OtherPartsModule ], providers: [ { provide: OtherPartsState, useFactory: () => otherPartsState }, { provide: PartsState } ], @@ -42,15 +42,25 @@ describe('SupplierPartsComponent', () => { }, }); + const renderSupplierPartsAsPlanned = ({ roles = [] } = {}) => + renderComponent(SupplierPartsComponent, { + imports: [ OtherPartsModule ], + providers: [ { provide: OtherPartsState, useFactory: () => otherPartsState }, { provide: PartsState } ], + roles, + componentInputs: { + bomLifecycle: MainAspectType.AS_PLANNED, + }, + }); + it('should render part table', async () => { - await renderSupplierParts(); + await renderSupplierPartsAsBuilt(); const tableElements = await waitFor(() => screen.getAllByTestId('table-component--test-id')); expect(tableElements.length).toEqual(1); }); it('should render table and display correct amount of rows', async () => { - await renderSupplierParts(); + await renderSupplierPartsAsBuilt(); const tableElement = await waitFor(() => screen.getByTestId('table-component--test-id')); expect(tableElement).toBeInTheDocument(); @@ -58,7 +68,7 @@ describe('SupplierPartsComponent', () => { }); it('should add item to current list and then remove', async () => { - const { fixture } = await renderSupplierParts({ roles: [ 'user' ] }); + const { fixture } = await renderSupplierPartsAsBuilt({ roles: [ 'user' ] }); // first click to check checkbox fireEvent.click(await getTableCheckbox(screen, 0)); @@ -74,7 +84,7 @@ describe('SupplierPartsComponent', () => { }); it('sort supplier parts after name column', async () => { - const { fixture } = await renderSupplierParts({ roles: [ 'admin' ] }); + const { fixture } = await renderSupplierPartsAsBuilt({ roles: [ 'admin' ] }); const supplierPartsComponent = fixture.componentInstance; let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); @@ -85,7 +95,7 @@ describe('SupplierPartsComponent', () => { }); it('should multisort after column name and semanticModelId', async () => { - const { fixture } = await renderSupplierParts({ roles: [ 'admin' ] }); + const { fixture } = await renderSupplierPartsAsBuilt({ roles: [ 'admin' ] }); const supplierPartsComponent = fixture.componentInstance; let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); @@ -117,7 +127,7 @@ describe('SupplierPartsComponent', () => { }); it('should reset sorting on third click', async () => { - const { fixture } = await renderSupplierParts({ roles: [ 'admin' ] }); + const { fixture } = await renderSupplierPartsAsBuilt({ roles: [ 'admin' ] }); const supplierPartsComponent = fixture.componentInstance; let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); @@ -153,7 +163,7 @@ describe('SupplierPartsComponent', () => { it('should handle updateSupplierParts null', async () => { - const { fixture } = await renderSupplierParts(); + const { fixture } = await renderSupplierPartsAsBuilt(); const supplierPartsComponent = fixture.componentInstance; const otherPartsFacade = (supplierPartsComponent as any)['otherPartsFacade']; @@ -169,7 +179,7 @@ describe('SupplierPartsComponent', () => { }); it('should handle updateCustomerParts including search', async () => { - const { fixture } = await renderSupplierParts(); + const { fixture } = await renderSupplierPartsAsBuilt(); const supplierPartsComponent = fixture.componentInstance; const otherPartsFacade = (supplierPartsComponent as any)['otherPartsFacade']; @@ -186,5 +196,29 @@ describe('SupplierPartsComponent', () => { }); + it('should correctly react to table config change', async function() { + const { fixture } = await renderSupplierPartsAsPlanned(); + const supplierPartsComponent = fixture.componentInstance; + const otherPartsFacade = (supplierPartsComponent as any)['otherPartsFacade']; + const assetFilter = toAssetFilter({idShort: "test"}, false); + const tableSortingList = ["idShort","asc"]; + + supplierPartsComponent.assetsAsPlannedFilter = assetFilter; + + let setSupplierPartsAsPlannedSpy = spyOn(otherPartsFacade,'setSupplierPartsAsPlanned'); + + supplierPartsComponent.onAsPlannedTableConfigChange({page: 0, pageSize: 50, sorting: ["idShort","asc"]}); + + expect(setSupplierPartsAsPlannedSpy).toHaveBeenCalled(); + expect(setSupplierPartsAsPlannedSpy).toHaveBeenCalledWith(0,50, [tableSortingList], {idShort: 'test'}); + + supplierPartsComponent.assetsAsPlannedFilter = null; + + supplierPartsComponent.onAsPlannedTableConfigChange({page: 0, pageSize: 50, sorting: ["idShort", "asc"]}) + expect(setSupplierPartsAsPlannedSpy).toHaveBeenCalledWith(0,50,[tableSortingList]) + + + }) + }); From ca55dc17f588e27f6c336722916f9f2bec27752e Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Mon, 4 Mar 2024 14:56:29 +0100 Subject: [PATCH 06/45] chore(documentation): Update RELEASE.md documentation --- docs/RELEASE.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 8df5985220..b12c01b74c 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -24,14 +24,11 @@ Make sure eclipse / catena git repositories are in sync 16) Verify that an automatic pull request has been opened (Prepare Helm release for next version) 17) Validate that the versions within that pull requests are correct 18) Merge pull request (Prepare Helm release for next version) -19) Merge release branch into main +19) Merge release branch into main (when merging make sure to restore release branch since it should stay) 20) Open the github action for helm release generation: https://github.com/catenax-ng/tx-traceability-foss/actions/workflows/helm-chart-release.yaml 21) Execute it from main branch 22) Validate that the helm charts release has been generated within the release page -23) Repeat step 8 to 23 for tractus-x: [GitHub Releases page](https://github.com/eclipse-tractusx/traceability-foss/releases) -24) Sync catena and eclipse main branch - -// TODO @Martin Maul: -//1 We need to create a branch from the helm-environments branch which reflects the release state -// Create /release/helm-environments- not the helm version -//2 Make sure that the merged release branch will not be deleted +23) Create a new branch from release/1.0.0 and name it release/helm-environments-1.0.0 (helm app version not chart version) +24) Repeat step 8 to 23 for tractus-x: [GitHub Releases page](https://github.com/eclipse-tractusx/traceability-foss/releases) +25) Sync catena and eclipse main branch +26) Create a message in the Trace-X channel of the Eclipse Foundation Chat to notify the community about the new release (add a link to the tractus-x release) From b52071ab0799667b65f4c4eb5d5c3064ea118aba Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Mon, 4 Mar 2024 15:02:25 +0100 Subject: [PATCH 07/45] chore(documentation): Update RELEASE.md documentation --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39400db10f..39c900a206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [UNRELEASED - DD.MM.YYYY] +### Added + +### Changed +- Updated RELEASE.md to the latest release guide (added more steps) + ## [10.6.0 - 04.03.2024] ### Added From a7a409374b7def9942bb9029d601b95b9b47b2c8 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 5 Mar 2024 09:12:15 +0100 Subject: [PATCH 08/45] feature: 420 add contracts api to fetch EDC contract agreements --- .../openapi/traceability-foss-backend.json | 2492 +++++++++-------- .../mapper/ContractFieldMapper.java | 36 + .../mapper/ContractResponseMapper.java | 44 + .../application/rest/ContractsController.java | 106 + .../application/service/ContractsService.java | 27 + .../domain/exception/ContractException.java | 33 + .../contracts/domain/model/Contract.java | 38 + .../repository/ContractsRepository.java | 29 + .../domain/service/ContractsServiceImpl.java | 39 + .../model/ContractAgreementInfoView.java | 44 + .../repository/ContractsRepositoryImpl.java | 108 + ...paContractAgreementInfoViewRepository.java | 29 + .../application-integration-spring-boot.yml | 6 + tx-backend/src/main/resources/application.yml | 1 + .../main/resources/data/irs_assets_v4.json | 26 +- .../R__create_contract_agreement_view.sql | 8 + .../V16__add_created_column_to_assets.sql | 4 + .../common/config/RestitoConfig.java | 3 +- .../common/support/EdcSupport.java | 36 + .../contracts/ContractsControllerIT.java | 99 + .../all_contractagreements_response_200.json | 496 ++++ ...actagreement_negotiation_response_200.json | 20 + ..._page_contractagreements_response_200.json | 192 ++ ..._page_contractagreements_response_200.json | 192 ++ .../contract/response/ContractResponse.java | 41 + 25 files changed, 3015 insertions(+), 1134 deletions(-) create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/exception/ContractException.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/model/Contract.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java create mode 100644 tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql create mode 100644 tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql create mode 100644 tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java create mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/all_contractagreements_response_200.json create mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json create mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json create mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json create mode 100644 tx-models/src/main/java/contract/response/ContractResponse.java diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 3fd090f2fb..0b186b3795 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -46,29 +46,14 @@ "minItems" : 0, "type" : "array", "items" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "BPN Mappings", - "items" : { - "type" : "object", - "properties" : { - "bpn" : { - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "url" : { - "type" : "string", - "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" - } - } - } + "$ref" : "#/components/schemas/BpnEdcMappingResponse" } } } } }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -77,8 +62,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -87,8 +72,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -97,8 +82,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -107,8 +92,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -117,8 +102,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -127,8 +112,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -169,8 +154,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -179,8 +164,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -189,8 +174,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -199,8 +184,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -209,32 +194,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "BPN Mappings", - "items" : { - "type" : "object", - "properties" : { - "bpn" : { - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "url" : { - "type" : "string", - "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" - } - } - } - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -249,18 +214,23 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -301,8 +271,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -311,8 +281,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -321,8 +291,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -331,8 +301,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -341,32 +311,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "BPN Mappings", - "items" : { - "type" : "object", - "properties" : { - "bpn" : { - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "url" : { - "type" : "string", - "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" - } - } - } - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -381,18 +331,23 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -430,10 +385,14 @@ } ], "responses" : { - "200" : { - "description" : "Returns the paged result found", + "404" : { + "description" : "Not found.", "content" : { - "application/json" : {} + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } } }, "400" : { @@ -446,8 +405,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -466,8 +425,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -476,18 +435,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found", "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } + "application/json" : {} } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -496,8 +451,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -543,6 +498,22 @@ "required" : true }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "No Content.", + "content" : { + "application/json" : {} + } + }, "200" : { "description" : "Ok.", "content" : { @@ -559,8 +530,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -579,8 +550,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -589,12 +560,6 @@ } } }, - "204" : { - "description" : "No Content.", - "content" : { - "application/json" : {} - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -605,18 +570,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -654,8 +609,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -664,8 +619,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -674,8 +629,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -684,8 +639,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -694,8 +649,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -704,28 +659,28 @@ } } }, - "404" : { - "description" : "Not found.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } }, - "201" : { - "description" : "Created.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -774,11 +729,11 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." + "204" : { + "description" : "No content." }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -787,8 +742,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -797,8 +755,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -807,8 +765,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -817,8 +775,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -827,11 +785,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -840,8 +795,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -890,11 +845,11 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." + "204" : { + "description" : "No content." }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -903,8 +858,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -913,8 +871,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -923,8 +881,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -933,8 +891,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -943,11 +901,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -956,8 +911,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -996,9 +951,22 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Ok." }, + "204" : { + "description" : "No content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -1009,8 +977,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1029,8 +997,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1039,9 +1007,6 @@ } } }, - "204" : { - "description" : "No content." - }, "429" : { "description" : "Too many requests.", "content" : { @@ -1052,18 +1017,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1102,9 +1057,22 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Ok." }, + "204" : { + "description" : "No content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -1115,8 +1083,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1135,8 +1103,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1145,9 +1113,6 @@ } } }, - "204" : { - "description" : "No content." - }, "429" : { "description" : "Too many requests.", "content" : { @@ -1158,18 +1123,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1207,46 +1162,6 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -1312,16 +1227,17 @@ "example" : "2023-02-21T21:27:10.734950Z" }, "assetIds" : { - "maxLength" : 1000, "maxItems" : 1000, "minItems" : 0, "type" : "array", - "description" : "assetIds", "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" ], "items" : { - "type" : "string" + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" } }, "channel" : { @@ -1380,8 +1296,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1390,8 +1306,28 @@ } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1409,6 +1345,26 @@ } } } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -1439,8 +1395,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1449,8 +1405,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1459,8 +1415,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1469,8 +1425,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1479,8 +1435,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1489,28 +1445,28 @@ } } }, - "404" : { - "description" : "Not found.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/CreateNotificationContractResponse" } } } }, - "201" : { - "description" : "Created.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1549,6 +1505,16 @@ "required" : true }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "OK.", "content" : { @@ -1565,8 +1531,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1585,11 +1551,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1608,18 +1571,11 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } + "204" : { + "description" : "No Content." }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1665,6 +1621,16 @@ } }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "OK.", "content" : { @@ -1681,8 +1647,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1701,11 +1667,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1724,18 +1687,11 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } + "204" : { + "description" : "No Content." }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1773,8 +1729,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1783,8 +1739,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1793,8 +1749,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1803,8 +1759,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1813,8 +1769,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1823,8 +1779,11 @@ } } }, - "404" : { - "description" : "Not found.", + "201" : { + "description" : "Created." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1833,11 +1792,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1875,6 +1831,16 @@ "required" : true }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "400" : { "description" : "Bad request.", "content" : { @@ -1885,8 +1851,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1905,8 +1871,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2023,7 +1999,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -2088,6 +2066,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -2096,28 +2082,8 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2155,8 +2121,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2165,8 +2131,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2175,8 +2141,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2185,8 +2151,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2195,8 +2161,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2205,8 +2171,11 @@ } } }, - "404" : { - "description" : "Not found.", + "201" : { + "description" : "Created." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2215,11 +2184,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2257,8 +2223,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2267,8 +2233,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2277,8 +2243,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2287,8 +2253,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2297,8 +2263,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2415,7 +2381,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -2480,6 +2448,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -2488,8 +2464,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2498,8 +2474,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2537,18 +2513,8 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2557,8 +2523,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2577,8 +2543,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2587,8 +2553,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2607,8 +2573,18 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2657,8 +2633,11 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No content." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2667,8 +2646,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2677,8 +2656,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2687,8 +2666,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2697,8 +2676,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2707,11 +2686,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2720,8 +2696,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2770,11 +2746,11 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." + "204" : { + "description" : "No content." }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2783,8 +2759,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2793,8 +2772,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2803,8 +2782,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2813,8 +2792,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2823,11 +2802,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2836,8 +2812,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2876,9 +2852,22 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Ok." }, + "204" : { + "description" : "No content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -2889,8 +2878,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2909,8 +2898,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2919,9 +2908,6 @@ } } }, - "204" : { - "description" : "No content." - }, "429" : { "description" : "Too many requests.", "content" : { @@ -2932,18 +2918,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2982,9 +2958,22 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Ok." }, + "204" : { + "description" : "No content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -2995,8 +2984,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3015,8 +3004,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3025,9 +3014,6 @@ } } }, - "204" : { - "description" : "No content." - }, "429" : { "description" : "Too many requests.", "content" : { @@ -3038,18 +3024,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3147,16 +3123,17 @@ "example" : "2023-02-21T21:27:10.734950Z" }, "assetIds" : { - "maxLength" : 1000, "maxItems" : 1000, "minItems" : 0, "type" : "array", - "description" : "assetIds", "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" ], "items" : { - "type" : "string" + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" } }, "channel" : { @@ -3214,56 +3191,6 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -3274,45 +3201,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/as-planned/{assetId}" : { - "get" : { - "tags" : [ - "AssetsAsPlanned" - ], - "summary" : "Get asset by id", - "description" : "The endpoint returns an asset filtered by id .", - "operationId" : "assetById", - "parameters" : [ - { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { "400" : { "description" : "Bad request.", "content" : { @@ -3322,9 +3210,9 @@ } } } - }, - "401" : { - "description" : "Authorization failed.", + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3343,8 +3231,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3363,6 +3251,45 @@ } } }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/as-planned/{assetId}" : { + "get" : { + "tags" : [ + "AssetsAsPlanned" + ], + "summary" : "Get asset by id", + "description" : "The endpoint returns an asset filtered by id .", + "operationId" : "assetById", + "parameters" : [ + { + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { "404" : { "description" : "Not found.", "content" : { @@ -3477,7 +3404,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -3542,6 +3471,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -3549,6 +3486,36 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "500" : { "description" : "Internal server error.", "content" : { @@ -3558,6 +3525,26 @@ } } } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -3596,46 +3583,6 @@ "required" : true }, "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3740,7 +3687,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -3805,6 +3754,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -3812,8 +3769,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3822,8 +3779,28 @@ } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3841,6 +3818,26 @@ } } } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -3871,48 +3868,8 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4025,7 +3982,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -4090,6 +4049,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -4097,8 +4064,28 @@ } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4116,6 +4103,26 @@ } } } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -4258,7 +4265,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -4323,6 +4332,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -4330,8 +4347,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4340,8 +4357,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4350,8 +4367,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4360,8 +4377,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4370,8 +4387,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4380,8 +4397,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4390,8 +4407,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4419,8 +4436,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4429,8 +4446,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "202" : { + "description" : "Created registry reload job." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4439,8 +4459,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4449,8 +4469,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4459,11 +4479,8 @@ } } }, - "202" : { - "description" : "Created registry reload job." - }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4472,8 +4489,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4482,8 +4499,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4511,8 +4528,8 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4521,8 +4538,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4531,8 +4548,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4541,8 +4558,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4551,8 +4568,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4571,8 +4588,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4581,8 +4598,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4621,6 +4638,16 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "OK.", "content" : { @@ -4647,8 +4674,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4667,8 +4694,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4687,18 +4714,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4766,8 +4783,112 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/dashboard" : { + "get" : { + "tags" : [ + "Dashboard" + ], + "summary" : "Returns dashboard related data", + "description" : "The endpoint can return limited data based on the user role", + "operationId" : "dashboard", + "responses" : { + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4776,8 +4897,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4786,8 +4907,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4796,8 +4917,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4806,8 +4927,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4817,22 +4938,17 @@ } }, "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4841,8 +4957,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4861,17 +4977,28 @@ ] } }, - "/dashboard" : { + "/contracts" : { "get" : { "tags" : [ - "Dashboard" + "getContracts", + "Contracts" + ], + "summary" : "All contract agreements for all assets", + "description" : "This endpoint returns all contract agreements for alls assets in Trace-X", + "operationId" : "contracts", + "parameters" : [ + { + "name" : "pageable", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/OwnPageable" + } + } ], - "summary" : "Returns dashboard related data", - "description" : "The endpoint can return limited data based on the user role", - "operationId" : "dashboard", "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4880,18 +5007,24 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultContractResponse" + } } } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4910,8 +5043,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4920,8 +5053,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4930,18 +5063,18 @@ } } }, - "200" : { - "description" : "Returns dashboard data", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4990,8 +5123,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5000,8 +5133,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5010,8 +5143,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5020,11 +5153,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5033,8 +5163,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5043,8 +5173,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5053,8 +5183,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5100,28 +5233,8 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5238,7 +5351,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -5303,6 +5418,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -5311,8 +5434,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5321,8 +5444,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5331,8 +5454,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5350,6 +5473,26 @@ } } } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -5412,18 +5555,23 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5432,8 +5580,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5452,8 +5600,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5462,23 +5610,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5487,8 +5630,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5514,40 +5657,20 @@ ], "summary" : "Get asset by child id", "description" : "The endpoint returns an asset filtered by child id.", - "operationId" : "assetByChildIdAndAssetId", - "parameters" : [ - { - "name" : "childId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } + "operationId" : "assetByChildIdAndAssetId", + "parameters" : [ + { + "name" : "childId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } - }, - "415" : { - "description" : "Unsupported media type", + } + ], + "responses" : { + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5660,7 +5783,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -5725,6 +5850,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -5732,8 +5865,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5742,8 +5875,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5752,8 +5885,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5771,6 +5904,26 @@ } } } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -5809,56 +5962,6 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -5869,16 +5972,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -5987,7 +6080,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -6052,6 +6147,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -6059,6 +6162,66 @@ } } } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -6121,18 +6284,23 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6141,8 +6309,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6161,8 +6329,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6171,23 +6339,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6196,8 +6359,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6225,8 +6388,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6235,8 +6398,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6245,8 +6408,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6255,8 +6418,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6265,8 +6428,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6290,8 +6453,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6300,8 +6463,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6339,6 +6502,16 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "400" : { "description" : "Bad request.", "content" : { @@ -6349,8 +6522,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6369,8 +6542,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6483,7 +6656,9 @@ "SERIALPART", "UNKNOWN", "PARTASPLANNED", - "JUSTINSEQUENCE" + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" ] }, "classification" : { @@ -6548,6 +6723,14 @@ "importNote" : { "type" : "string", "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -6565,18 +6748,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6615,6 +6788,16 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "OK.", "content" : { @@ -6640,8 +6823,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6660,8 +6843,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6680,18 +6863,8 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6759,18 +6932,23 @@ } ], "responses" : { - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6779,8 +6957,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6799,8 +6977,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6809,23 +6987,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6834,8 +7007,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6863,11 +7036,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "200" : { - "description" : "Ok." - }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6876,8 +7046,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6886,8 +7059,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6896,8 +7069,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6906,8 +7079,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6919,8 +7092,8 @@ "204" : { "description" : "No Content." }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6929,8 +7102,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6971,8 +7144,8 @@ "200" : { "description" : "Okay" }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6981,8 +7154,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "204" : { + "description" : "Deleted." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6991,8 +7167,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -7001,8 +7177,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -7011,8 +7187,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7021,8 +7197,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -7031,8 +7207,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -7040,9 +7216,6 @@ } } } - }, - "204" : { - "description" : "Deleted." } }, "security" : [ @@ -7089,6 +7262,19 @@ } } }, + "BpnEdcMappingResponse" : { + "type" : "object", + "properties" : { + "bpn" : { + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "url" : { + "type" : "string", + "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" + } + } + }, "StartQualityNotificationRequest" : { "required" : [ "severity" @@ -7124,7 +7310,6 @@ }, "severity" : { "type" : "string", - "example" : "MINOR", "enum" : [ "MINOR", "MAJOR", @@ -7160,7 +7345,6 @@ "status" : { "type" : "string", "description" : "The UpdateInvestigationStatus", - "example" : "ACKNOWLEDGED", "enum" : [ "ACKNOWLEDGED", "ACCEPTED", @@ -7283,16 +7467,17 @@ "example" : "2023-02-21T21:27:10.734950Z" }, "assetIds" : { - "maxLength" : 1000, "maxItems" : 1000, "minItems" : 0, "type" : "array", - "description" : "assetIds", "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" ], "items" : { - "type" : "string" + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" } }, "channel" : { @@ -7687,16 +7872,17 @@ "example" : "2023-02-21T21:27:10.734950Z" }, "assetIds" : { - "maxLength" : 1000, "maxItems" : 1000, "minItems" : 0, "type" : "array", - "description" : "assetIds", "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" ], "items" : { - "type" : "string" + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" } }, "channel" : { @@ -7948,9 +8134,84 @@ } } }, - "ImportJob" : { + "ContractResponse" : { + "type" : "object", + "properties" : { + "contractId" : { + "maxLength" : 255, + "type" : "string", + "example" : "66" + }, + "counterpartyAddress" : { + "maxLength" : 255, + "type" : "string", + "example" : "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp" + }, + "creationDate" : { + "maxLength" : 255, + "type" : "string", + "format" : "date-time", + "example" : "2023-02-21T21:27:10.73495Z" + }, + "endDate" : { + "maxLength" : 255, + "type" : "string", + "format" : "date-time", + "example" : "2023-02-21T21:27:10.73495Z" + }, + "state" : { + "maxLength" : 255, + "type" : "string", + "example" : "FINALIZED" + } + } + }, + "PageResultContractResponse" : { + "type" : "object", + "properties" : { + "content" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "Content of PageResults", + "items" : { + "$ref" : "#/components/schemas/ContractResponse" + } + }, + "page" : { + "type" : "integer", + "format" : "int32", + "example" : 1 + }, + "pageCount" : { + "type" : "integer", + "format" : "int32", + "example" : 15 + }, + "pageSize" : { + "type" : "integer", + "format" : "int32", + "example" : 10 + }, + "totalItems" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + } + }, + "ImportJobResponse" : { "type" : "object", "properties" : { + "importJobStatus" : { + "type" : "string", + "enum" : [ + "INITIALIZING", + "RUNNING", + "ERROR", + "COMPLETED" + ] + }, "importId" : { "type" : "string", "example" : "456a952e-05eb-40dc-a6f2-9c2cb9c1387f" @@ -7964,15 +8225,6 @@ "maxLength" : 50, "type" : "string", "example" : "2099-02-21T21:27:10.734950Z" - }, - "importJobStatusResponse" : { - "type" : "string", - "enum" : [ - "INITIALIZING", - "RUNNING", - "CANCELLED", - "COMPLETED" - ] } } }, @@ -7980,24 +8232,20 @@ "type" : "object", "properties" : { "importJob" : { - "$ref" : "#/components/schemas/ImportJob" + "$ref" : "#/components/schemas/ImportJobResponse" }, "importedAsset" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/ImportedAsset" + "$ref" : "#/components/schemas/ImportedAssetResponse" } } } }, - "ImportedAsset" : { + "ImportedAssetResponse" : { "type" : "object", "properties" : { - "catenaxId" : { - "type" : "string", - "example" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}" - }, - "importStateResponse" : { + "importState" : { "type" : "string", "enum" : [ "TRANSIENT", @@ -8007,6 +8255,10 @@ "UNSET" ] }, + "catenaxId" : { + "type" : "string", + "example" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}" + }, "importedOn" : { "maxLength" : 50, "type" : "string", diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java new file mode 100644 index 0000000000..8bfaa4a3b2 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java @@ -0,0 +1,36 @@ +/******************************************************************************** + * 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.traceability.contracts.application.mapper; + +import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +public class ContractFieldMapper extends BaseRequestFieldMapper { + private static final Map SUPPORTED_ASSETS_AS_BUILT_FILTER_FIELDS = Map.ofEntries( + Map.entry("created", "created") + ); + + @Override + protected Map getSupportedFields() { + return SUPPORTED_ASSETS_AS_BUILT_FILTER_FIELDS; + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java new file mode 100644 index 0000000000..35d6d70f97 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java @@ -0,0 +1,44 @@ +/******************************************************************************** + * 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.traceability.contracts.application.mapper; + +import contract.response.ContractResponse; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; + +public class ContractResponseMapper { + public static PageResult from(PageResult contractPageResult) { + return new PageResult<>(contractPageResult.content().stream().map(ContractResponseMapper::from).toList(), + contractPageResult.page(), + contractPageResult.pageCount(), + contractPageResult.pageSize(), + contractPageResult.totalItems()); + } + + public static ContractResponse from(Contract contract) { + return ContractResponse.builder() + .contractId(contract.getContractId()) + .state(contract.getState()) + .counterpartyAddress(contract.getCounterpartyAddress()) + .endDate(contract.getEndDate()) + .creationDate(contract.getCreationDate()) + .build(); + } + +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java new file mode 100644 index 0000000000..3bd6e37c17 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java @@ -0,0 +1,106 @@ +/******************************************************************************** + * 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.traceability.contracts.application.rest; + +import assets.importpoc.ErrorResponse; +import contract.response.ContractResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.request.OwnPageable; +import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractFieldMapper; +import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractResponseMapper; +import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; +import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@PreAuthorize("hasAnyRole('ROLE_ADMIN')") +@Tag(name = "Contracts") +@RequestMapping(path = "/contracts", produces = "application/json", consumes = "application/json") +public class ContractsController { + private final ContractsService contractsService; + private final ContractFieldMapper contractFieldMapper; + + @Operation(operationId = "contracts", + summary = "All contract agreements for all assets", + tags = {"getContracts"}, + description = "This endpoint returns all contract agreements for alls assets in Trace-X", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Ok."), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) + @GetMapping + public PageResult getContracts(OwnPageable pageable) { + PageResult contracts = contractsService.getContracts(OwnPageable.toPageable(pageable, contractFieldMapper)); + return ContractResponseMapper.from(contracts); + } + +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java new file mode 100644 index 0000000000..d929cd9272 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java @@ -0,0 +1,27 @@ +/******************************************************************************** + * 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.traceability.contracts.application.service; + +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; +import org.springframework.data.domain.Pageable; + +public interface ContractsService { + PageResult getContracts(Pageable pageable); +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/exception/ContractException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/exception/ContractException.java new file mode 100644 index 0000000000..f205ba60bf --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/exception/ContractException.java @@ -0,0 +1,33 @@ +/******************************************************************************** + * 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.traceability.contracts.domain.exception; + +public class ContractException extends RuntimeException { + + + public ContractException(Throwable cause) { + super(cause); + } + + public ContractException(String message) { + super(message); + } + + +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/model/Contract.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/model/Contract.java new file mode 100644 index 0000000000..890e9f6ffe --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/model/Contract.java @@ -0,0 +1,38 @@ +/******************************************************************************** + * 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.traceability.contracts.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; + +import java.time.Instant; + +@Slf4j +@AllArgsConstructor +@Data +@Builder +public class Contract { + private String contractId; + private String counterpartyAddress; + private Instant creationDate; + private Instant endDate; + private String state; +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java new file mode 100644 index 0000000000..5ecb367ac7 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java @@ -0,0 +1,29 @@ +/******************************************************************************** + * 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.traceability.contracts.domain.repository; + +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; +import org.springframework.data.domain.Pageable; + +public interface ContractsRepository { + + PageResult getContractsByPageable(Pageable pageable); + +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java new file mode 100644 index 0000000000..97d61cd14e --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java @@ -0,0 +1,39 @@ +/******************************************************************************** + * 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.traceability.contracts.domain.service; + +import lombok.RequiredArgsConstructor; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; +import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; +import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Component; + +@RequiredArgsConstructor +@Component +public class ContractsServiceImpl implements ContractsService { + + private final ContractsRepository contractsRepository; + + @Override + public PageResult getContracts(Pageable pageable) { + return contractsRepository.getContractsByPageable(pageable); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java new file mode 100644 index 0000000000..3228755743 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java @@ -0,0 +1,44 @@ +/******************************************************************************** + * 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.traceability.contracts.infrastructure.model; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.SuperBuilder; +import org.springframework.data.annotation.Immutable; + +@Getter +@Setter +@NoArgsConstructor +@Entity +@SuperBuilder +@Table(name = "contract_agreement_info_view") +@Immutable +public class ContractAgreementInfoView { + + @Id + private String id; + private String contractAgreementId; + private String assetType; + +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java new file mode 100644 index 0000000000..1b740c5ec6 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -0,0 +1,108 @@ +/******************************************************************************** + * 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.traceability.contracts.infrastructure.repository; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.eclipse.tractusx.irs.edc.client.contract.model.EdcContractAgreementNegotiationResponse; +import org.eclipse.tractusx.irs.edc.client.contract.model.EdcContractAgreementsResponse; +import org.eclipse.tractusx.irs.edc.client.contract.model.exception.ContractAgreementException; +import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractAgreementService; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; +import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; +import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; +import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Component; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Component +@RequiredArgsConstructor +@Slf4j +public class ContractsRepositoryImpl implements ContractsRepository { + + private final EdcContractAgreementService edcContractAgreementService; + private final JpaContractAgreementInfoViewRepository contractAgreementInfoViewRepository; + + @Override + public PageResult getContractsByPageable(Pageable pageable) { + try { + Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(pageable); + + return new PageResult<>(fetchEdcContractAgreements(contractAgreementInfoViews), + contractAgreementInfoViews.getPageable().getPageNumber(), + contractAgreementInfoViews.getTotalPages(), + contractAgreementInfoViews.getPageable().getPageSize(), + contractAgreementInfoViews.getTotalElements()); + + } catch (ContractAgreementException e) { + throw new ContractException(e); + } + + } + + private List fetchEdcContractAgreements(Page contractAgreementInfoViews) throws ContractAgreementException { + String[] contractAgreementIds = contractAgreementInfoViews.getContent().stream().map(ContractAgreementInfoView::getContractAgreementId).toArray(String[]::new); + + List contractAgreements = edcContractAgreementService.getContractAgreements(contractAgreementIds); + + throwIfListDiverge(contractAgreementIds, contractAgreements); + + Map contractNegotiations = contractAgreements.stream() + .map(agreement -> new ImmutablePair<>(agreement.contractAgreementId(), + edcContractAgreementService.getContractAgreementNegotiation(agreement.contractAgreementId())) + ).collect(Collectors.toMap(ImmutablePair::getLeft, ImmutablePair::getRight)); + + + return contractAgreements.stream().map(contractAgreement -> + Contract.builder() + .contractId(contractAgreement.contractAgreementId()) + .counterpartyAddress(contractNegotiations.get(contractAgreement.contractAgreementId()).counterPartyAddress()) + .creationDate(Instant.ofEpochMilli(contractAgreement.contractSigningDate())) + .state(contractNegotiations.get(contractAgreement.contractAgreementId()).state()) + .build() + ).toList(); + } + + private void throwIfListDiverge(String[] contractAgreementIds, List contractAgreements) { + ArrayList givenList = new ArrayList<>(List.of(contractAgreementIds)); + Collections.sort(givenList); + + List expectedList = contractAgreements.stream() + .sorted(Comparator.comparing(EdcContractAgreementsResponse::contractAgreementId)) + .map(EdcContractAgreementsResponse::contractAgreementId) + .toList(); + + if (!givenList.equals(expectedList)) { + givenList.removeAll(expectedList); + throw new ContractException("Can not find the following contract agreement Ids in EDC: " + givenList); + } + } + +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java new file mode 100644 index 0000000000..889a67feaf --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java @@ -0,0 +1,29 @@ +/******************************************************************************** + * 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.traceability.contracts.infrastructure.repository; + +import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.stereotype.Repository; + +@Repository +public interface JpaContractAgreementInfoViewRepository extends JpaRepository, JpaSpecificationExecutor { + +} diff --git a/tx-backend/src/main/resources/application-integration-spring-boot.yml b/tx-backend/src/main/resources/application-integration-spring-boot.yml index 63a5ea310c..e063931068 100644 --- a/tx-backend/src/main/resources/application-integration-spring-boot.yml +++ b/tx-backend/src/main/resources/application-integration-spring-boot.yml @@ -139,3 +139,9 @@ feign: cors: origins: > "https://localhost:4200" + + +irs-edc-client: + controlplane: + api-key: + secret: "integration-tests" diff --git a/tx-backend/src/main/resources/application.yml b/tx-backend/src/main/resources/application.yml index d8406f8d1f..3075a8f91d 100644 --- a/tx-backend/src/main/resources/application.yml +++ b/tx-backend/src/main/resources/application.yml @@ -95,6 +95,7 @@ irs-edc-client: contract-negotiation: /v2/contractnegotiations # EDC consumer controlplane contract negotiation path transfer-process: /v2/transferprocesses # EDC consumer controlplane transfer process path state-suffix: /state # Path of the state suffix for contract negotiation and transfer process + contract-agreements: /v2/contractagreements # EDC consumer controlplane contract agreements path provider-suffix: /api/v1/dsp # Suffix to add to data requests to the EDC provider controlplane catalog-limit: 1000 # Max number of items to fetch from the EDC provider catalog catalog-page-size: 50 # Number of items to fetch at one page from the EDC provider catalog when using pagination diff --git a/tx-backend/src/main/resources/data/irs_assets_v4.json b/tx-backend/src/main/resources/data/irs_assets_v4.json index b0d49f311c..ef9e41d35d 100644 --- a/tx-backend/src/main/resources/data/irs_assets_v4.json +++ b/tx-backend/src/main/resources/data/irs_assets_v4.json @@ -235,7 +235,7 @@ ], "shells" : [ { - "contractAgreementId" : "abc", + "contractAgreementId" : "abc1", "payload" : { "administration" : null, "description" : [ @@ -314,7 +314,7 @@ } }, { - "contractAgreementId" : "abc", + "contractAgreementId" : "abc2", "payload" : { "administration" : null, "description" : [ @@ -393,7 +393,7 @@ } }, { - "contractAgreementId" : "abc", + "contractAgreementId" : "abc3", "payload" : { "administration" : null, "description" : [ @@ -472,7 +472,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc4", "payload": { "administration" : null, "description" : [ @@ -551,7 +551,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc5", "payload": { "administration" : null, "description" : [ @@ -606,7 +606,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc6", "payload": { "administration" : null, "description" : [ @@ -661,7 +661,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc7", "payload": { "administration" : null, "description" : [ @@ -716,7 +716,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc8", "payload": { "administration" : null, "description" : [ @@ -795,7 +795,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc9", "payload": { "administration" : null, "description" : [ @@ -874,7 +874,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc10", "payload": { "administration" : null, "description" : [ @@ -953,7 +953,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc11", "payload": { "administration" : null, "description" : [ @@ -1032,7 +1032,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc12", "payload": { "administration" : null, "description" : [ @@ -1087,7 +1087,7 @@ } }, { - "contractAgreementId": "abc", + "contractAgreementId" : "abc13", "payload": { "administration" : null, "description" : [ diff --git a/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql b/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql new file mode 100644 index 0000000000..e7ea7a28b8 --- /dev/null +++ b/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql @@ -0,0 +1,8 @@ +create or replace view contract_agreement_info_view as +SELECT * +FROM ((SELECT assets_as_built.id, contract_agreement_id, 'assets_as_built' as asset_type, created FROM assets_as_built) + UNION ALL + (SELECT assets_as_planned.id, contract_agreement_id, 'assets_as_planned' as asset_type, created + FROM assets_as_planned)) results +ORDER BY created DESC; + diff --git a/tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql b/tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql new file mode 100644 index 0000000000..9df2260d2c --- /dev/null +++ b/tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql @@ -0,0 +1,4 @@ +ALTER TABLE assets_as_planned + ADD COLUMN "created" timestamptz NULL DEFAULT now(); +ALTER TABLE assets_as_built + ADD COLUMN "created" timestamptz NULL DEFAULT now(); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java index bff127a847..cdee80d0f2 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java @@ -58,7 +58,8 @@ public void initialize(ConfigurableApplicationContext configurableApplicationCon "feign.registryApi.url=http://127.0.0.1:" + STUB_SERVER_PORT, "feign.registryApi.defaultBpn=BPNL00000003AYRE", "edc.provider-edc-url=http://localhost:" + STUB_SERVER_PORT, - "edc.callbackUrls=http://localhost:" + STUB_SERVER_PORT + "/callback/redirect" + "edc.callbackUrls=http://localhost:" + STUB_SERVER_PORT + "/callback/redirect", + "irs-edc-client.controlplane.endpoint.data=http://localhost:" + STUB_SERVER_PORT + "/management" ).applyTo(configurableApplicationContext.getEnvironment()); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java index bd1d6686a9..6a3182887c 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java @@ -24,11 +24,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.regex.Pattern; + import static com.xebialabs.restito.builder.stub.StubHttp.whenHttp; import static com.xebialabs.restito.builder.verify.VerifyHttp.verifyHttp; import static com.xebialabs.restito.semantics.Action.noContent; import static com.xebialabs.restito.semantics.Action.status; import static com.xebialabs.restito.semantics.Condition.composite; +import static com.xebialabs.restito.semantics.Condition.matchesUri; import static com.xebialabs.restito.semantics.Condition.method; import static com.xebialabs.restito.semantics.Condition.post; import static com.xebialabs.restito.semantics.Condition.startsWithUri; @@ -62,6 +65,37 @@ public void edcWillRemoveNotificationAsset() { ); } + public void edcWillReturnContractAgreements() { + whenHttp(restitoProvider.stubServer()).match( + post("/management/v2/contractagreements/request"), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.OK_200), + restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/all_contractagreements_response_200.json") + ); + } + + public void edcWillReturnPaginatedContractAgreements() { + whenHttp(restitoProvider.stubServer()).match( + post("/management/v2/contractagreements/request"), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.OK_200) + ).withSequence( + restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json"), + restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json")); + } + + public void edcWillReturnContractAgreementNegotiation() { + whenHttp(restitoProvider.stubServer()).match( + matchesUri(Pattern.compile("/management/v2/contractagreements/[\\w]+/negotiation")), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.OK_200), + restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json") + ); + } + public void edcWillFailToCreateNotificationAsset() { whenHttp(restitoProvider.stubServer()).match( post("/management/v2/assets"), @@ -167,4 +201,6 @@ public void verifyDeleteContractDefinitionEndpointCalledTimes(int times) { startsWithUri("/management/v2/contractdefinitions") ); } + + } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java new file mode 100644 index 0000000000..20e4a1ade9 --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java @@ -0,0 +1,99 @@ +/******************************************************************************** + * 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.traceability.integration.contracts; + +import io.restassured.http.ContentType; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; +import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; +import org.eclipse.tractusx.traceability.integration.common.support.EdcSupport; +import org.jose4j.lang.JoseException; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import static io.restassured.RestAssured.given; +import static org.assertj.core.api.Assertions.assertThat; +import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; + +public class ContractsControllerIT extends IntegrationTestSpecification { + + @Autowired + AssetsSupport assetsSupport; + + @Autowired + EdcSupport edcSupport; + + @Test + void shouldReturnContracts() throws JoseException { + //GIVEN + edcSupport.edcWillReturnContractAgreements(); + edcSupport.edcWillReturnContractAgreementNegotiation(); + assetsSupport.defaultAssetsStored(); + + //WHEN + PageResult contractResponsePageResult = given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .get("/api/contracts") + .then() + .log().all() + .statusCode(200) + .extract().body().as(PageResult.class); + //THEN + assertThat(contractResponsePageResult.content()).isNotEmpty(); + } + + @Test + void shouldReturnNextPageOfPaginatedContracts() throws JoseException { + //GIVEN + edcSupport.edcWillReturnPaginatedContractAgreements(); + edcSupport.edcWillReturnContractAgreementNegotiation(); + assetsSupport.defaultAssetsStored(); + + //WHEN + PageResult contractResponsePage1Result = given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .get("/api/contracts?size=5&page=0") + .then() + .log().all() + .statusCode(200) + .extract().body().as(PageResult.class); + + + PageResult contractResponsePage2Result = given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .get("/api/contracts?size=5&page=1") + .then() + .log().all() + .statusCode(200) + .extract().body().as(PageResult.class); + //THEN + assertThat(contractResponsePage1Result.content()).isNotEmpty(); + assertThat(contractResponsePage2Result.content()).isNotEmpty(); + } + +} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/all_contractagreements_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/all_contractagreements_response_200.json new file mode 100644 index 0000000000..dabb7a21c4 --- /dev/null +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/all_contractagreements_response_200.json @@ -0,0 +1,496 @@ +[ + { + "@type" : "edc:ContractAgreement", + "@id" : "abc1", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc2", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc3", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc4", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc5", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc6", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc7", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc8", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc9", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc10", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc11", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc12", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc13", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + } +] diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json new file mode 100644 index 0000000000..e99e592351 --- /dev/null +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json @@ -0,0 +1,20 @@ +{ + "@type" : "edc:ContractNegotiation", + "@id" : "a521a424-a07b-4a08-a845-676f2ddd0e89", + "edc:type" : "CONSUMER", + "edc:protocol" : "dataspace-protocol-http", + "edc:state" : "FINALIZED", + "edc:counterPartyId" : "BPNL00000003CML1", + "edc:counterPartyAddress" : "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp", + "edc:callbackAddresses" : [], + "edc:createdAt" : 1708590580001, + "edc:contractAgreementId" : "ODA3MmUyNTQtOGNlZi00YzQ2LTljNGYtNGYzNjE2YjQ5NTZl:cmVnaXN0cnktYXNzZXQ=:MDljNDMzY2EtODI5OS00OGE3LWI0MjYtNzZmZjJmODE1ZWE2", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } +} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json new file mode 100644 index 0000000000..5f0f720079 --- /dev/null +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json @@ -0,0 +1,192 @@ +[ + { + "@type" : "edc:ContractAgreement", + "@id" : "abc1", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc2", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc3", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc4", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc5", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + } +] diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json new file mode 100644 index 0000000000..13b119fcff --- /dev/null +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json @@ -0,0 +1,192 @@ +[ + { + "@type" : "edc:ContractAgreement", + "@id" : "abc6", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc7", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc8", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc9", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + }, + { + "@type" : "edc:ContractAgreement", + "@id" : "abc10", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + } +] diff --git a/tx-models/src/main/java/contract/response/ContractResponse.java b/tx-models/src/main/java/contract/response/ContractResponse.java new file mode 100644 index 0000000000..71627411e9 --- /dev/null +++ b/tx-models/src/main/java/contract/response/ContractResponse.java @@ -0,0 +1,41 @@ +/******************************************************************************** + * 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 contract.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.SuperBuilder; + +import java.time.Instant; + +@Data +@SuperBuilder +public class ContractResponse { + @Schema(example = "66", maxLength = 255) + private String contractId; + @Schema(example = "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp", maxLength = 255) + private String counterpartyAddress; + @Schema(example = "2023-02-21T21:27:10.734950Z", maxLength = 255) + private Instant creationDate; + @Schema(example = "2023-02-21T21:27:10.734950Z", maxLength = 255) + private Instant endDate; + @Schema(example = "FINALIZED", maxLength = 255) + private String state; + +} From 0ec18a44e1ec6e939db27c05e2e4ae809eee2884 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 5 Mar 2024 09:23:48 +0100 Subject: [PATCH 09/45] feature: 533 override tombstone to empty string after successful sync --- .../traceability/assets/infrastructure/base/irs/IrsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java index 68871346be..c95ee2c880 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java @@ -127,7 +127,7 @@ void saveOrUpdateAssets(AssetCallbackRepository repository, AssetBase asset) { if (!asset.getParentRelations().isEmpty()) { existingAsset.setParentRelations(asset.getParentRelations()); } - existingAsset.setTombstone(asset.getTombstone()); + existingAsset.setTombstone(asset.getTombstone() == null ? "" : asset.getTombstone()); repository.save(existingAsset); } else { repository.save(asset); From 2bf690e0f3b9392947c34592d530fcf33d62c73d Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 5 Mar 2024 12:43:16 +0100 Subject: [PATCH 10/45] feature: 533 add integration test --- .../contracts/ContractsControllerIT.java | 23 +++++++++++++++---- .../contract/response/ContractResponse.java | 4 ++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java index 20e4a1ade9..9511c58aa0 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java @@ -18,6 +18,8 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.integration.contracts; +import contract.response.ContractResponse; +import io.restassured.common.mapper.TypeRef; import io.restassured.http.ContentType; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; @@ -27,6 +29,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import java.util.stream.Collectors; + import static io.restassured.RestAssured.given; import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; @@ -69,7 +74,7 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { assetsSupport.defaultAssetsStored(); //WHEN - PageResult contractResponsePage1Result = given() + PageResult contractResponsePage1Result = given() .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .log().all() @@ -78,10 +83,11 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { .then() .log().all() .statusCode(200) - .extract().body().as(PageResult.class); + .extract().body().as(new TypeRef>() { + }); - PageResult contractResponsePage2Result = given() + PageResult contractResponsePage2Result = given() .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .log().all() @@ -90,10 +96,19 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { .then() .log().all() .statusCode(200) - .extract().body().as(PageResult.class); + .extract().body().as(new TypeRef>() { + }); //THEN + List firstContractagreementIds = List.of("abc1", "abc2", "abc3", "abc4", "abc5"); + List secondContractagreementIds = List.of("abc6", "abc7", "abc8", "abc9", "abc10"); + assertThat(contractResponsePage1Result.content()).isNotEmpty(); assertThat(contractResponsePage2Result.content()).isNotEmpty(); + + assertThat(contractResponsePage1Result.content().stream().map(ContractResponse::getContractId).collect(Collectors.toList())).containsAll(firstContractagreementIds); + assertThat(contractResponsePage2Result.content().stream().map(ContractResponse::getContractId).toList()).containsAll(secondContractagreementIds); + + } } diff --git a/tx-models/src/main/java/contract/response/ContractResponse.java b/tx-models/src/main/java/contract/response/ContractResponse.java index 71627411e9..4ecb53a664 100644 --- a/tx-models/src/main/java/contract/response/ContractResponse.java +++ b/tx-models/src/main/java/contract/response/ContractResponse.java @@ -19,12 +19,16 @@ package contract.response; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import java.time.Instant; @Data +@NoArgsConstructor +@AllArgsConstructor @SuperBuilder public class ContractResponse { @Schema(example = "66", maxLength = 255) From 71c21058957c3e0f1655fb28f7f254713f6ac1e8 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Tue, 5 Mar 2024 13:02:27 +0100 Subject: [PATCH 11/45] chore(notifications): 515 - adding send notification xception. --- .../AbstractQualityNotificationService.java | 4 +- .../alert/ReceiverAlertsControllerIT.java | 39 ++---------------- .../ReceiverInvestigationsControllerIT.java | 41 ------------------- 3 files changed, 6 insertions(+), 78 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index cbb3ee6d16..00098834af 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -58,7 +58,7 @@ public void update(Long notificationId, QualityNotificationStatus notificationSt updatedAlert = getNotificationPublisherService().updateNotificationPublisher(alert, notificationStatus, reason); } catch (SendNotificationException exception) { log.info("Notification status rollback", exception); - return; + throw new SendNotificationException(exception.getMessage()); } getQualityNotificationRepository().updateQualityNotificationEntity(updatedAlert); @@ -78,7 +78,7 @@ public void approve(Long notificationId) { approvedInvestigation = getNotificationPublisherService().approveNotification(notification); } catch (SendNotificationException exception) { log.info("Notification status rollback", exception); - return; + throw new SendNotificationException(exception.getMessage()); } getQualityNotificationRepository().updateQualityNotificationEntity(approvedInvestigation); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java index bc3de39353..ce3dc73923 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java @@ -20,11 +20,13 @@ package org.eclipse.tractusx.traceability.integration.qualitynotification.alert; import io.restassured.http.ContentType; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; import org.eclipse.tractusx.traceability.common.request.OwnPageable; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.common.request.SearchCriteriaRequestParam; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; +import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; @@ -47,41 +49,8 @@ class ReceiverAlertsControllerIT extends IntegrationTestSpecification { @Autowired AlertsSupport alertsSupport; - @Test - void ShouldAcknowledgeReceivedAlert() throws JoseException { - // given - var alertId = alertsSupport.defaultReceivedAlertStored(); - String filterString = "channel,EQUAL,RECEIVER,AND"; - - // when - given() - .contentType(ContentType.JSON) - .body( - """ - { - "status" : "ACKNOWLEDGED" - } - """ - ) - .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) - .when() - .post("/api/alerts/$alertId/update".replace("$alertId", alertId.toString())) - .then() - .statusCode(204); - - // then - given() - .header(oAuth2Support.jwtAuthorization(ADMIN)) - .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filterString)))) - .contentType(ContentType.JSON) - .when() - .post("/api/alerts/filter") - .then() - .statusCode(200) - .body("page", Matchers.is(0)) - .body("pageSize", Matchers.is(10)) - .body("content", Matchers.hasSize(1)); - } + @Autowired + AssetsSupport assetsSupport; @Test void shouldNotUpdateToAcknowledgedNonExistingAlert() throws JoseException { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java index 40099de4d0..af94073c1e 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java @@ -20,13 +20,8 @@ package org.eclipse.tractusx.traceability.integration.qualitynotification.investigation; import io.restassured.http.ContentType; -import lombok.val; -import org.eclipse.tractusx.traceability.common.request.OwnPageable; -import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; -import org.eclipse.tractusx.traceability.common.request.SearchCriteriaRequestParam; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; -import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -35,11 +30,9 @@ import org.springframework.beans.factory.annotation.Autowired; import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; -import java.util.List; import java.util.stream.Stream; import static io.restassured.RestAssured.given; -import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; import static org.eclipse.tractusx.traceability.common.security.JwtRole.SUPERVISOR; import static org.junit.jupiter.params.provider.Arguments.arguments; @@ -48,40 +41,6 @@ class ReceiverInvestigationsControllerIT extends IntegrationTestSpecification { @Autowired InvestigationsSupport investigationsSupport; - @Test - void ShouldAcknowledgeReceivedInvestigation() throws JoseException { - // given - val investigationId = investigationsSupport.defaultReceivedInvestigationStored(); - - // when - given() - .contentType(ContentType.JSON) - .body(""" - { - "status" : "ACKNOWLEDGED" - } - """) - .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) - .when() - .post("/api/investigations/{investigationId}/update", investigationId) - .then() - .statusCode(204); - - // then - given() - .header(oAuth2Support.jwtAuthorization(ADMIN)) - .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of()))) - .contentType(ContentType.JSON) - .when() - .post("/api/investigations/filter") - .then() - .statusCode(200) - .body("page", Matchers.is(0)) - .body("pageSize", Matchers.is(10)) - .body("content", Matchers.hasSize(1)) - .body("content.status", Matchers.containsInRelativeOrder("RECEIVED")); - } - @Test void shouldNotUpdateToAcknowledgedNonExistingInvestigation() throws JoseException { // given From 7e0523fc8b900de53f1904b3e6c463ca0812e246 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 5 Mar 2024 13:14:51 +0100 Subject: [PATCH 12/45] feature: 533 fix ambiguous method call --- .../service/EdcNotificationContractServiceTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java index 78f632137e..48e1ad4f93 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java @@ -45,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -127,7 +128,7 @@ void givenService_whenPolicyDefinitionServiceThrowsException_thenThrowException( when(edcNotificationAssetService.createNotificationAsset(any(), any(), any(), any())).thenReturn(notificationAssetId); when(traceabilityProperties.getUrl()).thenReturn("https://test"); when(traceabilityProperties.getRightOperand()).thenReturn(rightOperand); - doThrow(CreateEdcPolicyDefinitionException.class).when(edcPolicyDefinitionService).createAccessPolicy(any()); + doThrow(CreateEdcPolicyDefinitionException.class).when(edcPolicyDefinitionService).createAccessPolicy(anyString()); // when/then assertThrows(CreateNotificationContractException.class, () -> edcNotificationContractService.handle(request)); From 39485ef4ecd66a0df7fe8464a01b4906d271d385 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 5 Mar 2024 16:18:41 +0100 Subject: [PATCH 13/45] feature: 420 use PageAbleFilterRequest as request body; add integration tests --- .../mapper/ContractFieldMapper.java | 3 +- .../application/rest/ContractsController.java | 20 +++++++-- .../application/service/ContractsService.java | 3 +- .../repository/ContractsRepository.java | 3 +- .../domain/service/ContractsServiceImpl.java | 5 ++- .../model/ContractAgreementInfoView.java | 3 ++ .../repository/ContractSpecification.java | 42 +++++++++++++++++++ .../repository/ContractsRepositoryImpl.java | 12 +++++- .../common/support/EdcSupport.java | 10 +++++ .../contracts/ContractsControllerIT.java | 40 +++++++++++++++--- .../one_contractagreement_response_200.json | 40 ++++++++++++++++++ 11 files changed, 165 insertions(+), 16 deletions(-) create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java create mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java index 8bfaa4a3b2..16b4561e28 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java @@ -26,7 +26,8 @@ @Component public class ContractFieldMapper extends BaseRequestFieldMapper { private static final Map SUPPORTED_ASSETS_AS_BUILT_FILTER_FIELDS = Map.ofEntries( - Map.entry("created", "created") + Map.entry("created", "created"), + Map.entry("id", "id") ); @Override diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java index 3bd6e37c17..9fc3b0dde5 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java @@ -27,18 +27,24 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; +import org.apache.commons.collections.CollectionUtils; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.request.OwnPageable; +import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractFieldMapper; import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractResponseMapper; import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequiredArgsConstructor @PreAuthorize("hasAnyRole('ROLE_ADMIN')") @@ -97,9 +103,15 @@ public class ContractsController { content = @Content( mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) - @GetMapping - public PageResult getContracts(OwnPageable pageable) { - PageResult contracts = contractsService.getContracts(OwnPageable.toPageable(pageable, contractFieldMapper)); + @PostMapping + public PageResult getContracts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { + + if (CollectionUtils.isEmpty(pageableFilterRequest.getOwnPageable().getSort())) { + pageableFilterRequest.getOwnPageable().setSort(List.of("created,desc")); + } + + PageResult contracts = contractsService.getContracts(OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), contractFieldMapper), + pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(contractFieldMapper)); return ContractResponseMapper.from(contracts); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java index d929cd9272..f230ef8a40 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java @@ -19,9 +19,10 @@ package org.eclipse.tractusx.traceability.contracts.application.service; import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.springframework.data.domain.Pageable; public interface ContractsService { - PageResult getContracts(Pageable pageable); + PageResult getContracts(Pageable pageable, SearchCriteria searchCriteria); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java index 5ecb367ac7..067af7ac3d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java @@ -19,11 +19,12 @@ package org.eclipse.tractusx.traceability.contracts.domain.repository; import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.springframework.data.domain.Pageable; public interface ContractsRepository { - PageResult getContractsByPageable(Pageable pageable); + PageResult getContractsByPageable(Pageable pageable, SearchCriteria searchCriteria); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java index 97d61cd14e..0f8b16f4cc 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java @@ -20,6 +20,7 @@ import lombok.RequiredArgsConstructor; import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; @@ -33,7 +34,7 @@ public class ContractsServiceImpl implements ContractsService { private final ContractsRepository contractsRepository; @Override - public PageResult getContracts(Pageable pageable) { - return contractsRepository.getContractsByPageable(pageable); + public PageResult getContracts(Pageable pageable, SearchCriteria searchCriteria) { + return contractsRepository.getContractsByPageable(pageable, searchCriteria); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java index 3228755743..caf46bb3a4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java @@ -27,6 +27,8 @@ import lombok.experimental.SuperBuilder; import org.springframework.data.annotation.Immutable; +import java.time.Instant; + @Getter @Setter @NoArgsConstructor @@ -40,5 +42,6 @@ public class ContractAgreementInfoView { private String id; private String contractAgreementId; private String assetType; + private Instant created; } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java new file mode 100644 index 0000000000..f090c1feb0 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java @@ -0,0 +1,42 @@ +/******************************************************************************** + * Copyright (c) 2023 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.traceability.contracts.infrastructure.repository; + +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; +import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; +import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; +import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; +import org.jetbrains.annotations.NotNull; +import org.springframework.data.jpa.domain.Specification; + +public class ContractSpecification extends BaseSpecification implements Specification { + + public ContractSpecification(SearchCriteriaFilter criteria) { + super(criteria); + } + + @Override + public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { + return createPredicate(getSearchCriteriaFilter(), root, builder); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index 1b740c5ec6..7ab151028a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -26,12 +26,14 @@ import org.eclipse.tractusx.irs.edc.client.contract.model.exception.ContractAgreementException; import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractAgreementService; import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; import java.time.Instant; @@ -42,6 +44,8 @@ import java.util.Map; import java.util.stream.Collectors; +import static org.apache.commons.collections4.ListUtils.emptyIfNull; + @Component @RequiredArgsConstructor @Slf4j @@ -51,9 +55,13 @@ public class ContractsRepositoryImpl implements ContractsRepository { private final JpaContractAgreementInfoViewRepository contractAgreementInfoViewRepository; @Override - public PageResult getContractsByPageable(Pageable pageable) { + public PageResult getContractsByPageable(Pageable pageable, SearchCriteria searchCriteria) { try { - Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(pageable); + List contractAgreementSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream() + .map(ContractSpecification::new) + .toList(); + Specification specification = ContractSpecification.toSpecification(contractAgreementSpecifications); + Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); return new PageResult<>(fetchEdcContractAgreements(contractAgreementInfoViews), contractAgreementInfoViews.getPageable().getPageNumber(), diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java index 6a3182887c..54ca206f4f 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java @@ -75,6 +75,16 @@ public void edcWillReturnContractAgreements() { ); } + public void edcWillReturnOnlyOneContractAgreement() { + whenHttp(restitoProvider.stubServer()).match( + post("/management/v2/contractagreements/request"), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.OK_200), + restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json") + ); + } + public void edcWillReturnPaginatedContractAgreements() { whenHttp(restitoProvider.stubServer()).match( post("/management/v2/contractagreements/request"), diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java index 9511c58aa0..251c87225b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java @@ -22,6 +22,9 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.ContentType; import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.request.OwnPageable; +import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; +import org.eclipse.tractusx.traceability.common.request.SearchCriteriaRequestParam; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.eclipse.tractusx.traceability.integration.common.support.EdcSupport; @@ -52,16 +55,18 @@ void shouldReturnContracts() throws JoseException { assetsSupport.defaultAssetsStored(); //WHEN - PageResult contractResponsePageResult = given() + PageResult contractResponsePageResult = given() .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .log().all() .when() - .get("/api/contracts") + .body(new PageableFilterRequest()) + .post("/api/contracts") .then() .log().all() .statusCode(200) - .extract().body().as(PageResult.class); + .extract().body().as(new TypeRef>() { + }); //THEN assertThat(contractResponsePageResult.content()).isNotEmpty(); } @@ -79,7 +84,8 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { .contentType(ContentType.JSON) .log().all() .when() - .get("/api/contracts?size=5&page=0") + .body(PageableFilterRequest.builder().ownPageable(OwnPageable.builder().size(5).build()).build()) + .post("/api/contracts") .then() .log().all() .statusCode(200) @@ -92,7 +98,8 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { .contentType(ContentType.JSON) .log().all() .when() - .get("/api/contracts?size=5&page=1") + .body(PageableFilterRequest.builder().ownPageable(OwnPageable.builder().size(5).page(1).build()).build()) + .post("/api/contracts") .then() .log().all() .statusCode(200) @@ -107,8 +114,31 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { assertThat(contractResponsePage1Result.content().stream().map(ContractResponse::getContractId).collect(Collectors.toList())).containsAll(firstContractagreementIds); assertThat(contractResponsePage2Result.content().stream().map(ContractResponse::getContractId).toList()).containsAll(secondContractagreementIds); + } + @Test + void shouldReturnOnlyOneContract() throws JoseException { + //GIVEN + edcSupport.edcWillReturnOnlyOneContractAgreement(); + edcSupport.edcWillReturnContractAgreementNegotiation(); + assetsSupport.defaultAssetsStored(); + + //WHEN + PageResult contractResponsePageResult = given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .body(PageableFilterRequest.builder().searchCriteriaRequestParam(SearchCriteriaRequestParam.builder().filter(List.of("id,EQUAL,urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb,AND")).build()).build()) + .post("/api/contracts") + .then() + .log().all() + .statusCode(200) + .extract().body().as(new TypeRef>() { + }); + //THEN + assertThat(contractResponsePageResult.content()).isNotEmpty(); } } diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json new file mode 100644 index 0000000000..341a8b61b3 --- /dev/null +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json @@ -0,0 +1,40 @@ +[ + { + "@type" : "edc:ContractAgreement", + "@id" : "abc1", + "edc:assetId" : "registry-asset", + "edc:policy" : { + "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", + "@type" : "odrl:Set", + "odrl:permission" : { + "odrl:target" : "registry-asset", + "odrl:action" : { + "odrl:type" : "USE" + }, + "odrl:constraint" : { + "odrl:or" : { + "odrl:leftOperand" : "PURPOSE", + "odrl:operator" : { + "@id" : "odrl:eq" + }, + "odrl:rightOperand" : "ID 3.0 Trace" + } + } + }, + "odrl:prohibition" : [], + "odrl:obligation" : [], + "odrl:target" : "registry-asset" + }, + "edc:contractSigningDate" : 1708951087, + "edc:consumerId" : "BPNL00000003CML1", + "edc:providerId" : "BPNL00000003CML1", + "@context" : { + "dct" : "https://purl.org/dc/terms/", + "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", + "edc" : "https://w3id.org/edc/v0.0.1/ns/", + "dcat" : "https://www.w3.org/ns/dcat/", + "odrl" : "http://www.w3.org/ns/odrl/2/", + "dspace" : "https://w3id.org/dspace/v0.8/" + } + } +] From a499f83a6f6625b5392668ddc678f51e3b2beca6 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 5 Mar 2024 16:58:32 +0100 Subject: [PATCH 14/45] feature: 420 fix merge problems --- .../irs/model/response/factory/AssetMapperFactory.java | 3 +++ .../irs/model/response/mapping/submodel/MapperHelper.java | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java index be0d0b4e35..bb6f511e61 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java @@ -48,6 +48,7 @@ import static org.apache.commons.collections4.ListUtils.emptyIfNull; import static org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.mapping.submodel.MapperHelper.enrichAssetBase; import static org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.mapping.submodel.MapperHelper.enrichManufacturingInformation; +import static org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.mapping.submodel.MapperHelper.getContractAgreementId; import static org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.mapping.submodel.MapperHelper.getOwner; import static org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.mapping.submodel.MapperHelper.getShortId; @@ -90,6 +91,7 @@ private List toAssetBase(IRSResponse irsResponse, AssetBase assetBase = mapper.get().extractSubmodel(irsSubmodel); assetBase.setOwner(getOwner(assetBase, irsResponse)); assetBase.setIdShort(getShortId(irsResponse.shells(), assetBase.getId())); + assetBase.setContractAgreementId(getContractAgreementId(irsResponse.shells(), assetBase.getId())); enrichUpwardAndDownwardDescriptions(descriptionMap, assetBase); enrichManufacturingInformation(irsResponse, bpnMap, assetBase); @@ -107,6 +109,7 @@ private List toAssetBase(IRSResponse irsResponse, return submodelAssets; } + @NotNull private List extractPartSiteInformationAsPlanned(IRSResponse irsResponse) { return irsResponse diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java index b75fab09e4..3a8c83a3f7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java @@ -36,6 +36,14 @@ public static String getShortId(List shells, String globalAssetId) { return getShortIds(shells).get(globalAssetId); } + public static String getContractAgreementId(List shells, String globalAssetId) { + return shells.stream() + .filter(shell -> shell.payload().globalAssetId().equals(globalAssetId)) + .map(Shell::contractAgreementId) + .findFirst() + .orElse(""); + } + public static OffsetDateTime getOffsetDateTime(String date) { try { return OffsetDateTime.parse(date); From 7479b88eb97c292b0c539dd4bdba092b8a12018d Mon Sep 17 00:00:00 2001 From: ds-mkanal <100209308+mkanal@users.noreply.github.com> Date: Tue, 5 Mar 2024 21:07:19 +0100 Subject: [PATCH 15/45] add informartion to add issue number to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5f5e8a9a..ce8438e096 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_ + ## [UNRELEASED - DD.MM.YYYY] ### Added From ab7a916213f2ba5e14ba8826ccc6ea5cfdb88fa7 Mon Sep 17 00:00:00 2001 From: ds-mkanal <100209308+mkanal@users.noreply.github.com> Date: Tue, 5 Mar 2024 21:12:22 +0100 Subject: [PATCH 16/45] Update CONTRIBUTING and Changelog maintainance --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ace02fa04d..119b7cd8cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,6 +65,14 @@ https://www.eclipse.org/projects/handbook/#resources-commit ## General contribution to the project +### Maintaining [CHANGELOG.md](CHANGELOG.md) +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres +to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_ + ### Dash IP Prerequisites: 1) Create access token From 4342829110cf36b92b971a57db089fd7c9ef416e Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 08:35:13 +0100 Subject: [PATCH 17/45] feature: 420 add CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5f5e8a9a..b2e339c2b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added +- add /contracts api to fetch contract agreement information from EDC for assets + ### Changed - Updated RELEASE.md to the latest release guide (added more steps) From ca4a04cb13f9ce945d9f9d94d17ac42483e322cc Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 08:40:56 +0100 Subject: [PATCH 18/45] feature: 420 update swagger with new /contracts endpoint --- .../openapi/traceability-foss-backend.json | 2464 +++++++++-------- 1 file changed, 1343 insertions(+), 1121 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 7ad6a3adfd..10b12e5b96 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -37,8 +37,8 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -47,8 +47,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -57,17 +57,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -82,8 +77,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -92,18 +87,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -112,8 +112,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -154,23 +154,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -179,8 +174,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -199,8 +194,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -209,18 +204,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -229,8 +229,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -271,23 +271,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -296,8 +291,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -316,8 +311,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -326,18 +321,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -346,8 +346,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -385,8 +385,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -395,8 +395,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -405,8 +405,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -415,14 +415,8 @@ } } }, - "200" : { - "description" : "Returns the paged result found", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -431,8 +425,14 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the paged result found", + "content" : { + "application/json" : {} + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -441,8 +441,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -451,8 +451,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -498,14 +498,14 @@ "required" : true }, "responses" : { - "204" : { - "description" : "No Content.", + "200" : { + "description" : "Ok.", "content" : { "application/json" : {} } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -514,8 +514,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -524,8 +524,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -534,14 +534,8 @@ } } }, - "200" : { - "description" : "Ok.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -550,8 +544,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -560,8 +554,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -570,8 +564,14 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "No Content.", + "content" : { + "application/json" : {} + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -609,8 +609,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -619,8 +619,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -629,8 +629,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -639,8 +639,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -649,8 +649,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -659,28 +659,28 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } }, - "201" : { - "description" : "Created.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -729,11 +729,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -742,9 +739,9 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { + "400" : { + "description" : "Bad request.", + "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ErrorResponse" @@ -752,8 +749,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -762,8 +759,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -772,8 +769,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -782,8 +779,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -792,11 +795,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -845,11 +845,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -858,8 +855,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -868,8 +865,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -878,8 +875,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -888,8 +885,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -898,8 +895,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -908,11 +911,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -951,11 +951,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -964,8 +961,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -974,8 +971,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -984,8 +981,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -994,11 +991,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1007,8 +1001,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1017,8 +1017,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1057,11 +1057,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1070,8 +1067,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1080,8 +1077,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1090,8 +1087,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1100,11 +1097,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1113,8 +1107,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1123,8 +1123,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1162,66 +1162,6 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -1356,8 +1296,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1365,38 +1305,9 @@ } } } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/edc/notification/contract" : { - "post" : { - "tags" : [ - "Notifications" - ], - "summary" : "Triggers EDC notification contract", - "description" : "The endpoint Triggers EDC notification contract based on notification type and method", - "operationId" : "createNotificationContract", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractRequest" - } - } }, - "required" : true - }, - "responses" : { - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1405,8 +1316,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1425,9 +1336,19 @@ } } }, - "403" : { - "description" : "Forbidden.", - "content" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ErrorResponse" @@ -1444,6 +1365,45 @@ } } } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/edc/notification/contract" : { + "post" : { + "tags" : [ + "Notifications" + ], + "summary" : "Triggers EDC notification contract", + "description" : "The endpoint Triggers EDC notification contract based on notification type and method", + "operationId" : "createNotificationContract", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateNotificationContractRequest" + } + } + }, + "required" : true + }, + "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, "400" : { "description" : "Bad request.", @@ -1455,6 +1415,36 @@ } } }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "201" : { "description" : "Created.", "content" : { @@ -1465,8 +1455,18 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1485,28 +1485,28 @@ ] } }, - "/assets/publish" : { + "/contracts" : { "post" : { "tags" : [ - "AssetsImport", - "AssetsPublish" + "getContracts", + "Contracts" ], - "summary" : "asset publish", - "description" : "This endpoint publishes assets to the Catena-X network.", - "operationId" : "publishAssets", + "summary" : "All contract agreements for all assets", + "description" : "This endpoint returns all contract agreements for alls assets in Trace-X", + "operationId" : "contracts", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/RegisterAssetRequest" + "$ref" : "#/components/schemas/PageableFilterRequest" } } }, "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1515,8 +1515,18 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1535,17 +1545,34 @@ } } }, - "204" : { - "description" : "No Content." + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, "200" : { - "description" : "OK.", + "description" : "Ok.", "content" : { - "application/json" : {} + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultContractResponse" + } + } + } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1563,6 +1590,52 @@ } } } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/publish" : { + "post" : { + "tags" : [ + "AssetsImport", + "AssetsPublish" + ], + "summary" : "asset publish", + "description" : "This endpoint publishes assets to the Catena-X network.", + "operationId" : "publishAssets", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/RegisterAssetRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, "400" : { "description" : "Bad request.", @@ -1583,6 +1656,49 @@ } } } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "No Content." + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -1621,8 +1737,14 @@ } }, "responses" : { - "404" : { - "description" : "Not found.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1631,8 +1753,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1641,8 +1763,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1651,17 +1773,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1670,8 +1783,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1680,8 +1793,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No Content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1690,8 +1806,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1729,8 +1845,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1739,8 +1855,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1749,8 +1865,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1759,8 +1875,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1769,8 +1885,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1779,8 +1895,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1789,11 +1908,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1828,9 +1944,59 @@ } } }, - "required" : true - }, - "responses" : { + "required" : true + }, + "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -2010,6 +2176,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -2018,16 +2188,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -2038,26 +2198,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "401" : { "description" : "Authorization failed.", "content" : { @@ -2067,26 +2207,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -2117,8 +2237,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2127,8 +2247,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2137,8 +2257,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2147,8 +2267,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2157,8 +2277,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2167,8 +2287,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2177,11 +2300,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2219,18 +2339,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2239,8 +2349,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2249,8 +2359,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2259,8 +2369,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2269,8 +2379,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2458,6 +2568,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -2466,8 +2580,18 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2505,8 +2629,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2515,8 +2639,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2525,8 +2649,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2535,8 +2659,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2545,8 +2669,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2555,28 +2679,28 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } }, - "201" : { - "description" : "Created.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2625,8 +2749,8 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2635,8 +2759,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2645,8 +2769,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2655,8 +2779,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2665,8 +2789,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2675,8 +2799,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2685,11 +2812,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2738,11 +2862,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2751,8 +2872,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2761,8 +2882,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2771,8 +2892,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2781,8 +2902,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2791,8 +2912,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2801,11 +2928,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2844,11 +2968,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2857,8 +2978,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2867,8 +2988,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2877,8 +2998,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2887,11 +3008,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2900,8 +3018,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2910,8 +3034,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2950,11 +3074,8 @@ } ], "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2963,8 +3084,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2973,8 +3094,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2983,8 +3104,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2993,11 +3114,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3006,8 +3124,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Ok." + }, + "204" : { + "description" : "No content." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3016,8 +3140,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3055,36 +3179,6 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -3095,16 +3189,6 @@ } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3252,6 +3336,46 @@ } } } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -3282,6 +3406,56 @@ } ], "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -3457,6 +3631,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -3464,16 +3642,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -3484,48 +3652,8 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3571,36 +3699,6 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3776,6 +3874,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -3793,8 +3895,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3803,8 +3905,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3813,8 +3915,38 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3852,6 +3984,56 @@ } ], "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -4027,6 +4209,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -4034,16 +4220,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -4054,26 +4230,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "401" : { "description" : "Authorization failed.", "content" : { @@ -4083,26 +4239,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -4141,26 +4277,6 @@ "required" : true }, "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -4336,6 +4452,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -4343,8 +4463,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4353,8 +4473,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4363,8 +4483,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4373,8 +4493,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4383,8 +4503,28 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4412,8 +4552,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4422,8 +4562,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4432,21 +4572,18 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ErrorResponse" } - } - } - }, - "202" : { - "description" : "Created registry reload job." + } + } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4455,8 +4592,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4465,8 +4602,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "202" : { + "description" : "Created registry reload job." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4475,8 +4615,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4504,18 +4644,18 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Returns the policies", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4524,18 +4664,18 @@ } } }, - "200" : { - "description" : "Returns the policies", + "400" : { + "description" : "Bad request.", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4544,8 +4684,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4554,8 +4694,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4564,8 +4704,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4574,8 +4714,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4614,24 +4754,18 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "$ref" : "#/components/schemas/InvestigationResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4640,8 +4774,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4660,8 +4794,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4670,18 +4804,24 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : -2147483648, + "type" : "array", + "description" : "Investigations", + "items" : { + "$ref" : "#/components/schemas/InvestigationResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4690,8 +4830,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4759,8 +4899,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4769,8 +4909,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4779,8 +4919,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4789,8 +4929,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4799,8 +4939,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4824,8 +4964,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4834,8 +4974,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4863,18 +5003,18 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "200" : { - "description" : "Returns dashboard data", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4883,8 +5023,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4903,8 +5043,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4913,8 +5053,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4923,18 +5063,18 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4973,18 +5113,18 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4993,8 +5133,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5013,11 +5153,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5026,18 +5163,21 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "204" : { + "description" : "No Content." + }, + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5046,8 +5186,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5093,8 +5233,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5103,8 +5243,18 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5123,6 +5273,16 @@ } } }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -5302,6 +5462,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -5309,29 +5473,9 @@ } } } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5340,8 +5484,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5411,8 +5555,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5421,8 +5565,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5431,8 +5575,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5441,8 +5585,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5451,8 +5595,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5476,8 +5620,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5486,8 +5630,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5525,28 +5669,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5555,8 +5679,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5565,8 +5689,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5575,8 +5699,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5760,6 +5884,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -5767,8 +5895,28 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5814,8 +5962,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5824,8 +5972,18 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5844,6 +6002,16 @@ } } }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -6023,6 +6191,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -6031,8 +6203,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6050,26 +6222,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -6132,8 +6284,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6142,8 +6294,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6152,8 +6304,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6162,8 +6314,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6172,8 +6324,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6197,8 +6349,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6207,8 +6359,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6236,8 +6388,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6246,8 +6398,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6256,8 +6408,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6266,23 +6418,18 @@ } } }, - "200" : { - "description" : "Returns the assets found", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6291,18 +6438,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the assets found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6311,8 +6463,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6350,8 +6502,38 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6360,8 +6542,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6545,6 +6727,10 @@ "tombstone" : { "type" : "string", "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" } } } @@ -6552,18 +6738,8 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6581,26 +6757,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -6632,23 +6788,18 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6657,8 +6808,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6677,8 +6828,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6687,18 +6838,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "type" : "array", + "description" : "Alerts", + "items" : { + "$ref" : "#/components/schemas/AlertResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6707,8 +6863,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6776,8 +6932,8 @@ } ], "responses" : { - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6786,8 +6942,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6796,8 +6952,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6806,8 +6962,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6816,8 +6972,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6841,8 +6997,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6851,8 +7007,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6880,11 +7036,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6893,8 +7046,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6903,8 +7056,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6913,8 +7066,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6923,8 +7076,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6933,11 +7086,14 @@ } } }, + "200" : { + "description" : "Ok." + }, "204" : { "description" : "No Content." }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6946,8 +7102,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6985,11 +7141,8 @@ } ], "responses" : { - "204" : { - "description" : "Deleted." - }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6998,8 +7151,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -7008,11 +7161,8 @@ } } }, - "200" : { - "description" : "Okay" - }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -7021,8 +7171,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7031,8 +7181,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -7041,8 +7191,14 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Okay" + }, + "204" : { + "description" : "Deleted." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -7051,8 +7207,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -7094,6 +7250,18 @@ } } }, + "ErrorResponse" : { + "type" : "object", + "properties" : { + "message" : { + "maxLength" : 1000, + "minLength" : 0, + "pattern" : "^.*$", + "type" : "string", + "example" : "Access Denied" + } + } + }, "BpnEdcMappingResponse" : { "type" : "object", "properties" : { @@ -7107,18 +7275,6 @@ } } }, - "ErrorResponse" : { - "type" : "object", - "properties" : { - "message" : { - "maxLength" : 1000, - "minLength" : 0, - "pattern" : "^.*$", - "type" : "string", - "example" : "Access Denied" - } - } - }, "StartQualityNotificationRequest" : { "required" : [ "severity" @@ -7439,6 +7595,72 @@ } } }, + "ContractResponse" : { + "type" : "object", + "properties" : { + "contractId" : { + "maxLength" : 255, + "type" : "string", + "example" : "66" + }, + "counterpartyAddress" : { + "maxLength" : 255, + "type" : "string", + "example" : "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp" + }, + "creationDate" : { + "maxLength" : 255, + "type" : "string", + "format" : "date-time", + "example" : "2023-02-21T21:27:10.73495Z" + }, + "endDate" : { + "maxLength" : 255, + "type" : "string", + "format" : "date-time", + "example" : "2023-02-21T21:27:10.73495Z" + }, + "state" : { + "maxLength" : 255, + "type" : "string", + "example" : "FINALIZED" + } + } + }, + "PageResultContractResponse" : { + "type" : "object", + "properties" : { + "content" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "Content of PageResults", + "items" : { + "$ref" : "#/components/schemas/ContractResponse" + } + }, + "page" : { + "type" : "integer", + "format" : "int32", + "example" : 1 + }, + "pageCount" : { + "type" : "integer", + "format" : "int32", + "example" : 15 + }, + "pageSize" : { + "type" : "integer", + "format" : "int32", + "example" : 10 + }, + "totalItems" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + } + }, "RegisterAssetRequest" : { "required" : [ "assetIds", From 9c8aec0389770b7564b0ff302264111254b58a1e Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 09:02:16 +0100 Subject: [PATCH 19/45] feature: 420 fix code smells --- .../contracts/application/mapper/ContractResponseMapper.java | 3 +++ .../infrastructure/repository/ContractsRepositoryImpl.java | 3 ++- .../integration/contracts/ContractsControllerIT.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java index 35d6d70f97..6a8d02b4e3 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractResponseMapper.java @@ -23,6 +23,9 @@ import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; public class ContractResponseMapper { + + private ContractResponseMapper() { + } public static PageResult from(PageResult contractPageResult) { return new PageResult<>(contractPageResult.content().stream().map(ContractResponseMapper::from).toList(), contractPageResult.page(), diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index 7ab151028a..442522fb51 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractAgreementService; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; @@ -60,7 +61,7 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit List contractAgreementSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream() .map(ContractSpecification::new) .toList(); - Specification specification = ContractSpecification.toSpecification(contractAgreementSpecifications); + Specification specification = BaseSpecification.toSpecification(contractAgreementSpecifications); Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); return new PageResult<>(fetchEdcContractAgreements(contractAgreementInfoViews), diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java index 251c87225b..e8bc0ad382 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java @@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; -public class ContractsControllerIT extends IntegrationTestSpecification { +class ContractsControllerIT extends IntegrationTestSpecification { @Autowired AssetsSupport assetsSupport; From cfc5587909bb60af15d32e30ab01dc797e5c53fb Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 6 Mar 2024 09:29:10 +0100 Subject: [PATCH 20/45] chore(notifications): 515 - adding send notification xception. --- .../assets/infrastructure/base/irs/IrsService.java | 6 ------ .../base/irs/model/response/factory/AssetMapperFactory.java | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java index c55f2a7e9c..a7ccc422fe 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsService.java @@ -88,12 +88,6 @@ public IrsService( @Override public void createJobToResolveAssets(String globalAssetId, Direction direction, List aspects, BomLifecycle bomLifecycle) { RegisterJobRequest registerJobRequest = RegisterJobRequest.buildJobRequest(globalAssetId, traceabilityProperties.getBpn().toString(), direction, aspects, bomLifecycle, traceabilityProperties.getUrl()); - log.info("Build HTTP Request {}", registerJobRequest); - try { - log.info("Build HTTP Request as JSON {}", objectMapper.writeValueAsString(registerJobRequest)); - } catch (Exception e) { - log.error("exception", e); - } this.irsClient.registerJob(registerJobRequest); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java index be0d0b4e35..6c0f2b0255 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/factory/AssetMapperFactory.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.irs.component.Bpn; import org.eclipse.tractusx.irs.component.Relationship; import org.eclipse.tractusx.irs.component.enums.Direction; @@ -52,6 +53,7 @@ import static org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.mapping.submodel.MapperHelper.getShortId; @Component +@Slf4j @RequiredArgsConstructor public class AssetMapperFactory { @@ -71,7 +73,9 @@ public List mapToAssetBaseList(IRSResponse irsResponse) { List partSiteInformationAsPlanned = extractPartSiteInformationAsPlanned(irsResponse); List tombstones = TombstoneMapper.mapTombstones(irsResponse.jobStatus(), irsResponse.tombstones(), objectMapper); - + if (tombstones != null) { + log.info("Found {} tombstones", tombstones.size()); + } return toAssetBase(irsResponse, descriptionMap, bpnMap, tractionBatteryCode, partSiteInformationAsPlanned, tombstones); } From 99ae062b300cbccda70637421994443e60c8e657 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Wed, 6 Mar 2024 10:01:55 +0100 Subject: [PATCH 21/45] chore(515): change error message of toast --- frontend/src/app/modules/core/api/http-error.interceptor.ts | 4 ++-- .../modal/approve/approve-notification-modal.component.ts | 2 +- frontend/src/assets/locales/de/common.json | 4 ++-- frontend/src/assets/locales/en/common.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/modules/core/api/http-error.interceptor.ts b/frontend/src/app/modules/core/api/http-error.interceptor.ts index 231d408f7e..b323614348 100644 --- a/frontend/src/app/modules/core/api/http-error.interceptor.ts +++ b/frontend/src/app/modules/core/api/http-error.interceptor.ts @@ -46,7 +46,7 @@ export class HttpErrorInterceptor implements HttpInterceptor { const errorMessage = !error.message ? message : `Backend returned code ${ error.status }: ${ error.message }`; // Check if the request URL matches any pattern in the avoidList - if (this.shouldShowToast(request.url)) { + if (!this.isOnAlreadyHandledUrlList(request.url)) { this.toastService.error(errorMessage); } @@ -56,7 +56,7 @@ export class HttpErrorInterceptor implements HttpInterceptor { } // Helper method to check if the URL matches any pattern in the avoidList - private shouldShowToast(url: string): boolean { + private isOnAlreadyHandledUrlList(url: string): boolean { return !this.avoidList.some(pattern => this.urlMatchesPattern(url, pattern)); } diff --git a/frontend/src/app/modules/shared/modules/notification/modal/approve/approve-notification-modal.component.ts b/frontend/src/app/modules/shared/modules/notification/modal/approve/approve-notification-modal.component.ts index 8320df7143..0f21b9cf63 100644 --- a/frontend/src/app/modules/shared/modules/notification/modal/approve/approve-notification-modal.component.ts +++ b/frontend/src/app/modules/shared/modules/notification/modal/approve/approve-notification-modal.component.ts @@ -54,7 +54,7 @@ export class ApproveNotificationModalComponent { this.confirmActionCompleted.emit(); }, error: (err) => { - this.toastService.error(this.translationContext + '.modal.failedApprove', 5000,true, err.error.message); + this.toastService.error(this.translationContext + '.modal.failedApprove', 15000,true); }, }); }; diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index 3cf3593019..43dae35630 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -251,7 +251,7 @@ "successfullyDeclined": "Untersuchung wurde erfolgreich abgelehnt.", "failedAccept": "Untersuchung konnte nicht akzeptiert werden, bitte versuchen Sie es erneut.", "failedAcknowledge": "Untersuchung konnte nicht bestätigt werden, bitte versuchen Sie es erneut.", - "failedApprove": "Die Untersuchung konnte nicht genehmigt werden, bitte versuchen Sie es erneut.", + "failedApprove": "Die Qualitätsuntersuchung konnte nicht gesendet werden, bitte versuchen Sie es erneut.", "failedCancel": "Die Untersuchung konnte nicht gelöscht werden, bitte versuchen Sie es erneut.", "failedClose": "Die Untersuchung konnte nicht abgeschlossen werden, bitte versuchen Sie es erneut.", "failedDecline": "Untersuchung konnte nicht abgelehnt werden, bitte versuchen Sie es erneut." @@ -293,7 +293,7 @@ "successfullyDeclined": "Qualitätswarnung wurde erfolgreich abgelehnt.", "failedAccept": "Qualitätswarnung konnte nicht akzeptiert werden, bitte versuchen Sie es erneut.", "failedAcknowledge": "Qualitätswarnung konnte nicht bestätigt werden, bitte versuchen Sie es erneut.", - "failedApprove": "Die Qualitätswarnung konnte nicht genehmigt werden, bitte versuchen Sie es erneut.", + "failedApprove": "Die Qualitätswarnung konnte nicht gesendet werden, bitte versuchen Sie es erneut.", "failedCancel": "Die Qualitätswarnung konnte nicht gelöscht werden, bitte versuchen Sie es erneut.", "failedClose": "Die Qualitätswarnung konnte nicht abgeschlossen werden, bitte versuchen Sie es erneut.", "failedDecline": "Qualitätswarnung konnte nicht abgelehnt werden, bitte versuchen Sie es erneut." diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index b5637fd165..4b8dab2d62 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -253,7 +253,7 @@ "successfullyDeclined": "Investigation was declined successfully.", "failedAccept": "Investigation failed to accept, please try again.", "failedAcknowledge": "Investigation failed to acknowledge, please try again.", - "failedApprove": "Investigation failed to approve, please try again.", + "failedApprove": "Investigation failed to send, please try again.", "failedCancel": "Investigation failed to cancel, please try again.", "failedClose": "Investigation failed to close, please try again.", "failedDecline": "Investigation failed to decline, please try again." @@ -295,7 +295,7 @@ "successfullyDeclined": "Alert was declined successfully.", "failedAccept": "Alert failed to accept, please try again.", "failedAcknowledge": "Alert failed to acknowledge, please try again.", - "failedApprove": "Alert failed to approve, please try again.", + "failedApprove": "Alert failed to send, please try again.", "failedCancel": "Alert failed to cancel, please try again.", "failedClose": "Alert failed to close, please try again.", "failedDecline": "Alert failed to decline, please try again." From 51ee31d05b36f5c0c40f27a39bcb83fc0f880cf8 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Wed, 6 Mar 2024 10:33:05 +0100 Subject: [PATCH 22/45] chore(515): fix test --- .../src/app/modules/core/api/http-error-interceptor.spec.ts | 4 ++-- frontend/src/app/modules/core/api/http-error.interceptor.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/modules/core/api/http-error-interceptor.spec.ts b/frontend/src/app/modules/core/api/http-error-interceptor.spec.ts index aba543fe25..e110d78d45 100644 --- a/frontend/src/app/modules/core/api/http-error-interceptor.spec.ts +++ b/frontend/src/app/modules/core/api/http-error-interceptor.spec.ts @@ -57,7 +57,7 @@ describe('HttpErrorInterceptor', () => { it('should intercept', async () => { await initErrorInterceptor('403'); expect( - await waitFor(() => screen.getByText('Backend returned code 403: Permission denied error message')), - ).toBeInTheDocument(); + await waitFor(() => screen.queryByText('Backend returned code 403: Permission denied error message')), + ).not.toBeInTheDocument(); }); }); diff --git a/frontend/src/app/modules/core/api/http-error.interceptor.ts b/frontend/src/app/modules/core/api/http-error.interceptor.ts index b323614348..b948fbbbd4 100644 --- a/frontend/src/app/modules/core/api/http-error.interceptor.ts +++ b/frontend/src/app/modules/core/api/http-error.interceptor.ts @@ -64,6 +64,7 @@ export class HttpErrorInterceptor implements HttpInterceptor { private urlMatchesPattern(url: string, pattern: string): boolean { const regexPattern = pattern.replace(/\*/g, '.*'); const regex = new RegExp(`^${regexPattern}$`); + console.log(url, pattern, regex.test(url)); return regex.test(url); } From 8f23726fcd588d45873d837a0a808dfda4509400 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Wed, 6 Mar 2024 10:40:34 +0100 Subject: [PATCH 23/45] chore(515): fix test --- frontend/src/app/modules/core/api/http-error.interceptor.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/app/modules/core/api/http-error.interceptor.ts b/frontend/src/app/modules/core/api/http-error.interceptor.ts index b948fbbbd4..b323614348 100644 --- a/frontend/src/app/modules/core/api/http-error.interceptor.ts +++ b/frontend/src/app/modules/core/api/http-error.interceptor.ts @@ -64,7 +64,6 @@ export class HttpErrorInterceptor implements HttpInterceptor { private urlMatchesPattern(url: string, pattern: string): boolean { const regexPattern = pattern.replace(/\*/g, '.*'); const regex = new RegExp(`^${regexPattern}$`); - console.log(url, pattern, regex.test(url)); return regex.test(url); } From 9ee16dbd17159c3a97335b173bdf953929dd46fc Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 13:21:25 +0100 Subject: [PATCH 24/45] feature: 420 refactor --- .../mapping/submodel/MapperHelper.java | 2 +- .../semanticdatamodel/SemanticDataModel.java | 151 ------------------ .../mapper/ContractFieldMapper.java | 4 +- .../application/rest/ContractsController.java | 14 +- .../application/service/ContractsService.java | 5 +- .../domain/service/ContractsServiceImpl.java | 10 +- 6 files changed, 15 insertions(+), 171 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java index 3a8c83a3f7..9238e4a8be 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java @@ -41,7 +41,7 @@ public static String getContractAgreementId(List shells, String globalAss .filter(shell -> shell.payload().globalAssetId().equals(globalAssetId)) .map(Shell::contractAgreementId) .findFirst() - .orElse(""); + .orElse(null); } public static OffsetDateTime getOffsetDateTime(String date) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java index 2cc6a458d9..7b56b4f0af 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/SemanticDataModel.java @@ -25,32 +25,10 @@ import lombok.NoArgsConstructor; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.assets.domain.asbuilt.model.aspect.DetailAspectDataTractionBatteryCode; -import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; -import org.eclipse.tractusx.traceability.assets.domain.base.model.Descriptions; -import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportNote; -import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; -import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; -import org.eclipse.tractusx.traceability.assets.domain.base.model.QualityType; -import org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel; -import org.springframework.util.StringUtils; -import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicReference; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.BATCH; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.JUSTINSEQUENCE; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.SERIALPART; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel.extractDetailAspectModelTractionBatteryCode; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel.extractDetailAspectModelsAsBuilt; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel.extractDetailAspectModelsAsPlanned; -import static org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel.extractDetailAspectModelsPartSiteInformationAsPlanned; @Setter @Getter @@ -84,130 +62,6 @@ public SemanticDataModel( this.aspectType = aspectType; } - public Optional getLocalId(LocalIdKey key) { - return emptyIfNull(localIdentifiers).stream() - .filter(localId -> localId.key() == key) - .findFirst() - .map(LocalId::value); - } - - - public Optional getLocalIdByInput(LocalIdKey key, List localIds) { - return localIds.stream() - .filter(localId -> localId.key() == key) - .findFirst() - .map(LocalId::value); - } - - public AssetBase toDomainAsBuilt(List localIds, Map shortIds, Owner owner, Map bpns, List parentRelations, List childRelations, - Optional tractionBatteryCodeOptional, ImportState assetImportState, Map contractAgreementIds) { - final String manufacturerName = bpns.get(manufacturerId()); - ArrayList detailAspectModels = new ArrayList<>(); - - final AtomicReference semanticModelId = new AtomicReference<>(); - final AtomicReference semanticDataModel = new AtomicReference<>(); - - getLocalIdByInput(LocalIdKey.PART_INSTANCE_ID, localIds).ifPresent(s -> { - semanticModelId.set(s); - semanticDataModel.set(SERIALPART); - tractionBatteryCodeOptional.ifPresent(tbc -> detailAspectModels.add(extractDetailAspectModelTractionBatteryCode(tbc))); - }); - - getLocalIdByInput(LocalIdKey.BATCH_ID, localIds).ifPresent(s -> { - semanticModelId.set(s); - semanticDataModel.set(BATCH); - }); - - getLocalIdByInput(LocalIdKey.JIS_NUMBER, localIds).ifPresent(s -> { - semanticModelId.set(s); - semanticDataModel.set(org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.JUSTINSEQUENCE); - }); - - if (semanticDataModel.get() == null) { - semanticDataModel.set(org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.UNKNOWN); - } - - detailAspectModels.add(extractDetailAspectModelsAsBuilt(manufacturingInformation, partTypeInformation)); - - return AssetBase.builder() - .id(catenaXId()) - .idShort(defaultValue(shortIds.get(catenaXId()))) - .semanticModelId(semanticModelId.get()) - .detailAspectModels(detailAspectModels) - .manufacturerId(manufacturerId()) - .manufacturerName(defaultValue(manufacturerName)) - .nameAtManufacturer(partTypeInformation.nameAtManufacturer()) - .manufacturerPartId(partTypeInformation.manufacturerPartId()) - .parentRelations(parentRelations) - .childRelations(childRelations) - .owner(owner) - .classification(partTypeInformation.classification()) - .qualityType(QualityType.OK) - .semanticDataModel(semanticDataModel.get()) - .van(van()) - .importState(assetImportState) - .importNote(ImportNote.PERSISTED) - .contractAgreementId(contractAgreementIds.get(catenaXId())) - .build(); - } - - public AssetBase toDomainAsPlanned( - Map shortIds, - Owner owner, - Map bpns, - List parentRelations, - List childRelations, - String ownerBpn, - ImportState assetImportState, Map contractAgreementIds) { - final String manufacturerName = bpns.get(ownerBpn); - - List partSiteInfoAsPlanned = extractDetailAspectModelsPartSiteInformationAsPlanned(sites()); - DetailAspectModel asPlanned = extractDetailAspectModelsAsPlanned(validityPeriod); - - final List aspectModels = new ArrayList<>(partSiteInfoAsPlanned); - aspectModels.add(asPlanned); - - return AssetBase.builder() - .id(catenaXId()) - .idShort(defaultValue(shortIds.get(catenaXId()))) - .manufacturerId(ownerBpn) - .manufacturerName(defaultValue(manufacturerName)) - .nameAtManufacturer(partTypeInformation.nameAtManufacturer()) - .manufacturerPartId(partTypeInformation.manufacturerPartId()) - .parentRelations(parentRelations) - .detailAspectModels(aspectModels) - .childRelations(childRelations) - .owner(owner) - .classification(partTypeInformation.classification()) - .qualityType(QualityType.OK) - .semanticDataModel(org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.PARTASPLANNED) - .van(van()) - .importState(assetImportState) - .importNote(ImportNote.PERSISTED) - .contractAgreementId(contractAgreementIds.get(catenaXId())) - .build(); - } - - private String manufacturerId() { - return getLocalId(LocalIdKey.MANUFACTURER_ID) - .orElse("--"); - } - - private String defaultValue(String value) { - final String EMPTY_TEXT = "--"; - if (!StringUtils.hasText(value)) { - return EMPTY_TEXT; - } - return value; - } - - private String van() { - final String EMPTY_TEXT = "--"; - return getLocalId(LocalIdKey.VAN) - .orElse(EMPTY_TEXT); - } - public String catenaXId() { return catenaXId; } @@ -271,9 +125,4 @@ public boolean isAsBuilt() { return !aspectType.contains("AsPlanned"); } - - public static boolean isAsBuiltMainSemanticModel(org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel semanticDataModel) { - return semanticDataModel.equals(SERIALPART) || semanticDataModel.equals(BATCH) || semanticDataModel.equals(JUSTINSEQUENCE); - } - } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java index 16b4561e28..b71f93e9cb 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/mapper/ContractFieldMapper.java @@ -25,13 +25,13 @@ @Component public class ContractFieldMapper extends BaseRequestFieldMapper { - private static final Map SUPPORTED_ASSETS_AS_BUILT_FILTER_FIELDS = Map.ofEntries( + private static final Map SUPPORTED_CONTRACT_FILTER_FIELDS = Map.ofEntries( Map.entry("created", "created"), Map.entry("id", "id") ); @Override protected Map getSupportedFields() { - return SUPPORTED_ASSETS_AS_BUILT_FILTER_FIELDS; + return SUPPORTED_CONTRACT_FILTER_FIELDS; } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java index 9fc3b0dde5..c86f5f924c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java @@ -29,11 +29,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.apache.commons.collections.CollectionUtils; import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.request.OwnPageable; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; -import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractFieldMapper; import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractResponseMapper; import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; @@ -43,8 +40,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - @RestController @RequiredArgsConstructor @PreAuthorize("hasAnyRole('ROLE_ADMIN')") @@ -52,7 +47,6 @@ @RequestMapping(path = "/contracts", produces = "application/json", consumes = "application/json") public class ContractsController { private final ContractsService contractsService; - private final ContractFieldMapper contractFieldMapper; @Operation(operationId = "contracts", summary = "All contract agreements for all assets", @@ -105,13 +99,7 @@ public class ContractsController { schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping public PageResult getContracts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { - - if (CollectionUtils.isEmpty(pageableFilterRequest.getOwnPageable().getSort())) { - pageableFilterRequest.getOwnPageable().setSort(List.of("created,desc")); - } - - PageResult contracts = contractsService.getContracts(OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), contractFieldMapper), - pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(contractFieldMapper)); + PageResult contracts = contractsService.getContracts(pageableFilterRequest); return ContractResponseMapper.from(contracts); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java index f230ef8a40..1d2378cf85 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java @@ -19,10 +19,9 @@ package org.eclipse.tractusx.traceability.contracts.application.service; import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; -import org.springframework.data.domain.Pageable; public interface ContractsService { - PageResult getContracts(Pageable pageable, SearchCriteria searchCriteria); + PageResult getContracts(PageableFilterRequest pageableFilterRequest); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java index 0f8b16f4cc..672dc73d42 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java @@ -21,6 +21,9 @@ import lombok.RequiredArgsConstructor; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.request.OwnPageable; +import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; +import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractFieldMapper; import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; @@ -33,8 +36,13 @@ public class ContractsServiceImpl implements ContractsService { private final ContractsRepository contractsRepository; + private final ContractFieldMapper contractFieldMapper; + @Override - public PageResult getContracts(Pageable pageable, SearchCriteria searchCriteria) { + public PageResult getContracts(PageableFilterRequest pageableFilterRequest) { + Pageable pageable = OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), contractFieldMapper); + SearchCriteria searchCriteria = pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(contractFieldMapper); + return contractsRepository.getContractsByPageable(pageable, searchCriteria); } } From 83970172481ef4527cde70f7e6903b033714b017 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 13:33:50 +0100 Subject: [PATCH 25/45] feature: 420 add ContracException to ErrorHandlingConfig.java; refactor --- .../common/config/ErrorHandlingConfig.java | 11 ++++++++++- .../repository/ContractsRepositoryImpl.java | 4 ++++ ...t_agreement_id_and_created_timestamp_to_asset.sql} | 5 +++++ .../migration/V16__add_created_column_to_assets.sql | 4 ---- 4 files changed, 19 insertions(+), 5 deletions(-) rename tx-backend/src/main/resources/db/migration/{V15__add_contract_agreement_id_to_asset.sql => V15__add_contract_agreement_id_and_created_timestamp_to_asset.sql} (50%) delete mode 100644 tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index eea36aff70..6621f0ae6f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -40,14 +40,15 @@ import org.eclipse.tractusx.traceability.common.request.exception.InvalidFilterException; import org.eclipse.tractusx.traceability.common.request.exception.InvalidSortException; import org.eclipse.tractusx.traceability.common.security.TechnicalUserAuthorizationException; +import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractException; import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationReceiverBpnMismatchException; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationStatusTransitionNotAllowed; import org.eclipse.tractusx.traceability.submodel.domain.model.SubmodelNotFoundException; import org.springframework.context.support.DefaultMessageSourceResolvable; @@ -311,4 +312,12 @@ public ResponseEntity handleImportJobNotFoundException(final Impo return ResponseEntity.status(HttpStatus.NOT_FOUND) .body(new ErrorResponse(exception.getMessage())); } + + @ExceptionHandler(ContractException.class) + public ResponseEntity handleImportJobNotFoundException(final ContractException exception) { + log.error("ImportJobNotFoundException exception", exception); + + return ResponseEntity.status(HttpStatus.NOT_FOUND) + .body(new ErrorResponse(exception.getMessage())); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index 442522fb51..4efbbcc28c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractAgreementService; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; @@ -62,6 +63,9 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit .map(ContractSpecification::new) .toList(); Specification specification = BaseSpecification.toSpecification(contractAgreementSpecifications); + if (specification == null) { + specification = new ContractSpecification(SearchCriteriaFilter.builder().build()); + } Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); return new PageResult<>(fetchEdcContractAgreements(contractAgreementInfoViews), diff --git a/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql b/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_and_created_timestamp_to_asset.sql similarity index 50% rename from tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql rename to tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_and_created_timestamp_to_asset.sql index c0e6b086da..d44b336842 100644 --- a/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_to_asset.sql +++ b/tx-backend/src/main/resources/db/migration/V15__add_contract_agreement_id_and_created_timestamp_to_asset.sql @@ -2,3 +2,8 @@ ALTER TABLE assets_as_planned ADD COLUMN "contract_agreement_id" varchar(255) NULL; ALTER TABLE assets_as_built ADD COLUMN "contract_agreement_id" varchar(255) NULL; + +ALTER TABLE assets_as_planned + ADD COLUMN "created" timestamptz NULL DEFAULT now(); +ALTER TABLE assets_as_built + ADD COLUMN "created" timestamptz NULL DEFAULT now(); diff --git a/tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql b/tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql deleted file mode 100644 index 9df2260d2c..0000000000 --- a/tx-backend/src/main/resources/db/migration/V16__add_created_column_to_assets.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE assets_as_planned - ADD COLUMN "created" timestamptz NULL DEFAULT now(); -ALTER TABLE assets_as_built - ADD COLUMN "created" timestamptz NULL DEFAULT now(); From 02c208d28d916de35ee05a937a304abf05d153f2 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 14:11:53 +0100 Subject: [PATCH 26/45] feature: 420 refactor --- .../infrastructure/repository/ContractsRepositoryImpl.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index 4efbbcc28c..442522fb51 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -27,7 +27,6 @@ import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractAgreementService; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; -import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; @@ -63,9 +62,6 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit .map(ContractSpecification::new) .toList(); Specification specification = BaseSpecification.toSpecification(contractAgreementSpecifications); - if (specification == null) { - specification = new ContractSpecification(SearchCriteriaFilter.builder().build()); - } Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); return new PageResult<>(fetchEdcContractAgreements(contractAgreementInfoViews), From 89347114d87b331e5270aa1c70bdbde1a6ed14fe Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 15:10:42 +0100 Subject: [PATCH 27/45] feature: 420 add ROLE_SUPERVISOR to ContractsController.java --- .../contracts/application/rest/ContractsController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java index c86f5f924c..07e1d67b11 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java @@ -42,7 +42,7 @@ @RestController @RequiredArgsConstructor -@PreAuthorize("hasAnyRole('ROLE_ADMIN')") +@PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SUPERVISOR')") @Tag(name = "Contracts") @RequestMapping(path = "/contracts", produces = "application/json", consumes = "application/json") public class ContractsController { From 4d2843072f0ff8a4d28e62a72942d03889c30e85 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 6 Mar 2024 15:54:31 +0100 Subject: [PATCH 28/45] chore(docs): docu guru - some smaller doc fixxes and adding outdated tag. --- .../docs/arc42/building-block-view/whitebox-overall.adoc | 8 ++++++-- .../docs/arc42/cross-cutting/development-concepts.adoc | 3 +-- docs/src/docs/arc42/scope-context/technical-context.adoc | 6 +++--- docs/src/docs/arc42/solution-strategy/structure.adoc | 8 +++++++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/src/docs/arc42/building-block-view/whitebox-overall.adoc b/docs/src/docs/arc42/building-block-view/whitebox-overall.adoc index cf32779af0..24a87e1406 100644 --- a/docs/src/docs/arc42/building-block-view/whitebox-overall.adoc +++ b/docs/src/docs/arc42/building-block-view/whitebox-overall.adoc @@ -1,14 +1,17 @@ = Whitebox overall system -== Component diagram +== [Outdated] Component diagram [plantuml, target=whitebox-overview, format=svg] .... include::../../../uml-diagrams/arc42/building-block-view/whitebox_overall.puml[] .... -== Component description +== [Outdated] Component description + +|=== |Components |Description + |IRS |The IRS consumes relationship information across the CX-Network and builds the graph view. Within this Documentation, the focus lies on the IRS @@ -23,3 +26,4 @@ include::../../../uml-diagrams/arc42/building-block-view/whitebox_overall.puml[] |IAM/DAPS |DAPS as central Identity Provider +|=== diff --git a/docs/src/docs/arc42/cross-cutting/development-concepts.adoc b/docs/src/docs/arc42/cross-cutting/development-concepts.adoc index 0b83a6164a..762fd059e0 100644 --- a/docs/src/docs/arc42/cross-cutting/development-concepts.adoc +++ b/docs/src/docs/arc42/cross-cutting/development-concepts.adoc @@ -34,8 +34,7 @@ The generated OpenAPI specification file is automatically compared to a fixed, s == Migration -There currently is no data migration mechanism for TraceX. -In case the model of the persisted data (Jobs) changes, data is dropped and Jobs will need to be recreated. +Data Migration is handled by flyway. == Configurability diff --git a/docs/src/docs/arc42/scope-context/technical-context.adoc b/docs/src/docs/arc42/scope-context/technical-context.adoc index a1944d0814..3bc265f23c 100644 --- a/docs/src/docs/arc42/scope-context/technical-context.adoc +++ b/docs/src/docs/arc42/scope-context/technical-context.adoc @@ -13,7 +13,7 @@ In order to use Trace-X frontend with Trace-X backend, users need to authenticat By the frontend UI users provide valid credentials and the system generates a bearer token that it gets from Keycloak and attaches it to the HTTP header parameter Authorization. Then once a user is authorized and has proper role within Trace-X backend, the backend delegates HTTP calls to specific service in their behalf as technical user in order to fulfill specific functionality. -=== Registry API +=== [Outdated] Registry API [plantuml, target=technical-context-registry, format=svg] .... @@ -34,7 +34,7 @@ include::../../../uml-diagrams/arc42/scope-context/technical-context/irs-api-vie The Trace-X acts as a consumer of the IRS component. The Trace-X contains a Restful client (REST template) that build a REST call to the mentioned IRS API based on its known URL (the IRS URL is configurable in the Trace-X). Request contains details required to start IRS fetch job provided by the component during assets synchronization. Like described in the above section, the security aspect is required in order to achieve a REST call against the IRS. As a response, the Trace-X gets the created job id and periodically pulls for the job details that contains assets that will be uploaded to the system. And as mentioned above, the transport protocol HTTP(S) is used for the REST call communication. -=== Portal API +=== [Outdated] Portal API [plantuml, target=technical-context-portal, format=svg] .... @@ -44,7 +44,7 @@ include::../../../uml-diagrams/arc42/scope-context/technical-context/portal-api- The Trace-X acts as a consumer of the Portal component. The Trace-X contains a Restful client (REST template) that build a REST call to the mentioned Portal API based on its known URL (the Portal URL is configurable in the Trace-X). Request contains "bpns" provided by the component during sending notifications. Like described in the above section, the security aspect is required in order to achieve a REST call against the Portal. As a response, the Trace-X gets the corresponding BPN mappings to EDC urls where a notification should be send over. And as mentioned above, the transport protocol HTTP(S) is used for the REST call communication. -=== EDC API +=== [Outdated] EDC API [plantuml, target=technical-context-edc, format=svg] .... diff --git a/docs/src/docs/arc42/solution-strategy/structure.adoc b/docs/src/docs/arc42/solution-strategy/structure.adoc index 31bbfc234b..5971eaa2a9 100644 --- a/docs/src/docs/arc42/solution-strategy/structure.adoc +++ b/docs/src/docs/arc42/solution-strategy/structure.adoc @@ -6,8 +6,14 @@ It roughly can be broken down into the following parts: * Asset controllers to get the asset information * Dashboard controller to get dashboard related summed up information * Registry controller to fetch assets from the Digital Twin Registry -* Notification controllers to get notification information +* Notification controllers to get notification information and create edc notification offers * Submodel controller for providing asset data functionality +* Import controller for importing trace-x data for data provisioning. +* Contract controller to get information about contract agreements +* EDC controller to retrieve notifications +* IRS Callback controller to retrieve asynchronous jobs completed by IRS. +* Policy controller to retrieve information about policies +* BPN controller to retrieve information about business partners The backend does a request to the Digital Twin Registry utilizing the Registry controller. Extracted data from the response is made available through the Asset controller and the Dashboard controller to the Frontend. From 62b810628708b4089706b2fc48f81a55762a8f74 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 6 Mar 2024 16:43:04 +0100 Subject: [PATCH 29/45] feature: 420 not use null values in contract_agreement_info_view.contract_agreement_id --- .../db/migration/R__create_contract_agreement_view.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql b/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql index e7ea7a28b8..8acd513b1c 100644 --- a/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql +++ b/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql @@ -1,8 +1,11 @@ create or replace view contract_agreement_info_view as SELECT * -FROM ((SELECT assets_as_built.id, contract_agreement_id, 'assets_as_built' as asset_type, created FROM assets_as_built) +FROM ((SELECT assets_as_built.id, contract_agreement_id, 'assets_as_built' as asset_type, created + FROM assets_as_built + where contract_agreement_id is not null) UNION ALL (SELECT assets_as_planned.id, contract_agreement_id, 'assets_as_planned' as asset_type, created - FROM assets_as_planned)) results + FROM assets_as_planned + where contract_agreement_id is not null)) results ORDER BY created DESC; From 7ba6508af258c9fba2bb6cd6c8972c577d5d5af8 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Wed, 6 Mar 2024 16:44:12 +0100 Subject: [PATCH 30/45] chore(notifications): 515 fixed notification toast click area --- CHANGELOG.md | 1 + .../toast-message/toast-message.component.html | 15 ++++++++------- .../toast-message/toast-message.component.spec.ts | 4 ++-- .../toast-message/toast-message.component.ts | 7 +++++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fccb7b708d..31f0645e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha ### Changed - Updated RELEASE.md to the latest release guide (added more steps) +- #515 Fixed notification toast click area ## [10.6.0 - 04.03.2024] diff --git a/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.html b/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.html index 9cb406bdb2..6641630b6a 100644 --- a/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.html +++ b/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.html @@ -23,19 +23,20 @@ {{toastMessage.status}} -
diff --git a/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.spec.ts b/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.spec.ts index ce4b83e21f..e3f04d2706 100644 --- a/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.spec.ts +++ b/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.spec.ts @@ -51,9 +51,9 @@ describe('ToastMessageComponent', () => { it('should call toastService.emitClick() when handleClick is called', () => { // Arrange component.toastMessage = new ToastMessage(1, 'test', ToastStatus.Informative, 500); - + let event = new MouseEvent(""); // Act - component.handleClick(); + component.handleClick(event); // Assert expect(toastService.emitClick).toHaveBeenCalled(); diff --git a/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.ts b/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.ts index 1f4aacc606..32cbee3561 100644 --- a/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.ts +++ b/frontend/src/app/modules/shared/components/toasts/toast-message/toast-message.component.ts @@ -34,7 +34,10 @@ export class ToastMessageComponent { constructor(private toastService: ToastService) { } - handleClick() { - this.toastService.emitClick(); + handleClick(event: MouseEvent) { + event.stopPropagation(); + this.toastService.emitClick(); + + } } From bb6b4388614f5993b18085d7d40d97707bed0a66 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 7 Mar 2024 08:18:19 +0100 Subject: [PATCH 31/45] feature: 420 refactor --- .../repository/ContractsRepositoryImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index 442522fb51..3d73383282 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -77,7 +77,7 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit } private List fetchEdcContractAgreements(Page contractAgreementInfoViews) throws ContractAgreementException { - String[] contractAgreementIds = contractAgreementInfoViews.getContent().stream().map(ContractAgreementInfoView::getContractAgreementId).toArray(String[]::new); + List contractAgreementIds = contractAgreementInfoViews.getContent().stream().map(ContractAgreementInfoView::getContractAgreementId).toList(); List contractAgreements = edcContractAgreementService.getContractAgreements(contractAgreementIds); @@ -99,17 +99,17 @@ private List fetchEdcContractAgreements(Page contractAgreements) { - ArrayList givenList = new ArrayList<>(List.of(contractAgreementIds)); - Collections.sort(givenList); + private void throwIfListDiverge(List contractAgreementIds, List contractAgreements) { + ArrayList givenList = new ArrayList<>(contractAgreementIds); + Collections.sort(contractAgreementIds); List expectedList = contractAgreements.stream() .sorted(Comparator.comparing(EdcContractAgreementsResponse::contractAgreementId)) .map(EdcContractAgreementsResponse::contractAgreementId) .toList(); - if (!givenList.equals(expectedList)) { - givenList.removeAll(expectedList); + if (!contractAgreementIds.equals(expectedList)) { + contractAgreementIds.removeAll(expectedList); throw new ContractException("Can not find the following contract agreement Ids in EDC: " + givenList); } } From c0172d3b05649d62bed7d55092f48ab694714037 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 7 Mar 2024 08:34:57 +0100 Subject: [PATCH 32/45] feature: 420 refactor --- .../infrastructure/repository/ContractsRepositoryImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index 3d73383282..c211309517 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -101,15 +101,15 @@ private List fetchEdcContractAgreements(Page contractAgreementIds, List contractAgreements) { ArrayList givenList = new ArrayList<>(contractAgreementIds); - Collections.sort(contractAgreementIds); + Collections.sort(givenList); List expectedList = contractAgreements.stream() .sorted(Comparator.comparing(EdcContractAgreementsResponse::contractAgreementId)) .map(EdcContractAgreementsResponse::contractAgreementId) .toList(); - if (!contractAgreementIds.equals(expectedList)) { - contractAgreementIds.removeAll(expectedList); + if (!givenList.equals(expectedList)) { + givenList.removeAll(expectedList); throw new ContractException("Can not find the following contract agreement Ids in EDC: " + givenList); } } From 93ea2f089029b6274d65781e34e37ff2a2f94b79 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 7 Mar 2024 09:10:56 +0100 Subject: [PATCH 33/45] feat(notifications): 423 - quality notification refactoring. --- .../application/alert/rest/AlertController.java | 4 +++- .../base/service/QualityNotificationService.java | 4 ++-- .../contract/EdcNotificationContractController.java | 8 +++----- .../investigation/rest/InvestigationsController.java | 4 +++- ...ificationDomain.java => StartQualityNotification.java} | 8 ++++---- .../domain/alert/service/AlertServiceImpl.java | 4 ++-- .../domain/base/model/QualityNotification.java | 1 - .../domain/base/model/QualityNotificationSeverity.java | 6 ++---- .../domain/base/model/QualityNotificationStatus.java | 3 --- .../investigation/service/InvestigationServiceImpl.java | 4 ++-- .../repository/JpaInvestigationRepository.java | 6 ------ .../infrastructure/model/NotificationBaseEntity.java | 2 -- .../application/alert/rest/AlertControllerTest.java | 2 +- 13 files changed, 22 insertions(+), 34 deletions(-) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/{exception/StartQualityNotificationDomain.java => StartQualityNotification.java} (88%) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java index e0d998a716..fa47415ddb 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java @@ -62,7 +62,7 @@ import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain.from; +import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; import static org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus.from; @@ -75,6 +75,8 @@ public class AlertController { private final QualityNotificationService alertService; + + // TODO move to QualityNotificationService private final BaseRequestFieldMapper fieldMapper; public AlertController( diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java index f8ed5a561d..b750831392 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java @@ -20,7 +20,7 @@ import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain; +import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; @@ -31,7 +31,7 @@ public interface QualityNotificationService { - QualityNotificationId start(StartQualityNotificationDomain startQualityAlertDomain); + QualityNotificationId start(StartQualityNotification startQualityAlertDomain); QualityNotification find(Long notificationId); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/contract/EdcNotificationContractController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/contract/EdcNotificationContractController.java index 35f0f06386..c055eea661 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/contract/EdcNotificationContractController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/contract/EdcNotificationContractController.java @@ -20,6 +20,7 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.qualitynotification.application.contract; +import assets.importpoc.ErrorResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -28,7 +29,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; -import assets.importpoc.ErrorResponse; +import lombok.RequiredArgsConstructor; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractRequest; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractResponse; import org.eclipse.tractusx.traceability.qualitynotification.domain.contract.EdcNotificationContractService; @@ -45,15 +46,12 @@ @RestController @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @Tag(name = "Notifications") +@RequiredArgsConstructor @RequestMapping(path = "/edc/notification", produces = "application/json", consumes = "application/json") public class EdcNotificationContractController { private final EdcNotificationContractService edcNotificationContractService; - public EdcNotificationContractController(EdcNotificationContractService edcNotificationContractService) { - this.edcNotificationContractService = edcNotificationContractService; - } - @Operation(operationId = "createNotificationContract", summary = "Triggers EDC notification contract", tags = {"Notifications"}, diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java index 8a5501a5c2..49aa4d522e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java @@ -64,7 +64,7 @@ import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain.from; +import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; import static org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus.from; @RestController @@ -76,6 +76,8 @@ public class InvestigationsController { private final QualityNotificationService investigationService; + + // TODO move to QualityNotificationService private final BaseRequestFieldMapper fieldMapper; public InvestigationsController( diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/StartQualityNotificationDomain.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java similarity index 88% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/StartQualityNotificationDomain.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java index 035038fdd7..776f86f7c5 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/StartQualityNotificationDomain.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model; import lombok.Builder; import lombok.Data; @@ -31,7 +31,7 @@ @Builder @Getter @Data -public class StartQualityNotificationDomain { +public class StartQualityNotification { private List partIds; @@ -46,8 +46,8 @@ public class StartQualityNotificationDomain { private String receiverBpn; - public static StartQualityNotificationDomain from(StartQualityNotificationRequest startQualityNotificationRequest) { - return StartQualityNotificationDomain.builder() + public static StartQualityNotification from(StartQualityNotificationRequest startQualityNotificationRequest) { + return StartQualityNotification.builder() .partIds(startQualityNotificationRequest.getPartIds()) .description(startQualityNotificationRequest.getDescription()) .targetDate(startQualityNotificationRequest.getTargetDate()) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java index 61dc80188c..7131f6187b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java @@ -23,7 +23,7 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.service.AssetAsBuiltServiceImpl; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain; +import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; @@ -52,7 +52,7 @@ protected QualityNotificationRepository getQualityNotificationRepository() { } @Override - public QualityNotificationId start(StartQualityNotificationDomain startQualityAlertDomain) { + public QualityNotificationId start(StartQualityNotification startQualityAlertDomain) { QualityNotification notification = notificationPublisherService.startAlert(startQualityAlertDomain.getPartIds(), startQualityAlertDomain.getDescription(), startQualityAlertDomain.getTargetDate(), startQualityAlertDomain.getSeverity(), startQualityAlertDomain.getReceiverBpn(), startQualityAlertDomain.isAsBuilt()); QualityNotificationId createdAlertId = alertRepository.saveQualityNotificationEntity(notification); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java index 1ff669971e..460bd75c3d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java @@ -42,7 +42,6 @@ public class QualityNotification { private QualityNotificationId notificationId; private QualityNotificationStatus notificationStatus; private String description; - // TODO date private Instant createdAt; private QualityNotificationSide notificationSide; @Builder.Default diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationSeverity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationSeverity.java index 82a271147e..d05fc8a9f3 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationSeverity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationSeverity.java @@ -20,8 +20,10 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.base.model; import io.swagger.annotations.ApiModel; +import lombok.Getter; import qualitynotification.base.request.QualityNotificationSeverityRequest; +@Getter @ApiModel(description = "Describes the criticality of a notification") public enum QualityNotificationSeverity { MINOR("MINOR"), @@ -44,10 +46,6 @@ public static QualityNotificationSeverity fromString(String str) { throw new IllegalArgumentException("No enum constant " + QualityNotificationSeverity.class.getCanonicalName() + "." + str); } - public String getRealName() { - return realName; - } - public static QualityNotificationSeverity from(QualityNotificationSeverityRequest qualityNotificationSeverityRequest) { return QualityNotificationSeverity.fromString(qualityNotificationSeverityRequest.getRealName()); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationStatus.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationStatus.java index ee13f5c815..417a6e00ec 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationStatus.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationStatus.java @@ -99,9 +99,6 @@ public boolean isActiveState() { return ACTIVE_STATES.contains(this); } - public static List getActiveStates() { - return ACTIVE_STATES; - } public static QualityNotificationStatus from(QualityNotificationStatusRequest qualityNotificationStatusRequest) { return QualityNotificationStatus.fromStringValue(qualityNotificationStatusRequest.name()); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java index b644da4fac..a5e4399cee 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java @@ -22,7 +22,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.service.AssetAsBuiltServiceImpl; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain; +import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; @@ -52,7 +52,7 @@ protected QualityNotificationRepository getQualityNotificationRepository() { } @Override - public QualityNotificationId start(StartQualityNotificationDomain startQualityAlertDomain) { + public QualityNotificationId start(StartQualityNotification startQualityAlertDomain) { QualityNotification notification = getNotificationPublisherService().startInvestigation(startQualityAlertDomain.getPartIds(), startQualityAlertDomain.getDescription(), startQualityAlertDomain.getTargetDate(), startQualityAlertDomain.getSeverity(), startQualityAlertDomain.getReceiverBpn(), startQualityAlertDomain.isAsBuilt()); QualityNotificationId createdInvestigationId = getQualityNotificationRepository().saveQualityNotificationEntity(notification); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java index 6e3cc66bb8..cb17745096 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java @@ -24,8 +24,6 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; @@ -38,10 +36,6 @@ @Repository public interface JpaInvestigationRepository extends JpaRepository, JpaSpecificationExecutor { - Page findAllBySideEquals(NotificationSideBaseEntity investigationSide, Pageable pageable); - - long countAllByStatusEquals(NotificationStatusBaseEntity status); - long countAllBySideEquals(NotificationSideBaseEntity investigationSide); @Query("SELECT investigation FROM InvestigationEntity investigation JOIN investigation.notifications notification WHERE notification.edcNotificationId = :edcNotificationId") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java index 16e05ee014..fd5eb557bf 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java @@ -44,10 +44,8 @@ public class NotificationBaseEntity { private String acceptReason; private String declineReason; private String description; - // TODO date @Column(name = "created") private Instant createdDate; - // TODO date private Instant updated; @Enumerated(EnumType.STRING) private NotificationSideBaseEntity side; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java index 828f56ba9a..e3ca9104f4 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java @@ -47,7 +47,7 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain.from; +import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; From 5cde3728c6d17259e1d770bef783119a4d66df3d Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 7 Mar 2024 09:11:16 +0100 Subject: [PATCH 34/45] feature: 420 add logs --- .../infrastructure/repository/ContractsRepositoryImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index c211309517..e14b04fa58 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -78,6 +78,7 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit private List fetchEdcContractAgreements(Page contractAgreementInfoViews) throws ContractAgreementException { List contractAgreementIds = contractAgreementInfoViews.getContent().stream().map(ContractAgreementInfoView::getContractAgreementId).toList(); + log.info("Trying to fetch contractAgreementIds from EDC: " + contractAgreementIds); List contractAgreements = edcContractAgreementService.getContractAgreements(contractAgreementIds); @@ -107,6 +108,7 @@ private void throwIfListDiverge(List contractAgreementIds, List Date: Thu, 7 Mar 2024 10:37:16 +0100 Subject: [PATCH 35/45] chore(contracts): 625 removed breadcrumbs and header section from layout --- CHANGELOG.md | 3 + .../core/layout/header/header.component.html | 10 -- .../layout/layout/layout.component.spec.ts | 2 +- .../core/layout/layout/layout.component.ts | 4 +- .../breadcrumbs/breadcrumbs.component.html | 32 ------ .../breadcrumbs/breadcrumbs.component.scss | 63 ----------- .../breadcrumbs/breadcrumbs.component.spec.ts | 74 ------------ .../breadcrumbs/breadcrumbs.component.ts | 105 ------------------ .../breadcrumbs/breadcrumbs.model.ts | 25 ----- frontend/src/app/modules/shared/index.ts | 1 - .../src/app/modules/shared/shared.module.ts | 3 - 11 files changed, 6 insertions(+), 316 deletions(-) delete mode 100644 frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.html delete mode 100644 frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.scss delete mode 100644 frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.spec.ts delete mode 100644 frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.ts delete mode 100644 frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.model.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 31f0645e13..52275c127f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ _**For better traceability add the corresponding GitHub issue number in each cha - Updated RELEASE.md to the latest release guide (added more steps) - #515 Fixed notification toast click area +### Removed +- #625 Removed the header and breadcrumbs section from app layout + ## [10.6.0 - 04.03.2024] ### Added diff --git a/frontend/src/app/modules/core/layout/header/header.component.html b/frontend/src/app/modules/core/layout/header/header.component.html index 12a82b57b5..24f16b4658 100644 --- a/frontend/src/app/modules/core/layout/header/header.component.html +++ b/frontend/src/app/modules/core/layout/header/header.component.html @@ -41,16 +41,6 @@ - -
- -
- -
-

{{ 'pageTitle.' + activeMenu | i18n }}

-
- - diff --git a/frontend/src/app/modules/core/layout/layout/layout.component.spec.ts b/frontend/src/app/modules/core/layout/layout/layout.component.spec.ts index 39777944dd..f3ba897055 100644 --- a/frontend/src/app/modules/core/layout/layout/layout.component.spec.ts +++ b/frontend/src/app/modules/core/layout/layout/layout.component.spec.ts @@ -36,7 +36,7 @@ describe('LayoutComponent', () => { imports: [ LayoutModule ], providers: [ LayoutComponent ], }); - let header = fixture.debugElement.query(By.css('.header--breadcrumb-container')); + let header = fixture.debugElement.query(By.css('.layout-content__box-modal')); expect(header).not.toBeNull(); let toast = fixture.debugElement.query(By.css('.layout-toast-component')); let headerDistanceToTop = header.nativeElement.getBoundingClientRect().y + 'px'; diff --git a/frontend/src/app/modules/core/layout/layout/layout.component.ts b/frontend/src/app/modules/core/layout/layout/layout.component.ts index 8a715a97ac..4876c5f1ce 100644 --- a/frontend/src/app/modules/core/layout/layout/layout.component.ts +++ b/frontend/src/app/modules/core/layout/layout/layout.component.ts @@ -36,9 +36,9 @@ export class LayoutComponent { * This Block positions the toast component to the start of the header breadcrumb component (vertical top distance) * so that on every screen size the position stays the same (not relative) */ - const headerBreadCrumbRef = this.elementRef.nativeElement.querySelector('.header--breadcrumb-container'); + const layoutContentRef = this.elementRef.nativeElement.querySelector('.layout-content__box-modal'); const toastLayoutRef = this.elementRef.nativeElement.querySelector('.layout-toast-component'); - const elementTopDistance = headerBreadCrumbRef.getBoundingClientRect().top; + const elementTopDistance = layoutContentRef.getBoundingClientRect().top; this.renderer.setStyle(toastLayoutRef, 'top', `${ elementTopDistance }px`); } diff --git a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.html b/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.html deleted file mode 100644 index 35df1fb14d..0000000000 --- a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.html +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.scss b/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.scss deleted file mode 100644 index 4170f6674b..0000000000 --- a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.scss +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * Copyright (c) 2022, 2023 ZF Friedrichshafen AG - * Copyright (c) 2022, 2023 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 - ********************************************************************************/ - -.breadcrumb { - background: none; - font-size: 0.8em; - margin: 0; - cursor: default; - @apply font-light; - span { - @apply text-primary; - } - - a:hover, - span:hover { - text-decoration: underline; - cursor: pointer; - } - - li { - list-style: none; - float: left; - margin: 5px 5px 5px 0; - } - - li:last-child { - margin-right: 20px; - - span { - @apply text-doveGray; - cursor: default; - text-decoration: none; - } - } - - li::after { - content: '>'; - color: darkgrey; - cursor: default; - } - - li:last-child::after { - content: ''; - } -} diff --git a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.spec.ts b/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.spec.ts deleted file mode 100644 index 2de8dbefd7..0000000000 --- a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.spec.ts +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * Copyright (c) 2022, 2023 ZF Friedrichshafen AG - * Copyright (c) 2022, 2023 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 - ********************************************************************************/ - -import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; -import { LayoutFacade } from '@shared/abstraction/layout-facade'; -import { BreadcrumbsComponent } from '@shared/components/breadcrumbs/breadcrumbs.component'; -import { SharedModule } from '@shared/shared.module'; -import { screen, waitFor } from '@testing-library/angular'; -import { renderComponent } from '@tests/test-render.utils'; -import { of } from 'rxjs'; - -describe('BreadcrumbsComponent', () => { - const createRoutRoot = (path: string, firstChild?: ActivatedRoute, breadcrumb?: string) => { - breadcrumb = breadcrumb || path; - return { - routeConfig: { data: { breadcrumb }, path }, - snapshot: { params: { id: path + '-1' } }, - firstChild, - } as unknown as ActivatedRoute; - }; - - const renderBreadcrumbsComponent = async root => { - const routerEvents = new NavigationEnd(1, 'test', ''); - - return await renderComponent(BreadcrumbsComponent, { - declarations: [ BreadcrumbsComponent ], - imports: [ SharedModule ], - providers: [ - LayoutFacade, - { provide: Router, useValue: { root: '', events: of(routerEvents) } }, - { - provide: ActivatedRoute, - useValue: { - root, - }, - }, - ], - }); - }; - - it('should render', async () => { - const root = createRoutRoot('home', createRoutRoot('test', createRoutRoot('path'))); - await renderBreadcrumbsComponent(root); - expect(await waitFor(() => screen.getByText('routing.home'))).toBeInTheDocument(); - expect(await waitFor(() => screen.getByText('routing.test'))).toBeInTheDocument(); - expect(await waitFor(() => screen.getByText('routing.path'))).toBeInTheDocument(); - }); - - it('should not render id', async () => { - const root = createRoutRoot('home', createRoutRoot('test', createRoutRoot(':random_id'))); - await renderBreadcrumbsComponent(root); - expect(await waitFor(() => screen.getByText('routing.home'))).toBeInTheDocument(); - expect(await waitFor(() => screen.getByText('routing.test'))).toBeInTheDocument(); - expect(await screen.queryByText('random_id')).not.toBeInTheDocument(); - }); -}); diff --git a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.ts b/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.ts deleted file mode 100644 index d49260b883..0000000000 --- a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.component.ts +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * Copyright (c) 2022, 2023 ZF Friedrichshafen AG - * Copyright (c) 2022, 2023 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 - ********************************************************************************/ - -// ToDo: May need to rework this component - -import { Component } from '@angular/core'; -import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; -import { distinctUntilChanged, filter } from 'rxjs/operators'; -import { LayoutFacade } from '../../abstraction/layout-facade'; -import { BreadcrumbsModel } from './breadcrumbs.model'; - -@Component({ - selector: 'app-breadcrumbs', - templateUrl: './breadcrumbs.component.html', - styleUrls: [ './breadcrumbs.component.scss' ], -}) -export class BreadcrumbsComponent { - public breadcrumbs: BreadcrumbsModel[] = []; - - constructor( - private readonly router: Router, - private readonly activatedRoute: ActivatedRoute, - private readonly layoutFacade: LayoutFacade, - ) { - this.router.events - .pipe( - filter(event => event instanceof NavigationEnd), - distinctUntilChanged(), - ) - .subscribe({ next: () => (this.breadcrumbs = this.createBreadcrumbs(this.activatedRoute.root)) }); - } - - public navigate(url: string, index: number): void { - if (index < this.breadcrumbs.length - 1) { - this.router.navigate([ url ]).then(); - } - } - - private createBreadcrumbs(route: ActivatedRoute, url = '', breadcrumbs: BreadcrumbsModel[] = []): BreadcrumbsModel[] { - // If no routeConfig is available we are on the root path - let label = route.routeConfig && route.routeConfig.data ? route.routeConfig.data.breadcrumb : ''; - let path = route.routeConfig && route.routeConfig.data ? route.routeConfig.path : ''; - - // If the route is dynamic route such as ':id', remove it - const lastRoutePart = path.split('/').pop(); - const isDynamicRoute = lastRoutePart.startsWith(':'); - - if (isDynamicRoute && !!route.snapshot) { - const paramName = lastRoutePart.split(':')[1]; - - const splitPath = path.split(path.indexOf('/:') !== -1 ? '/:' : ':')[0]; - label = splitPath.split('/').pop(); - - path = path.replace(lastRoutePart, route.snapshot.params[paramName]); - } - - // In the routeConfig the complete path is not available, - // so we rebuild it each time - const nextUrl = path ? `${ url }/${ path }` : url; - - const breadcrumb: BreadcrumbsModel = { - label, - url: nextUrl, - }; - - // TODO: Don't know if this will work for future implementations - // We must set the breadcrumb label on the component and if we leave the route, we must put it back to empty - if (breadcrumb.url && breadcrumb.label === '' && this.layoutFacade.breadcrumbLabel) { - breadcrumb.label = this.layoutFacade.breadcrumbLabel; - } - - // translate breadcrumb - if (breadcrumb.label) { - // each breadcrumb label should be registered in common translation under "routing" key - breadcrumb.label = `routing.${ breadcrumb.label }`; - } - - // Only adding route with non-empty label - const newBreadcrumbs = breadcrumb.label ? [ ...breadcrumbs, breadcrumb ] : [ ...breadcrumbs ]; - if (route.firstChild) { - // If we are not on our current path yet, - // there will be more children to look after, to build our breadcrumb - return this.createBreadcrumbs(route.firstChild, nextUrl, newBreadcrumbs); - } - return newBreadcrumbs; - } -} diff --git a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.model.ts b/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.model.ts deleted file mode 100644 index 2112e51327..0000000000 --- a/frontend/src/app/modules/shared/components/breadcrumbs/breadcrumbs.model.ts +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * Copyright (c) 2022, 2023 ZF Friedrichshafen AG - * Copyright (c) 2022, 2023 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 - ********************************************************************************/ - -export interface BreadcrumbsModel { - label: string; - url: string; -} diff --git a/frontend/src/app/modules/shared/index.ts b/frontend/src/app/modules/shared/index.ts index 171e2703a0..b4720af52c 100644 --- a/frontend/src/app/modules/shared/index.ts +++ b/frontend/src/app/modules/shared/index.ts @@ -38,7 +38,6 @@ export { Tree } from './modules/relations/presentation/tree/tree.d3'; export { CardIconComponent } from './components/card-icon/card-icon.component'; export { CardListComponent } from './components/card-list/card-list.component'; export { AvatarComponent } from './components/avatar/avatar.component'; -export { BreadcrumbsComponent } from './components/breadcrumbs/breadcrumbs.component'; export { ButtonComponent } from './components/button/button.component'; export { ToastContainerComponent } from './components/toasts/toast-container/toast-container.component'; export { ToastMessage } from './components/toasts/toast-message/toast-message.model'; diff --git a/frontend/src/app/modules/shared/shared.module.ts b/frontend/src/app/modules/shared/shared.module.ts index f8c2d74029..f57bbd526e 100644 --- a/frontend/src/app/modules/shared/shared.module.ts +++ b/frontend/src/app/modules/shared/shared.module.ts @@ -50,7 +50,6 @@ import { FormatPartlistSemanticDataModelToCamelCasePipe } from '@shared/pipes/fo import { I18NextModule } from 'angular-i18next'; import { BaseInputComponent } from './abstraction/baseInput/baseInput.component'; import { AvatarComponent } from './components/avatar/avatar.component'; -import { BreadcrumbsComponent } from './components/breadcrumbs/breadcrumbs.component'; import { ButtonComponent } from './components/button/button.component'; import { CardIconComponent } from './components/card-icon/card-icon.component'; import { CardListComponent } from './components/card-list/card-list.component'; @@ -83,7 +82,6 @@ import { TemplateModule } from './template.module'; ToastContainerComponent, PartsTableComponent, ToastMessageComponent, - BreadcrumbsComponent, ButtonComponent, TextWithIconComponent, TableComponent, @@ -134,7 +132,6 @@ import { TemplateModule } from './template.module'; exports: [ ToastContainerComponent, ToastMessageComponent, - BreadcrumbsComponent, ButtonComponent, TextWithIconComponent, TableComponent, From 7a2b54b1c2013714d89bd5da210656be060ad04f Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 7 Mar 2024 10:41:33 +0100 Subject: [PATCH 36/45] feature: 420 add logs --- .../traceability/common/config/ErrorHandlingConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index 742051ac73..0d09f3f8a7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -323,7 +323,7 @@ public ResponseEntity handleImportJobNotFoundException(final Impo @ExceptionHandler(ContractException.class) public ResponseEntity handleImportJobNotFoundException(final ContractException exception) { - log.error("ImportJobNotFoundException exception", exception); + log.error("Contract exception", exception); return ResponseEntity.status(HttpStatus.NOT_FOUND) .body(new ErrorResponse(exception.getMessage())); From 477aa0e588828711c51c93b7bf5f4fd1058c1c4b Mon Sep 17 00:00:00 2001 From: Maximilian Wesener <124587888+ds-mwesener@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:45:55 +0100 Subject: [PATCH 37/45] Update docs/src/docs/arc42/cross-cutting/development-concepts.adoc Co-authored-by: ds-crehm <156299914+ds-crehm@users.noreply.github.com> --- docs/src/docs/arc42/cross-cutting/development-concepts.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/arc42/cross-cutting/development-concepts.adoc b/docs/src/docs/arc42/cross-cutting/development-concepts.adoc index 762fd059e0..aac92ff993 100644 --- a/docs/src/docs/arc42/cross-cutting/development-concepts.adoc +++ b/docs/src/docs/arc42/cross-cutting/development-concepts.adoc @@ -34,7 +34,7 @@ The generated OpenAPI specification file is automatically compared to a fixed, s == Migration -Data Migration is handled by flyway. +Data migration is handled by flyway. == Configurability From 9a6c8ec69749e7c872210b8a898d0ba99e07f7fd Mon Sep 17 00:00:00 2001 From: Maximilian Wesener <124587888+ds-mwesener@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:46:02 +0100 Subject: [PATCH 38/45] Update docs/src/docs/arc42/solution-strategy/structure.adoc Co-authored-by: ds-crehm <156299914+ds-crehm@users.noreply.github.com> --- docs/src/docs/arc42/solution-strategy/structure.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/arc42/solution-strategy/structure.adoc b/docs/src/docs/arc42/solution-strategy/structure.adoc index 5971eaa2a9..6bf2ef58b6 100644 --- a/docs/src/docs/arc42/solution-strategy/structure.adoc +++ b/docs/src/docs/arc42/solution-strategy/structure.adoc @@ -6,7 +6,7 @@ It roughly can be broken down into the following parts: * Asset controllers to get the asset information * Dashboard controller to get dashboard related summed up information * Registry controller to fetch assets from the Digital Twin Registry -* Notification controllers to get notification information and create edc notification offers +* Notification controllers to get notification information and create EDC notification offers * Submodel controller for providing asset data functionality * Import controller for importing trace-x data for data provisioning. * Contract controller to get information about contract agreements From c7c21bd95ecb82a84eb07f201fa50a460219fab7 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener <124587888+ds-mwesener@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:46:10 +0100 Subject: [PATCH 39/45] Update docs/src/docs/arc42/solution-strategy/structure.adoc Co-authored-by: ds-crehm <156299914+ds-crehm@users.noreply.github.com> --- docs/src/docs/arc42/solution-strategy/structure.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/arc42/solution-strategy/structure.adoc b/docs/src/docs/arc42/solution-strategy/structure.adoc index 6bf2ef58b6..23d9e27041 100644 --- a/docs/src/docs/arc42/solution-strategy/structure.adoc +++ b/docs/src/docs/arc42/solution-strategy/structure.adoc @@ -8,7 +8,7 @@ It roughly can be broken down into the following parts: * Registry controller to fetch assets from the Digital Twin Registry * Notification controllers to get notification information and create EDC notification offers * Submodel controller for providing asset data functionality -* Import controller for importing trace-x data for data provisioning. +* Import controller for importing Trace-X data for data provisioning * Contract controller to get information about contract agreements * EDC controller to retrieve notifications * IRS Callback controller to retrieve asynchronous jobs completed by IRS. From 71fddeb6521dac6197694d9d1b5db7e5c0466256 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener <124587888+ds-mwesener@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:46:17 +0100 Subject: [PATCH 40/45] Update docs/src/docs/arc42/solution-strategy/structure.adoc Co-authored-by: ds-crehm <156299914+ds-crehm@users.noreply.github.com> --- docs/src/docs/arc42/solution-strategy/structure.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/arc42/solution-strategy/structure.adoc b/docs/src/docs/arc42/solution-strategy/structure.adoc index 23d9e27041..fde12a0419 100644 --- a/docs/src/docs/arc42/solution-strategy/structure.adoc +++ b/docs/src/docs/arc42/solution-strategy/structure.adoc @@ -11,7 +11,7 @@ It roughly can be broken down into the following parts: * Import controller for importing Trace-X data for data provisioning * Contract controller to get information about contract agreements * EDC controller to retrieve notifications -* IRS Callback controller to retrieve asynchronous jobs completed by IRS. +* IRS callback controller to retrieve asynchronous jobs completed by IRS * Policy controller to retrieve information about policies * BPN controller to retrieve information about business partners From 58b53e6a1cf17599ee31f7ab33eec83ed4195e51 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 7 Mar 2024 11:23:05 +0100 Subject: [PATCH 41/45] feature: 420 respond 404 if assets ids are unknown --- .../repository/ContractsRepositoryImpl.java | 4 ++++ .../contracts/ContractsControllerIT.java | 21 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java index e14b04fa58..36cadd307b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java @@ -64,6 +64,10 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit Specification specification = BaseSpecification.toSpecification(contractAgreementSpecifications); Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); + if (contractAgreementInfoViews.getContent().isEmpty()) { + throw new ContractException("Cannot find contract agreement Ids for asset ids in searchCriteria: " + searchCriteria.getSearchCriteriaFilterList()); + } + return new PageResult<>(fetchEdcContractAgreements(contractAgreementInfoViews), contractAgreementInfoViews.getPageable().getPageNumber(), contractAgreementInfoViews.getTotalPages(), diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java index e8bc0ad382..819b5c150a 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java @@ -116,7 +116,6 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { assertThat(contractResponsePage2Result.content().stream().map(ContractResponse::getContractId).toList()).containsAll(secondContractagreementIds); } - @Test void shouldReturnOnlyOneContract() throws JoseException { //GIVEN @@ -141,4 +140,24 @@ void shouldReturnOnlyOneContract() throws JoseException { assertThat(contractResponsePageResult.content()).isNotEmpty(); } + @Test + void shouldReturn404IfAssetIdIsUnknown() throws JoseException { + //GIVEN + edcSupport.edcWillReturnOnlyOneContractAgreement(); + edcSupport.edcWillReturnContractAgreementNegotiation(); + assetsSupport.defaultAssetsStored(); + + //WHEN//THEN + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .body(PageableFilterRequest.builder().searchCriteriaRequestParam(SearchCriteriaRequestParam.builder().filter(List.of("id,EQUAL,IdontExist,AND")).build()).build()) + .post("/api/contracts") + .then() + .log().all() + .statusCode(404); + } + } From ed1347a8d6aa84aa51f62930845c3db1ee0a3602 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 7 Mar 2024 12:32:14 +0100 Subject: [PATCH 42/45] feat(notifications): 423 - Adding notification list to response --- CHANGELOG.md | 1 + .../openapi/traceability-foss-backend.json | 1825 +++++++++-------- .../alert/mapper/AlertResponseMapper.java | 6 +- .../mapper/QualityNotificationMapper.java | 33 + .../mapper/InvestigationResponseMapper.java | 7 +- .../base/model/QualityNotification.java | 3 +- .../alert/model/AlertEntity.java | 2 - .../model/InvestigationEntity.java | 2 - .../model/NotificationBaseEntity.java | 1 - .../QualityNotificationMessageBaseEntity.java | 1 + ...16__move_errormessage_to_notifications.sql | 5 + .../QualityNotificationMessageResponse.java | 51 + .../response/QualityNotificationResponse.java | 3 + 13 files changed, 1066 insertions(+), 874 deletions(-) create mode 100644 tx-backend/src/main/resources/db/migration/V16__move_errormessage_to_notifications.sql create mode 100644 tx-models/src/main/java/qualitynotification/base/response/QualityNotificationMessageResponse.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 52275c127f..d2504e0323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha ### Changed - Updated RELEASE.md to the latest release guide (added more steps) - #515 Fixed notification toast click area +- #423 Moved errorMessages from investigation/alert to notification list ### Removed - #625 Removed the header and breadcrumbs section from app layout diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 41a2a3e116..bedc0e26e6 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -37,18 +37,23 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -57,8 +62,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -67,8 +72,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -87,17 +92,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -154,23 +154,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -179,18 +174,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -199,8 +199,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -209,8 +209,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -271,23 +271,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -296,18 +291,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -316,8 +316,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -326,8 +326,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -385,8 +385,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -395,8 +395,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -405,8 +405,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -415,8 +415,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -425,8 +425,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -504,8 +504,8 @@ "application/json" : {} } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -514,8 +514,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -524,18 +524,14 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Ok.", "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } + "application/json" : {} } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -554,10 +550,14 @@ } } }, - "200" : { - "description" : "Ok.", + "429" : { + "description" : "Too many requests.", "content" : { - "application/json" : {} + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } } }, "403" : { @@ -609,8 +609,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -619,8 +619,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -629,8 +629,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -639,8 +639,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -649,8 +649,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -729,8 +729,11 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -739,8 +742,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -749,11 +752,11 @@ } } }, - "204" : { - "description" : "No content." + "200" : { + "description" : "Ok." }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -762,8 +765,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -772,11 +775,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -845,8 +845,11 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -855,8 +858,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -865,11 +868,11 @@ } } }, - "204" : { - "description" : "No content." + "200" : { + "description" : "Ok." }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -878,8 +881,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -888,11 +891,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -951,8 +951,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -961,8 +961,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -971,18 +971,21 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -991,11 +994,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1057,8 +1057,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1067,8 +1067,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1077,8 +1077,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1087,8 +1090,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1097,11 +1100,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1162,8 +1162,18 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1298,6 +1308,12 @@ "minLength" : 0, "type" : "string", "example" : "EDC not reachable" + }, + "qualityNotificationMessageResponseList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationMessageResponse" + } } } } @@ -1316,18 +1332,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1336,8 +1342,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1395,8 +1401,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1405,8 +1411,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1415,8 +1421,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1425,8 +1431,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1435,8 +1441,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1505,8 +1511,11 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No Content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1515,8 +1524,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1525,18 +1534,14 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "OK.", "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } + "application/json" : {} } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1555,10 +1560,14 @@ } } }, - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { - "application/json" : {} + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } } }, "403" : { @@ -1571,9 +1580,6 @@ } } }, - "204" : { - "description" : "No Content." - }, "401" : { "description" : "Authorization failed.", "content" : { @@ -1621,8 +1627,11 @@ } }, "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No Content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1631,8 +1640,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1641,18 +1650,14 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "OK.", "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } + "application/json" : {} } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1671,10 +1676,14 @@ } } }, - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { - "application/json" : {} + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } } }, "403" : { @@ -1687,9 +1696,6 @@ } } }, - "204" : { - "description" : "No Content." - }, "401" : { "description" : "Authorization failed.", "content" : { @@ -1729,8 +1735,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1739,8 +1745,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1749,8 +1755,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1759,8 +1765,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1769,8 +1775,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1831,18 +1837,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1851,8 +1847,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1861,8 +1857,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1881,8 +1877,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2078,6 +2074,16 @@ } } }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "401" : { "description" : "Authorization failed.", "content" : { @@ -2117,8 +2123,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2127,8 +2133,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2137,8 +2143,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2147,8 +2153,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2157,8 +2163,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2219,26 +2225,6 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "415" : { "description" : "Unsupported media type", "content" : { @@ -2259,26 +2245,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -2466,6 +2432,46 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "401" : { "description" : "Authorization failed.", "content" : { @@ -2505,8 +2511,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2515,8 +2521,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2525,8 +2531,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2535,8 +2541,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2545,8 +2551,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2625,8 +2631,11 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2635,8 +2644,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2645,11 +2654,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2658,8 +2664,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2668,8 +2674,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2738,8 +2744,11 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2748,8 +2757,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2758,11 +2767,11 @@ } } }, - "204" : { - "description" : "No content." + "200" : { + "description" : "Ok." }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2771,8 +2780,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2781,11 +2790,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2844,8 +2850,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2854,8 +2860,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2864,8 +2870,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2874,8 +2883,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2884,11 +2893,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2950,8 +2956,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2960,8 +2966,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2970,8 +2976,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2980,8 +2989,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2990,11 +2999,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3055,26 +3061,6 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "415" : { "description" : "Unsupported media type", "content" : { @@ -3095,26 +3081,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3236,6 +3202,12 @@ "minLength" : 0, "type" : "string", "example" : "EDC not reachable" + }, + "qualityNotificationMessageResponseList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationMessageResponse" + } } } } @@ -3243,8 +3215,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3252,8 +3224,48 @@ } } } - } - }, + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, "security" : [ { "oAuth2" : [ @@ -3282,26 +3294,6 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "415" : { "description" : "Unsupported media type", "content" : { @@ -3322,26 +3314,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the assets found", "content" : { @@ -3524,6 +3496,46 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "401" : { "description" : "Authorization failed.", "content" : { @@ -3571,56 +3583,6 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3803,6 +3765,56 @@ } } }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "403" : { "description" : "Forbidden.", "content" : { @@ -3849,9 +3861,59 @@ "schema" : { "type" : "string" } - } - ], - "responses" : { + } + ], + "responses" : { + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -4034,56 +4096,6 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -4141,8 +4153,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4151,8 +4163,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4161,8 +4173,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4171,8 +4183,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4181,8 +4193,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4412,8 +4424,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4422,8 +4434,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4432,8 +4444,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "202" : { + "description" : "Created registry reload job." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4442,8 +4457,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4452,8 +4467,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4462,9 +4477,6 @@ } } }, - "202" : { - "description" : "Created registry reload job." - }, "403" : { "description" : "Forbidden.", "content" : { @@ -4504,8 +4516,8 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4514,8 +4526,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4524,8 +4536,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4534,8 +4546,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4544,8 +4556,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4614,26 +4626,6 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "415" : { "description" : "Unsupported media type", "content" : { @@ -4670,6 +4662,16 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "404" : { "description" : "Not found.", "content" : { @@ -4680,6 +4682,16 @@ } } }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "403" : { "description" : "Forbidden.", "content" : { @@ -4759,18 +4771,23 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4779,8 +4796,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4789,8 +4806,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4809,17 +4826,12 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -4863,8 +4875,8 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4873,8 +4885,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4883,18 +4895,18 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4903,18 +4915,18 @@ } } }, - "200" : { - "description" : "Returns dashboard data", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4973,8 +4985,11 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "No Content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4983,8 +4998,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4993,18 +5008,18 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5023,12 +5038,12 @@ } } }, - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -5040,11 +5055,8 @@ "schema" : { "$ref" : "#/components/schemas/ErrorResponse" } - } - } - }, - "204" : { - "description" : "No Content." + } + } }, "401" : { "description" : "Authorization failed.", @@ -5093,26 +5105,6 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "415" : { "description" : "Unsupported media type", "content" : { @@ -5133,16 +5125,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -5330,6 +5312,36 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "403" : { "description" : "Forbidden.", "content" : { @@ -5411,18 +5423,23 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5431,8 +5448,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5441,8 +5458,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5461,17 +5478,12 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -5525,8 +5537,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5535,8 +5547,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5545,8 +5557,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5555,8 +5567,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5565,8 +5577,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5814,6 +5826,56 @@ } ], "responses" : { + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -6001,56 +6063,6 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -6132,18 +6144,23 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6152,8 +6169,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6162,8 +6179,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6182,17 +6199,12 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -6236,8 +6248,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6246,8 +6258,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6256,8 +6268,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6266,8 +6278,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6276,8 +6288,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6350,8 +6362,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6360,8 +6372,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6370,8 +6382,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6380,8 +6392,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6390,8 +6402,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6632,8 +6644,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6642,8 +6654,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6652,18 +6664,23 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "type" : "array", + "description" : "Alerts", + "items" : { + "$ref" : "#/components/schemas/AlertResponse" + } } } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6672,23 +6689,18 @@ } } }, - "200" : { - "description" : "OK.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6776,18 +6788,23 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6796,8 +6813,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6806,8 +6823,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6826,17 +6843,12 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -6880,8 +6892,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6890,8 +6902,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6900,8 +6912,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Ok." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6910,8 +6925,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -6920,11 +6935,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6985,8 +6997,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6995,8 +7007,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7005,8 +7017,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "Deleted." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -7015,8 +7030,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -7025,8 +7040,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -7035,9 +7050,6 @@ } } }, - "204" : { - "description" : "Deleted." - }, "200" : { "description" : "Okay" }, @@ -7094,6 +7106,18 @@ } } }, + "ErrorResponse" : { + "type" : "object", + "properties" : { + "message" : { + "maxLength" : 1000, + "minLength" : 0, + "pattern" : "^.*$", + "type" : "string", + "example" : "Access Denied" + } + } + }, "BpnEdcMappingResponse" : { "type" : "object", "properties" : { @@ -7107,18 +7131,6 @@ } } }, - "ErrorResponse" : { - "type" : "object", - "properties" : { - "message" : { - "maxLength" : 1000, - "minLength" : 0, - "pattern" : "^.*$", - "type" : "string", - "example" : "Access Denied" - } - } - }, "StartQualityNotificationRequest" : { "required" : [ "severity" @@ -7372,6 +7384,87 @@ "minLength" : 0, "type" : "string", "example" : "EDC not reachable" + }, + "qualityNotificationMessageResponseList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationMessageResponse" + } + } + } + }, + "QualityNotificationMessageResponse" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "createdBy" : { + "type" : "string" + }, + "createdByName" : { + "type" : "string" + }, + "sendTo" : { + "type" : "string" + }, + "sendToName" : { + "type" : "string" + }, + "edcUrl" : { + "type" : "string" + }, + "contractAgreementId" : { + "type" : "string" + }, + "notificationReferenceId" : { + "type" : "string" + }, + "targetDate" : { + "type" : "string", + "format" : "date-time" + }, + "severity" : { + "type" : "string", + "enum" : [ + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE-THREATENING" + ] + }, + "edcNotificationId" : { + "type" : "string" + }, + "created" : { + "type" : "string", + "format" : "date-time" + }, + "updated" : { + "type" : "string", + "format" : "date-time" + }, + "messageId" : { + "type" : "string" + }, + "isInitial" : { + "type" : "boolean" + }, + "status" : { + "type" : "string", + "enum" : [ + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + ] + }, + "errorMessage" : { + "type" : "string" } } }, @@ -7777,6 +7870,12 @@ "minLength" : 0, "type" : "string", "example" : "EDC not reachable" + }, + "qualityNotificationMessageResponseList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationMessageResponse" + } } } }, diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java index 80fcc8e6c9..0a628ceed6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java @@ -19,6 +19,7 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper; +import lombok.experimental.UtilityClass; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; @@ -36,6 +37,9 @@ import java.util.Collections; import java.util.List; +import static org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper.fromNotifications; + +@UtilityClass public class AlertResponseMapper { public static AlertResponse from(QualityNotification qualityNotification) { @@ -58,7 +62,7 @@ public static AlertResponse from(QualityNotification qualityNotification) { .sendToName(getReceiverName(qualityNotification.getNotifications())) .severity(QualityNotificationMapper.from(qualityNotification.getNotifications().stream().findFirst().map(QualityNotificationMessage::getSeverity).orElse(QualityNotificationSeverity.MINOR))) .targetDate(qualityNotification.getNotifications().stream().findFirst().map(QualityNotificationMessage::getTargetDate).map(Instant::toString).orElse(null)) - .errorMessage(qualityNotification.getErrorMessage()) + .qualityNotificationMessageResponseList(fromNotifications(qualityNotification.getNotifications())) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java index 77f183fc67..6568cbb0c2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java @@ -19,13 +19,19 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper; +import lombok.experimental.UtilityClass; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import qualitynotification.base.response.QualityNotificationMessageResponse; import qualitynotification.base.response.QualityNotificationSeverityResponse; import qualitynotification.base.response.QualityNotificationSideResponse; import qualitynotification.base.response.QualityNotificationStatusResponse; +import java.util.List; + +@UtilityClass public class QualityNotificationMapper { public static QualityNotificationSeverityResponse from(QualityNotificationSeverity qualityNotificationSeverity) { @@ -39,4 +45,31 @@ public static QualityNotificationSideResponse from(QualityNotificationSide side) public static QualityNotificationStatusResponse from(QualityNotificationStatus qualityNotificationStatus) { return QualityNotificationStatusResponse.fromStringValue(qualityNotificationStatus.name()); } + + public static List fromNotifications(List notificationMessages) { + return notificationMessages.stream().map(QualityNotificationMapper::fromNotification).toList(); + } + + public static QualityNotificationMessageResponse fromNotification(QualityNotificationMessage notificationMessage) { + return QualityNotificationMessageResponse + .builder() + .id(notificationMessage.getId()) + .edcNotificationId(notificationMessage.getEdcNotificationId()) + .contractAgreementId(notificationMessage.getContractAgreementId()) + .notificationReferenceId(notificationMessage.getNotificationReferenceId()) + .isInitial(notificationMessage.getIsInitial()) + .messageId(notificationMessage.getMessageId()) + .edcUrl(notificationMessage.getEdcUrl()) + .updated(notificationMessage.getUpdated()) + .sendToName(notificationMessage.getSendToName()) + .status(fromStatus(notificationMessage.getNotificationStatus())) + .targetDate(notificationMessage.getTargetDate()) + .created(notificationMessage.getCreated()) + .errorMessage(notificationMessage.getErrorMessage()) + .build(); + } + + public static QualityNotificationStatusResponse fromStatus(QualityNotificationStatus qualityNotificationStatus) { + return QualityNotificationStatusResponse.fromStringValue(qualityNotificationStatus.name()); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java index 438087eadc..1d2cdc8a31 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java @@ -19,6 +19,7 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.investigation.mapper; +import lombok.experimental.UtilityClass; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; @@ -36,10 +37,10 @@ import java.util.Collections; import java.util.List; +import static org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper.fromNotifications; +@UtilityClass public class InvestigationResponseMapper { - private InvestigationResponseMapper() { - } public static InvestigationResponse from(QualityNotification qualityNotification) { return InvestigationResponse @@ -61,7 +62,7 @@ public static InvestigationResponse from(QualityNotification qualityNotification .sendToName(getReceiverName(qualityNotification.getNotifications())) .severity(QualityNotificationMapper.from(qualityNotification.getNotifications().stream().findFirst().map(QualityNotificationMessage::getSeverity).orElse(QualityNotificationSeverity.MINOR))) .targetDate(qualityNotification.getNotifications().stream().findFirst().map(QualityNotificationMessage::getTargetDate).map(Instant::toString).orElse(null)) - .errorMessage(qualityNotification.getErrorMessage()) + .qualityNotificationMessageResponseList(fromNotifications(qualityNotification.getNotifications())) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java index 460bd75c3d..36d6ff4514 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java @@ -50,7 +50,7 @@ public class QualityNotification { private String acceptReason; private String declineReason; private Map notifications = new HashMap<>(); - private String errorMessage; + public static QualityNotification startNotification(Instant createDate, BPN bpn, String description) { // rename to generic return QualityNotification.builder() @@ -61,7 +61,6 @@ public static QualityNotification startNotification(Instant createDate, BPN bpn, .createdAt(createDate) .assetIds(Collections.emptyList()) .notifications(Collections.emptyList()) - .errorMessage(null) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java index aa8fc304b9..6d9f48cff7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java @@ -86,7 +86,6 @@ public static QualityNotification toDomain(AlertEntity alertNotificationEntity) .description(alertNotificationEntity.getDescription()) .assetIds(assetIds) .notifications(notifications) - .errorMessage(alertNotificationEntity.getErrorMessage()) .build(); } @@ -98,7 +97,6 @@ public static AlertEntity from(QualityNotification qualityNotification, List qualityNotificationMessageResponseList; + } From b8b549a234345503ffb13f1e8b45716b2fd3c4b2 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Thu, 7 Mar 2024 13:06:58 +0100 Subject: [PATCH 43/45] feature: 420 refactor --- CHANGELOG.md | 2 +- .../common/config/ErrorHandlingConfig.java | 2 +- ...Controller.java => ContractController.java} | 8 ++++---- ...tractsService.java => ContractService.java} | 2 +- ...Repository.java => ContractRepository.java} | 2 +- ...rviceImpl.java => ContractServiceImpl.java} | 10 +++++----- ...nfoView.java => ContractAgreementView.java} | 4 ++-- ...ryImpl.java => ContractRepositoryImpl.java} | 18 +++++++++--------- .../repository/ContractSpecification.java | 6 +++--- ...JpaContractAgreementInfoViewRepository.java | 4 ++-- .../R__create_contract_agreement_view.sql | 2 +- ...rollerIT.java => ContractControllerIT.java} | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/{ContractsController.java => ContractController.java} (96%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/{ContractsService.java => ContractService.java} (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/{ContractsRepository.java => ContractRepository.java} (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/{ContractsServiceImpl.java => ContractServiceImpl.java} (89%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/{ContractAgreementInfoView.java => ContractAgreementView.java} (94%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/{ContractsRepositoryImpl.java => ContractRepositoryImpl.java} (88%) rename tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/{ContractsControllerIT.java => ContractControllerIT.java} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index b60aae2549..f04ba60f98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha ### Added - #515 Service Unavailable Response on Notification failure -- add /contracts api to fetch contract agreement information from EDC for assets +- #420 add /contracts api to fetch contract agreement information from EDC for assets ### Changed - Updated RELEASE.md to the latest release guide (added more steps) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index 0d09f3f8a7..4f1f0ad504 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -322,7 +322,7 @@ public ResponseEntity handleImportJobNotFoundException(final Impo } @ExceptionHandler(ContractException.class) - public ResponseEntity handleImportJobNotFoundException(final ContractException exception) { + public ResponseEntity handleContractException(final ContractException exception) { log.error("Contract exception", exception); return ResponseEntity.status(HttpStatus.NOT_FOUND) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractController.java similarity index 96% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractController.java index 07e1d67b11..c177b6215b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/rest/ContractController.java @@ -32,7 +32,7 @@ import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractResponseMapper; -import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; +import org.eclipse.tractusx.traceability.contracts.application.service.ContractService; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.PostMapping; @@ -45,8 +45,8 @@ @PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SUPERVISOR')") @Tag(name = "Contracts") @RequestMapping(path = "/contracts", produces = "application/json", consumes = "application/json") -public class ContractsController { - private final ContractsService contractsService; +public class ContractController { + private final ContractService contractService; @Operation(operationId = "contracts", summary = "All contract agreements for all assets", @@ -99,7 +99,7 @@ public class ContractsController { schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping public PageResult getContracts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { - PageResult contracts = contractsService.getContracts(pageableFilterRequest); + PageResult contracts = contractService.getContracts(pageableFilterRequest); return ContractResponseMapper.from(contracts); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractService.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractService.java index 1d2378cf85..2545f981bb 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractsService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/application/service/ContractService.java @@ -22,6 +22,6 @@ import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; -public interface ContractsService { +public interface ContractService { PageResult getContracts(PageableFilterRequest pageableFilterRequest); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractRepository.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractRepository.java index 067af7ac3d..7aeed0a770 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractsRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/repository/ContractRepository.java @@ -23,7 +23,7 @@ import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; import org.springframework.data.domain.Pageable; -public interface ContractsRepository { +public interface ContractRepository { PageResult getContractsByPageable(Pageable pageable, SearchCriteria searchCriteria); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractServiceImpl.java similarity index 89% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractServiceImpl.java index 672dc73d42..463a00ab59 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractsServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/domain/service/ContractServiceImpl.java @@ -24,17 +24,17 @@ import org.eclipse.tractusx.traceability.common.request.OwnPageable; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractFieldMapper; -import org.eclipse.tractusx.traceability.contracts.application.service.ContractsService; +import org.eclipse.tractusx.traceability.contracts.application.service.ContractService; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; -import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; +import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractRepository; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; @RequiredArgsConstructor @Component -public class ContractsServiceImpl implements ContractsService { +public class ContractServiceImpl implements ContractService { - private final ContractsRepository contractsRepository; + private final ContractRepository contractRepository; private final ContractFieldMapper contractFieldMapper; @@ -43,6 +43,6 @@ public PageResult getContracts(PageableFilterRequest pageableFilterReq Pageable pageable = OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), contractFieldMapper); SearchCriteria searchCriteria = pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(contractFieldMapper); - return contractsRepository.getContractsByPageable(pageable, searchCriteria); + return contractRepository.getContractsByPageable(pageable, searchCriteria); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementView.java similarity index 94% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementView.java index caf46bb3a4..2b5d16bc03 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementInfoView.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/model/ContractAgreementView.java @@ -34,9 +34,9 @@ @NoArgsConstructor @Entity @SuperBuilder -@Table(name = "contract_agreement_info_view") +@Table(name = "contract_agreement_view") @Immutable -public class ContractAgreementInfoView { +public class ContractAgreementView { @Id private String id; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractRepositoryImpl.java similarity index 88% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractRepositoryImpl.java index 36cadd307b..084d5a7243 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractRepositoryImpl.java @@ -30,8 +30,8 @@ import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.contracts.domain.model.Contract; -import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractsRepository; -import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; +import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractRepository; +import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementView; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; @@ -50,7 +50,7 @@ @Component @RequiredArgsConstructor @Slf4j -public class ContractsRepositoryImpl implements ContractsRepository { +public class ContractRepositoryImpl implements ContractRepository { private final EdcContractAgreementService edcContractAgreementService; private final JpaContractAgreementInfoViewRepository contractAgreementInfoViewRepository; @@ -61,8 +61,8 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit List contractAgreementSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream() .map(ContractSpecification::new) .toList(); - Specification specification = BaseSpecification.toSpecification(contractAgreementSpecifications); - Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); + Specification specification = BaseSpecification.toSpecification(contractAgreementSpecifications); + Page contractAgreementInfoViews = contractAgreementInfoViewRepository.findAll(specification, pageable); if (contractAgreementInfoViews.getContent().isEmpty()) { throw new ContractException("Cannot find contract agreement Ids for asset ids in searchCriteria: " + searchCriteria.getSearchCriteriaFilterList()); @@ -80,13 +80,13 @@ public PageResult getContractsByPageable(Pageable pageable, SearchCrit } - private List fetchEdcContractAgreements(Page contractAgreementInfoViews) throws ContractAgreementException { - List contractAgreementIds = contractAgreementInfoViews.getContent().stream().map(ContractAgreementInfoView::getContractAgreementId).toList(); + private List fetchEdcContractAgreements(Page contractAgreementInfoViews) throws ContractAgreementException { + List contractAgreementIds = contractAgreementInfoViews.getContent().stream().map(ContractAgreementView::getContractAgreementId).toList(); log.info("Trying to fetch contractAgreementIds from EDC: " + contractAgreementIds); List contractAgreements = edcContractAgreementService.getContractAgreements(contractAgreementIds); - throwIfListDiverge(contractAgreementIds, contractAgreements); + validateContractAgreements(contractAgreementIds, contractAgreements); Map contractNegotiations = contractAgreements.stream() .map(agreement -> new ImmutablePair<>(agreement.contractAgreementId(), @@ -104,7 +104,7 @@ private List fetchEdcContractAgreements(Page contractAgreementIds, List contractAgreements) { + private void validateContractAgreements(List contractAgreementIds, List contractAgreements) { ArrayList givenList = new ArrayList<>(contractAgreementIds); Collections.sort(givenList); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java index f090c1feb0..9d76eda5c2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/ContractSpecification.java @@ -25,18 +25,18 @@ import jakarta.persistence.criteria.Root; import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; -import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; +import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementView; import org.jetbrains.annotations.NotNull; import org.springframework.data.jpa.domain.Specification; -public class ContractSpecification extends BaseSpecification implements Specification { +public class ContractSpecification extends BaseSpecification implements Specification { public ContractSpecification(SearchCriteriaFilter criteria) { super(criteria); } @Override - public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { + public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { return createPredicate(getSearchCriteriaFilter(), root, builder); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java index 889a67feaf..9a11cfbad2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/contracts/infrastructure/repository/JpaContractAgreementInfoViewRepository.java @@ -18,12 +18,12 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.contracts.infrastructure.repository; -import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementInfoView; +import org.eclipse.tractusx.traceability.contracts.infrastructure.model.ContractAgreementView; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.stereotype.Repository; @Repository -public interface JpaContractAgreementInfoViewRepository extends JpaRepository, JpaSpecificationExecutor { +public interface JpaContractAgreementInfoViewRepository extends JpaRepository, JpaSpecificationExecutor { } diff --git a/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql b/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql index 8acd513b1c..1da5a9f911 100644 --- a/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql +++ b/tx-backend/src/main/resources/db/migration/R__create_contract_agreement_view.sql @@ -1,4 +1,4 @@ -create or replace view contract_agreement_info_view as +create or replace view contract_agreement_view as SELECT * FROM ((SELECT assets_as_built.id, contract_agreement_id, 'assets_as_built' as asset_type, created FROM assets_as_built diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java similarity index 99% rename from tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java rename to tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java index 819b5c150a..d30e7e7381 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java @@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; -class ContractsControllerIT extends IntegrationTestSpecification { +class ContractControllerIT extends IntegrationTestSpecification { @Autowired AssetsSupport assetsSupport; From 9a5ada4e5841f27fbb3275f86863260d88ad1e5e Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 7 Mar 2024 14:51:31 +0100 Subject: [PATCH 44/45] feat(notifications): 423 - Adding notification domain diagram to domain cross cutting concepts. --- .../arc42/cross-cutting/domain-concepts.adoc | 10 ++++- .../domain-model-quality-notifications.puml | 41 +++++++++++++++++++ .../domain-model/domain-model.puml | 2 +- .../ReadInvestigationsControllerIT.java | 1 + 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml diff --git a/docs/src/docs/arc42/cross-cutting/domain-concepts.adoc b/docs/src/docs/arc42/cross-cutting/domain-concepts.adoc index 97635fbc52..7fb3821fa6 100644 --- a/docs/src/docs/arc42/cross-cutting/domain-concepts.adoc +++ b/docs/src/docs/arc42/cross-cutting/domain-concepts.adoc @@ -4,12 +4,18 @@ For detailed information about the API model, please refer to the link:https://catenax-ng.github.io/tx-traceability-foss/docs/api-specification/api-specification.html[API specification]. -== Domain Model - +== Domain Models +=== Assets [plantuml, target=level-1, format=svg] .... include::../../../uml-diagrams/arc42/cross-cutting/domain-model/domain-model.puml[] .... +=== Quality Notifications +[plantuml, target=level-2, format=svg] +.... +include::../../../uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml[] +.... + diff --git a/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml b/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml new file mode 100644 index 0000000000..a2d301ecfd --- /dev/null +++ b/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml @@ -0,0 +1,41 @@ +@startuml +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho +title: Quality Notification Domain + +class QualityNotification { + bpn : BPN; + notificationId : QualityNotificationId; + notificationStatus : QualityNotificationStatus; + description: String; + createdAt: Instant; + notificationSide: QualityNotificationSide; + assetIds: ArrayList(); + closeReason: String; + acceptReason: String; + declineReason: String; + notifications: Map; +} + +class QualityNotificationId { +id: Long; +} + +enum QualityNotificationSide{ + SENDER; + RECEIVER; +} + +enum QualityNotificationStatus{ + CREATED(QualityNotificationSide.SENDER, emptySet()), + SENT(QualityNotificationSide.SENDER, Set.of(QualityNotificationSide.SENDER)), + RECEIVED(QualityNotificationSide.RECEIVER, emptySet()), + ACKNOWLEDGED(QualityNotificationSide.RECEIVER, Set.of(QualityNotificationSide.RECEIVER, QualityNotificationSide.SENDER)), + ACCEPTED(QualityNotificationSide.RECEIVER, Set.of(QualityNotificationSide.RECEIVER)), + DECLINED(QualityNotificationSide.RECEIVER, Set.of(QualityNotificationSide.RECEIVER)), + CANCELED(QualityNotificationSide.SENDER, Set.of(QualityNotificationSide.SENDER)), + CLOSED(QualityNotificationSide.SENDER, of(QualityNotificationSide.SENDER, QualityNotificationSide.RECEIVER)); + } +@enduml diff --git a/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model.puml b/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model.puml index 6a02f81430..3c714c50f7 100644 --- a/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model.puml +++ b/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model.puml @@ -3,7 +3,7 @@ skinparam monochrome true skinparam shadowing false skinparam defaultFontName "Architects daughter" skinparam linetype ortho -title: Domain Model +title: Asset Domain class ImportJobs { importId : String (max = 255) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java index 5cb8400625..dfb624ac37 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java @@ -159,6 +159,7 @@ void givenSortByDescriptionProvided_whenGetInvestigations_thenReturnInvestigatio .body("pageSize", Matchers.is(10)) .body("totalItems", Matchers.is(8)) .body("content", Matchers.hasSize(8)) + .log().all() .body("content.description", Matchers.containsInRelativeOrder("1", "2", "3", "4", "5", "6", "7", "8")); } From 1407a160b5ff7a2e7a8a21f8571c70f91d4b95a4 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 7 Mar 2024 15:04:59 +0100 Subject: [PATCH 45/45] feat(notifications): 423 - Adding notification domain diagram to domain cross cutting concepts. --- .../domain-model/domain-model-quality-notifications.puml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml b/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml index a2d301ecfd..c97f02edf6 100644 --- a/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml +++ b/docs/src/uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml @@ -27,6 +27,9 @@ enum QualityNotificationSide{ SENDER; RECEIVER; } +class BPN{ +bpn: String; +} enum QualityNotificationStatus{ CREATED(QualityNotificationSide.SENDER, emptySet()), @@ -38,4 +41,10 @@ enum QualityNotificationStatus{ CANCELED(QualityNotificationSide.SENDER, Set.of(QualityNotificationSide.SENDER)), CLOSED(QualityNotificationSide.SENDER, of(QualityNotificationSide.SENDER, QualityNotificationSide.RECEIVER)); } + +QualityNotification *-- QualityNotificationId +QualityNotification *-- BPN +QualityNotification *-- QualityNotificationStatus +QualityNotification *-- QualityNotificationSide @enduml +