From e941b8a4283ab0d70fb672e484a9d79d18e61a66 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Tue, 12 Dec 2023 15:55:09 +0100 Subject: [PATCH 01/22] chore(tx-backend): TRACEFOSS-2701 view for assets --- .../AssetAsBuiltViewRepository.java | 29 +++ .../service/AssetAsBuiltServiceImpl.java | 11 ++ .../base/model/aspect/DetailAspectModel.java | 32 ++++ .../asbuilt/model/AssetAsBuiltViewEntity.java | 166 ++++++++++++++++++ .../asbuilt/model/TractionBatteryCode.java | 9 + .../AssetAsBuiltViewRepositoryImpl.java | 48 +++++ .../AssetAsBuiltViewSpecification.java | 116 ++++++++++++ .../JpaAssetAsBuiltViewRepository.java | 29 +++ .../application-integration-spring-boot.yml | 2 +- .../V5__add_view_for_as_built_assets.sql | 83 +++++++++ 10 files changed, 524 insertions(+), 1 deletion(-) create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltViewEntity.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java create mode 100644 tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java new file mode 100644 index 0000000000..974bce3de7 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java @@ -0,0 +1,29 @@ +/******************************************************************************** + * 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.assets.domain.asbuilt.repository; + +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.springframework.data.domain.Pageable; + +public interface AssetAsBuiltViewRepository { + PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria); +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java index 37e5f33059..07d1a882db 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java @@ -22,11 +22,16 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltViewRepository; import org.eclipse.tractusx.traceability.assets.domain.base.AssetRepository; import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.domain.base.service.AbstractAssetBaseService; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.request.BomLifecycle; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.relationship.Aspect; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; import java.util.List; @@ -38,6 +43,8 @@ public class AssetAsBuiltServiceImpl extends AbstractAssetBaseService { private final AssetAsBuiltRepository assetAsBuiltRepository; + private final AssetAsBuiltViewRepository assetAsBuiltViewRepository; + private final IrsRepository irsRepository; @Override @@ -65,5 +72,9 @@ protected IrsRepository getIrsRepository() { return irsRepository; } + @Override + public PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria) { + return assetAsBuiltViewRepository.getAssets(pageable, searchCriteria); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/aspect/DetailAspectModel.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/aspect/DetailAspectModel.java index b2b4e59121..fa96bfb85c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/aspect/DetailAspectModel.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/aspect/DetailAspectModel.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.assets.domain.asplanned.model.aspect.DetailAspectDataAsPlanned; import org.eclipse.tractusx.traceability.assets.domain.asplanned.model.aspect.DetailAspectDataPartSiteInformationAsPlanned; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltViewEntity; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.TractionBatteryCode; import org.eclipse.tractusx.traceability.assets.infrastructure.asplanned.model.AssetAsPlannedEntity; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.semanticdatamodel.ManufacturingInformation; @@ -78,6 +79,37 @@ public static List from(AssetAsBuiltEntity entity) { return detailAspectModels; } + public static List from(AssetAsBuiltViewEntity entity) { + + DetailAspectModel detailAspectModelAsBuilt = DetailAspectModel.builder() + .type(DetailAspectType.AS_BUILT) + .data(DetailAspectDataAsBuilt.builder() + .partId(entity.getManufacturerPartId()) + .customerPartId(entity.getCustomerPartId()) + .nameAtCustomer(entity.getNameAtCustomer()) + .manufacturingCountry(entity.getManufacturingCountry()) + .manufacturingDate(toOffsetDateTime(entity.getManufacturingDate())) + .build()) + .build(); + List detailAspectModels = new ArrayList<>(List.of(detailAspectModelAsBuilt)); + + if (!Strings.isEmpty(entity.getTractionBatteryCode())) { + DetailAspectModel detailAspectModelTractionBatteryCode = DetailAspectModel. + builder() + .type(DetailAspectType.TRACTION_BATTERY_CODE) + .data(DetailAspectDataTractionBatteryCode.builder() + .tractionBatteryCode(entity.getTractionBatteryCode()) + .productType(entity.getProductType()) + .subcomponents(TractionBatteryCode.toDomain(entity)) + .build() + ).build(); + + detailAspectModels.add(detailAspectModelTractionBatteryCode); + } + + return detailAspectModels; + } + public static List from(AssetAsPlannedEntity entity) { DetailAspectModel asPlannedInfo = DetailAspectModel.builder() .type(DetailAspectType.AS_PLANNED) 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 new file mode 100644 index 0000000000..24e31315b6 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltViewEntity.java @@ -0,0 +1,166 @@ +/******************************************************************************** + * 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.assets.infrastructure.asbuilt.model; + +import jakarta.persistence.CollectionTable; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.SuperBuilder; +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.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.springframework.data.annotation.Immutable; + +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 +@Setter +@NoArgsConstructor +@Entity +@SuperBuilder +@Table(name = "assets_as_built_view") +@Immutable +public class AssetAsBuiltViewEntity extends AssetBaseEntity { + + private Instant manufacturingDate; + private String manufacturingCountry; + private String nameAtCustomer; + private String customerPartId; + private String productType; + private String tractionBatteryCode; + private String receivedActiveAlerts; + private String sendActiveAlerts; + private String receivedActiveInvestigations; + private String sendActiveInvestigations; + +// @ElementCollection +// @CollectionTable(name = "traction_battery_code_subcomponent", joinColumns = {@JoinColumn(name = "traction_battery_code")}) +// private List subcomponents; +// +// +// @ElementCollection +// @CollectionTable(name = "assets_as_built_childs", joinColumns = {@JoinColumn(name = "asset_as_built_id")}) +// private List childDescriptors; +// +// @ElementCollection +// @CollectionTable(name = "assets_as_built_parents", joinColumns = {@JoinColumn(name = "asset_as_built_id")}) +// private List parentDescriptors; + +// @ManyToMany(mappedBy = "assets") +// private List investigations = new ArrayList<>(); +// +// @ManyToMany(mappedBy = "assets") +// private List alerts = new ArrayList<>(); + + public static AssetBase toDomain(AssetAsBuiltViewEntity entity) { + return AssetBase.builder() + .id(entity.getId()) + .idShort(entity.getIdShort()) + .semanticDataModel(SemanticDataModelEntity.toDomain(entity.getSemanticDataModel())) + .semanticModelId(entity.getSemanticModelId()) + .manufacturerId(entity.getManufacturerId()) + .manufacturerName(entity.getManufacturerName()) + .nameAtManufacturer(entity.getNameAtManufacturer()) + .manufacturerPartId(entity.getManufacturerPartId()) + .owner(entity.getOwner()) +// .childRelations(entity.getChildDescriptors().stream() +// .map(child -> new Descriptions(child.getId(), child.getIdShort())) +// .toList()) +// .parentRelations(entity.getParentDescriptors().stream() +// .map(parent -> new Descriptions(parent.getId(), parent.getIdShort())) +// .toList()) + .inInvestigation(entity.isInInvestigation()) + .activeAlert(entity.isActiveAlert()) + .qualityType(entity.getQualityType()) + .van(entity.getVan()) + .classification(entity.getClassification()) + .detailAspectModels(DetailAspectModel.from(entity)) +// .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) +// .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) +// .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) +// .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) + + .build(); + } + + public static List toDomainList(List entities) { + return entities.stream() + .map(AssetAsBuiltEntity::toDomain) + .toList(); + } + + public static List fromList(List assets) { + return assets.stream() + .map(AssetAsBuiltEntity::from) + .toList(); + } + + + @Builder + @NoArgsConstructor + @AllArgsConstructor + @Data + @Embeddable + public static class ChildDescription { + private String id; + private String idShort; + } + + @Builder + @NoArgsConstructor + @AllArgsConstructor + @Data + @Embeddable + public static class ParentDescription { + private String id; + private String idShort; + } + + + @Builder + @NoArgsConstructor + @AllArgsConstructor + @Data + @Embeddable + public static class TractionBatteryCodeSubcomponents { + private String subcomponentTractionBatteryCode; + private String productType; + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java index 6a32539e14..1466b4581f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java @@ -73,5 +73,14 @@ public static List toDomain(Ass .build()).toList(); } + public static List toDomain(AssetAsBuiltViewEntity entity) { +// return entity.getSubcomponents().stream().map(entry -> DetailAspectDataTractionBatteryCodeSubcomponent +// .builder() +// .tractionBatteryCode(entry.getSubcomponentTractionBatteryCode()) +// .productType(entry.getProductType()) +// .build()).toList(); + return List.of(); + } + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java new file mode 100644 index 0000000000..e92cddec7e --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java @@ -0,0 +1,48 @@ +/******************************************************************************** + * 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.assets.infrastructure.asbuilt.repository; + +import lombok.RequiredArgsConstructor; +import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltViewRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltViewEntity; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Component; + +import java.util.List; + +import static org.apache.commons.collections4.ListUtils.emptyIfNull; + +@RequiredArgsConstructor +@Component +public class AssetAsBuiltViewRepositoryImpl implements AssetAsBuiltViewRepository { + + private final JpaAssetAsBuiltViewRepository jpaAssetAsBuiltViewRepository; + + @Override + public PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria) { + List assetAsBuildSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream().map(AssetAsBuiltViewSpecification::new).toList(); + Specification specification = AssetAsBuiltViewSpecification.toSpecification(assetAsBuildSpecifications); + return new PageResult<>(jpaAssetAsBuiltViewRepository.findAll(specification, pageable), AssetAsBuiltViewEntity::toDomain); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java new file mode 100644 index 0000000000..abf5ebc92f --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java @@ -0,0 +1,116 @@ +/******************************************************************************** + * 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.assets.infrastructure.asbuilt.repository; + +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; +import jakarta.persistence.criteria.Subquery; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltViewEntity; +import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; +import org.eclipse.tractusx.traceability.common.model.SearchCriteriaStrategy; +import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +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.jetbrains.annotations.NotNull; +import org.springframework.data.jpa.domain.Specification; + +import java.util.List; + +public class AssetAsBuiltViewSpecification extends BaseSpecification implements Specification { + public AssetAsBuiltViewSpecification(SearchCriteriaFilter criteria) { + super(criteria); + } + + @Override + public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { + if (SearchCriteriaStrategy.NOTIFICATION_COUNT_EQUAL.equals(getSearchCriteriaFilter().getStrategy())) { + return activeNotificationCountEqualPredicate(getSearchCriteriaFilter(), root, builder, getSearchCriteriaFilter().getValue()); + } + + return createPredicate(getSearchCriteriaFilter(), root, builder); + } + + + private static Predicate activeNotificationCountEqualPredicate(SearchCriteriaFilter criteria, Root root, CriteriaBuilder builder, String expectedFieldValue) { + String joinTableName; + Class notificationClass; + NotificationSideBaseEntity side; + switch (criteria.getKey()) { + case "sentActiveAlertsCount" -> { + notificationClass = AlertEntity.class; + joinTableName = "alerts"; + side = NotificationSideBaseEntity.SENDER; + } + case "sentActiveInvestigationsCount" -> { + notificationClass = InvestigationEntity.class; + joinTableName = "investigations"; + side = NotificationSideBaseEntity.SENDER; + } + case "receivedActiveAlertsCount" -> { + notificationClass = AlertEntity.class; + joinTableName = "alerts"; + side = NotificationSideBaseEntity.RECEIVER; + + } + case "receivedActiveInvestigationsCount" -> { + notificationClass = InvestigationEntity.class; + joinTableName = "investigations"; + side = NotificationSideBaseEntity.RECEIVER; + } + default -> throw new UnsupportedOperationException(); + } + + CriteriaQuery cq = builder.createQuery(); + + Subquery sub = cq.subquery(Long.class); + Root subRoot = sub.from(notificationClass); + Join assetJoin = subRoot.join("assets"); + sub.select(builder.count(subRoot.get("id"))); + root.join(joinTableName, JoinType.LEFT); + sub.where( + builder.and( + builder.or( + activeNotificationPredicates(builder, subRoot) + ), + notificationSidePredicate(builder, subRoot, side), + builder.equal(assetJoin.get("id"), root.get("id"))) + + ); + return builder.equal(sub, Integer.parseInt(expectedFieldValue)); + } + + private static Predicate[] activeNotificationPredicates(CriteriaBuilder builder, Root root) { + List predicates = QualityNotificationStatus.getActiveStates().stream() + .map(state -> builder.equal(root.get("status").as(String.class), state.name())) + .toList(); + + return predicates.toArray(new Predicate[0]); + } + + private static Predicate notificationSidePredicate(CriteriaBuilder builder, Root root, NotificationSideBaseEntity side) { + return builder.equal(root.get("side").as(String.class), side.name()); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java new file mode 100644 index 0000000000..4f3bbb4a47 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java @@ -0,0 +1,29 @@ +/******************************************************************************** + * 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.assets.infrastructure.asbuilt.repository; + +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltViewEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.stereotype.Repository; + +@Repository +public interface JpaAssetAsBuiltViewRepository 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 869efb2fc4..8b8fc95fb2 100644 --- a/tx-backend/src/main/resources/application-integration-spring-boot.yml +++ b/tx-backend/src/main/resources/application-integration-spring-boot.yml @@ -43,7 +43,7 @@ spring: flyway: enabled: true jpa: - show-sql: false + show-sql: true properties: hibernate: format_sql: true diff --git a/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql b/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql new file mode 100644 index 0000000000..418c482bcf --- /dev/null +++ b/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql @@ -0,0 +1,83 @@ +CREATE VIEW assets_as_built_view AS + SELECT asset.*, + ( + select + count(alert.id) + from + alert alert + join + assets_as_built_alerts alert_assets + on alert.id=alert_assets.alert_id + where + ( + cast(alert.status as text)='CREATED' + or cast(alert.status as text)='SENT' + or cast(alert.status as text)='RECEIVED' + or cast(alert.status as text)='ACKNOWLEDGED' + or cast(alert.status as text)='ACCEPTED' + or cast(alert.status as text)='DECLINED' + ) + and cast(alert.side as text)='RECEIVER' + and alert_assets.asset_id=asset.id + ) as received_active_alerts, + ( + select + count(alert.id) + from + alert alert + join + assets_as_built_alerts alert_assets + on alert.id=alert_assets.alert_id + where + ( + cast(alert.status as text)='CREATED' + or cast(alert.status as text)='SENT' + or cast(alert.status as text)='RECEIVED' + or cast(alert.status as text)='ACKNOWLEDGED' + or cast(alert.status as text)='ACCEPTED' + or cast(alert.status as text)='DECLINED' + ) + and cast(alert.side as text)='SENDER' + and alert_assets.asset_id=asset.id + ) as send_active_alerts, + ( + select + count(investigation.id) + from + investigation investigation + join + assets_as_built_alerts investigation_assets + on investigation.id=investigation_assets.alert_id + where + ( + cast(investigation.status as text)='CREATED' + or cast(investigation.status as text)='SENT' + or cast(investigation.status as text)='RECEIVED' + or cast(investigation.status as text)='ACKNOWLEDGED' + or cast(investigation.status as text)='ACCEPTED' + or cast(investigation.status as text)='DECLINED' + ) + and cast(investigation.side as text)='RECEIVER' + and investigation_assets.asset_id=asset.id + ) as received_active_investigations, + ( + select + count(investigation.id) + from + investigation investigation + join + assets_as_built_alerts investigation_assets + on investigation.id=investigation_assets.alert_id + where + ( + cast(investigation.status as text)='CREATED' + or cast(investigation.status as text)='SENT' + or cast(investigation.status as text)='RECEIVED' + or cast(investigation.status as text)='ACKNOWLEDGED' + or cast(investigation.status as text)='ACCEPTED' + or cast(investigation.status as text)='DECLINED' + ) + and cast(investigation.side as text)='SENDER' + and investigation_assets.asset_id=asset.id + ) as send_active_investigations + FROM assets_as_built AS asset; From 1f2d65476589c36a5046ed466c764f95bca78add Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Tue, 12 Dec 2023 22:15:50 +0100 Subject: [PATCH 02/22] feature(deployment): TRACEFOSS-XXX separate auth for a and b envs on dev cluster --- .../mapper/AssetAsBuiltFieldMapper.java | 8 +-- .../asbuilt/model/AssetAsBuiltViewEntity.java | 71 +++++++++++-------- .../V5__add_view_for_as_built_assets.sql | 18 ++--- .../AssetAsBuiltControllerFilteringIT.java | 57 +++++++++++---- 4 files changed, 97 insertions(+), 57 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java index 9dc2242d68..ac02b5428e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java @@ -50,10 +50,10 @@ public class AssetAsBuiltFieldMapper extends BaseRequestFieldMapper { Map.entry("van", "van"), Map.entry("businessPartner", "manufacturerId"), Map.entry("alerts", "alerts"), - Map.entry("sentQualityAlertIdsInStatusActive", "sentActiveAlertsCount"), - Map.entry("sentQualityInvestigationIdsInStatusActive", "sentActiveInvestigationsCount"), - Map.entry("receivedQualityAlertIdsInStatusActive", "receivedActiveAlertsCount"), - Map.entry("receivedQualityInvestigationIdsInStatusActive", "receivedActiveInvestigationsCount") + Map.entry("sentQualityAlertIdsInStatusActive", "sentActiveAlerts"), + Map.entry("sentQualityInvestigationIdsInStatusActive", "sentActiveInvestigations"), + Map.entry("receivedQualityAlertIdsInStatusActive", "receivedActiveAlerts"), + Map.entry("receivedQualityInvestigationIdsInStatusActive", "receivedActiveInvestigations") ); @Override 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 24e31315b6..826a445ef0 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 @@ -24,6 +24,7 @@ import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.Table; import lombok.AllArgsConstructor; @@ -66,28 +67,36 @@ public class AssetAsBuiltViewEntity extends AssetBaseEntity { private String productType; private String tractionBatteryCode; private String receivedActiveAlerts; - private String sendActiveAlerts; + private String sentActiveAlerts; private String receivedActiveInvestigations; - private String sendActiveInvestigations; - -// @ElementCollection -// @CollectionTable(name = "traction_battery_code_subcomponent", joinColumns = {@JoinColumn(name = "traction_battery_code")}) -// private List subcomponents; -// -// -// @ElementCollection -// @CollectionTable(name = "assets_as_built_childs", joinColumns = {@JoinColumn(name = "asset_as_built_id")}) -// private List childDescriptors; -// -// @ElementCollection -// @CollectionTable(name = "assets_as_built_parents", joinColumns = {@JoinColumn(name = "asset_as_built_id")}) -// private List parentDescriptors; - -// @ManyToMany(mappedBy = "assets") -// private List investigations = new ArrayList<>(); -// -// @ManyToMany(mappedBy = "assets") -// private List alerts = new ArrayList<>(); + private String sentActiveInvestigations; + + @ElementCollection + @CollectionTable(name = "traction_battery_code_subcomponent", joinColumns = {@JoinColumn(name = "traction_battery_code")}) + private List subcomponents; + + + @ElementCollection + @CollectionTable(name = "assets_as_built_childs", joinColumns = {@JoinColumn(name = "asset_as_built_id")}) + private List childDescriptors; + + @ElementCollection + @CollectionTable(name = "assets_as_built_parents", joinColumns = {@JoinColumn(name = "asset_as_built_id")}) + private List parentDescriptors; + + @ManyToMany + @JoinTable( + name = "assets_as_built_investigations", + joinColumns = @JoinColumn(name = "asset_id"), + inverseJoinColumns = @JoinColumn(name = "investigation_id")) + private List investigations = new ArrayList<>(); + + @ManyToMany + @JoinTable( + name = "assets_as_built_alerts", + joinColumns = @JoinColumn(name = "asset_id"), + inverseJoinColumns = @JoinColumn(name = "alert_id")) + private List alerts = new ArrayList<>(); public static AssetBase toDomain(AssetAsBuiltViewEntity entity) { return AssetBase.builder() @@ -100,22 +109,22 @@ public static AssetBase toDomain(AssetAsBuiltViewEntity entity) { .nameAtManufacturer(entity.getNameAtManufacturer()) .manufacturerPartId(entity.getManufacturerPartId()) .owner(entity.getOwner()) -// .childRelations(entity.getChildDescriptors().stream() -// .map(child -> new Descriptions(child.getId(), child.getIdShort())) -// .toList()) -// .parentRelations(entity.getParentDescriptors().stream() -// .map(parent -> new Descriptions(parent.getId(), parent.getIdShort())) -// .toList()) + .childRelations(entity.getChildDescriptors().stream() + .map(child -> new Descriptions(child.getId(), child.getIdShort())) + .toList()) + .parentRelations(entity.getParentDescriptors().stream() + .map(parent -> new Descriptions(parent.getId(), parent.getIdShort())) + .toList()) .inInvestigation(entity.isInInvestigation()) .activeAlert(entity.isActiveAlert()) .qualityType(entity.getQualityType()) .van(entity.getVan()) .classification(entity.getClassification()) .detailAspectModels(DetailAspectModel.from(entity)) -// .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) -// .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) -// .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) -// .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) + .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) + .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) .build(); } diff --git a/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql b/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql index 418c482bcf..598a50bc21 100644 --- a/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql +++ b/tx-backend/src/main/resources/db/migration/V5__add_view_for_as_built_assets.sql @@ -1,5 +1,5 @@ -CREATE VIEW assets_as_built_view AS - SELECT asset.*, +create view assets_as_built_view as + select asset.*, ( select count(alert.id) @@ -39,15 +39,15 @@ CREATE VIEW assets_as_built_view AS ) and cast(alert.side as text)='SENDER' and alert_assets.asset_id=asset.id - ) as send_active_alerts, + ) as sent_active_alerts, ( select count(investigation.id) from investigation investigation join - assets_as_built_alerts investigation_assets - on investigation.id=investigation_assets.alert_id + assets_as_built_investigations investigation_assets + on investigation.id=investigation_assets.investigation_id where ( cast(investigation.status as text)='CREATED' @@ -66,8 +66,8 @@ CREATE VIEW assets_as_built_view AS from investigation investigation join - assets_as_built_alerts investigation_assets - on investigation.id=investigation_assets.alert_id + assets_as_built_investigations investigation_assets + on investigation.id=investigation_assets.investigation_id where ( cast(investigation.status as text)='CREATED' @@ -79,5 +79,5 @@ CREATE VIEW assets_as_built_view AS ) and cast(investigation.side as text)='SENDER' and investigation_assets.asset_id=asset.id - ) as send_active_investigations - FROM assets_as_built AS asset; + ) as sent_active_investigations + from assets_as_built as asset; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java index 951fe3cec9..7357f76ba7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java @@ -22,11 +22,13 @@ import io.restassured.http.ContentType; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.AssetBaseEntity; 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.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; +import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -356,7 +358,7 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter_thenReturnPro alertsSupport.storeAlertWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); alertsSupport.storeAlertWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,EQUAL,6,AND"; // When given() @@ -388,7 +390,7 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter2_thenReturnPr alertsSupport.storeAlertWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); alertsSupport.storeAlertWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,EQUAL,2,AND"; // When given() @@ -419,7 +421,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveSentInvestigationCount investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, SENDER); investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null, RECEIVER); - final String filter = "sentQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; + final String filter = "sentQualityInvestigationIdsInStatusActive,EQUAL,6,AND"; // When @@ -458,7 +460,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveReceivedInvestigationC investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null, RECEIVER); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, RECEIVER); - final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,7,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,EQUAL,7,AND"; // When @@ -490,7 +492,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,EQUAL,2,AND"; // When @@ -505,6 +507,35 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt .assertThat() .body("totalItems", equalTo(1)); } + @Test + void givenAssetsWithAlerts_whenGetAssetSortedBySentActiveAlertsDesc_thenReturnProperAssets() throws JoseException { + // Given + assetsSupport.defaultAssetsStored(); + + List assets = jpaAssetAsBuiltRepository.findAll(); + + for (int i = 0; i < assets.size(); i++) { + for ( int j = i; j >0;j--){ + alertsSupport.storeAlertWithStatusAndAssets(CREATED, List.of(assets.get(i)), null, SENDER); + } + } + + final String sort = "sentQualityAlertIdsInStatusActive,ASC"; + + + // When + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .when() + .param("sort", sort) + .get("/api/assets/as-built") + .then() + .statusCode(200) + .assertThat() + .body("totalItems", equalTo(13)) + .body("content.id", Matchers.containsInRelativeOrder(assets.stream().map(AssetBaseEntity::getId).toArray())); + } @Test void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilter3_thenReturnProperAssets() throws JoseException { @@ -522,7 +553,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,EQUAL,0,AND"; // When @@ -554,7 +585,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,EQUAL,0,AND"; // When @@ -586,8 +617,8 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter1 = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; - final String filter2 = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter1 = "receivedQualityAlertIdsInStatusActive,EQUAL,0,AND"; + final String filter2 = "receivedQualityInvestigationIdsInStatusActive,EQUAL,2,AND"; // When @@ -628,10 +659,10 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); - final String filter1 = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,3,AND"; - final String filter2 = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,4,AND"; - final String filter3 = "sentQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,1,AND"; - final String filter4 = "sentQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter1 = "receivedQualityAlertIdsInStatusActive,EQUAL,3,AND"; + final String filter2 = "receivedQualityInvestigationIdsInStatusActive,EQUAL,4,AND"; + final String filter3 = "sentQualityAlertIdsInStatusActive,EQUAL,1,AND"; + final String filter4 = "sentQualityInvestigationIdsInStatusActive,EQUAL,2,AND"; // When given() From 0b1130c69145807cb6c5b1b563dd335bef092fe9 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Tue, 12 Dec 2023 22:20:19 +0100 Subject: [PATCH 03/22] feature(tx-backend): TRACEFOSS-XXX mapping to traction battery code --- .../asbuilt/model/TractionBatteryCode.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java index 1466b4581f..a37317b4f6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/TractionBatteryCode.java @@ -74,12 +74,11 @@ public static List toDomain(Ass } public static List toDomain(AssetAsBuiltViewEntity entity) { -// return entity.getSubcomponents().stream().map(entry -> DetailAspectDataTractionBatteryCodeSubcomponent -// .builder() -// .tractionBatteryCode(entry.getSubcomponentTractionBatteryCode()) -// .productType(entry.getProductType()) -// .build()).toList(); - return List.of(); + return entity.getSubcomponents().stream().map(entry -> DetailAspectDataTractionBatteryCodeSubcomponent + .builder() + .tractionBatteryCode(entry.getSubcomponentTractionBatteryCode()) + .productType(entry.getProductType()) + .build()).toList(); } From a08134cdd10a82ada2c70e9a1bce56f3463e54af Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Tue, 12 Dec 2023 22:36:05 +0100 Subject: [PATCH 04/22] feature(tx-backend): TRACEFOSS-2701 compatibility with existing FE --- .../AssetAsBuiltViewSpecification.java | 75 ------------------- .../common/repository/BaseSpecification.java | 3 +- .../AssetAsBuiltControllerFilteringIT.java | 30 ++++---- 3 files changed, 17 insertions(+), 91 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java index abf5ebc92f..927c08403d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewSpecification.java @@ -21,24 +21,14 @@ import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.Join; -import jakarta.persistence.criteria.JoinType; import jakarta.persistence.criteria.Predicate; import jakarta.persistence.criteria.Root; -import jakarta.persistence.criteria.Subquery; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltViewEntity; import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; -import org.eclipse.tractusx.traceability.common.model.SearchCriteriaStrategy; import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -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.jetbrains.annotations.NotNull; import org.springframework.data.jpa.domain.Specification; -import java.util.List; - public class AssetAsBuiltViewSpecification extends BaseSpecification implements Specification { public AssetAsBuiltViewSpecification(SearchCriteriaFilter criteria) { super(criteria); @@ -46,71 +36,6 @@ public AssetAsBuiltViewSpecification(SearchCriteriaFilter criteria) { @Override public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { - if (SearchCriteriaStrategy.NOTIFICATION_COUNT_EQUAL.equals(getSearchCriteriaFilter().getStrategy())) { - return activeNotificationCountEqualPredicate(getSearchCriteriaFilter(), root, builder, getSearchCriteriaFilter().getValue()); - } - return createPredicate(getSearchCriteriaFilter(), root, builder); } - - - private static Predicate activeNotificationCountEqualPredicate(SearchCriteriaFilter criteria, Root root, CriteriaBuilder builder, String expectedFieldValue) { - String joinTableName; - Class notificationClass; - NotificationSideBaseEntity side; - switch (criteria.getKey()) { - case "sentActiveAlertsCount" -> { - notificationClass = AlertEntity.class; - joinTableName = "alerts"; - side = NotificationSideBaseEntity.SENDER; - } - case "sentActiveInvestigationsCount" -> { - notificationClass = InvestigationEntity.class; - joinTableName = "investigations"; - side = NotificationSideBaseEntity.SENDER; - } - case "receivedActiveAlertsCount" -> { - notificationClass = AlertEntity.class; - joinTableName = "alerts"; - side = NotificationSideBaseEntity.RECEIVER; - - } - case "receivedActiveInvestigationsCount" -> { - notificationClass = InvestigationEntity.class; - joinTableName = "investigations"; - side = NotificationSideBaseEntity.RECEIVER; - } - default -> throw new UnsupportedOperationException(); - } - - CriteriaQuery cq = builder.createQuery(); - - Subquery sub = cq.subquery(Long.class); - Root subRoot = sub.from(notificationClass); - Join assetJoin = subRoot.join("assets"); - sub.select(builder.count(subRoot.get("id"))); - root.join(joinTableName, JoinType.LEFT); - sub.where( - builder.and( - builder.or( - activeNotificationPredicates(builder, subRoot) - ), - notificationSidePredicate(builder, subRoot, side), - builder.equal(assetJoin.get("id"), root.get("id"))) - - ); - return builder.equal(sub, Integer.parseInt(expectedFieldValue)); - } - - private static Predicate[] activeNotificationPredicates(CriteriaBuilder builder, Root root) { - List predicates = QualityNotificationStatus.getActiveStates().stream() - .map(state -> builder.equal(root.get("status").as(String.class), state.name())) - .toList(); - - return predicates.toArray(new Predicate[0]); - } - - private static Predicate notificationSidePredicate(CriteriaBuilder builder, Root root, NotificationSideBaseEntity side) { - return builder.equal(root.get("side").as(String.class), side.name()); - } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/BaseSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/BaseSpecification.java index 204f1636e2..a2de57a0d4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/BaseSpecification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/BaseSpecification.java @@ -42,6 +42,7 @@ import static java.util.stream.Collectors.groupingBy; import static org.eclipse.tractusx.traceability.common.model.SearchCriteriaStrategy.AFTER_LOCAL_DATE; import static org.eclipse.tractusx.traceability.common.model.SearchCriteriaStrategy.BEFORE_LOCAL_DATE; +import static org.eclipse.tractusx.traceability.common.model.SearchCriteriaStrategy.NOTIFICATION_COUNT_EQUAL; @Getter public abstract class BaseSpecification implements Specification { @@ -57,7 +58,7 @@ protected Predicate createPredicate(SearchCriteriaFilter criteria, Root root, String fieldName = getJoinTableFieldName(criteria.getKey()); Path fieldPath = getFieldPath(root, criteria); - if (SearchCriteriaStrategy.EQUAL.equals(criteria.getStrategy())) { + if (SearchCriteriaStrategy.EQUAL.equals(criteria.getStrategy()) || NOTIFICATION_COUNT_EQUAL.equals(criteria.getStrategy())) { return builder.equal( fieldPath.as(String.class), expectedFieldValue); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java index 7357f76ba7..3268a17154 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java @@ -27,7 +27,6 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; @@ -358,7 +357,7 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter_thenReturnPro alertsSupport.storeAlertWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); alertsSupport.storeAlertWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityAlertIdsInStatusActive,EQUAL,6,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; // When given() @@ -390,7 +389,7 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter2_thenReturnPr alertsSupport.storeAlertWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); alertsSupport.storeAlertWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityAlertIdsInStatusActive,EQUAL,2,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When given() @@ -421,7 +420,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveSentInvestigationCount investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, SENDER); investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null, RECEIVER); - final String filter = "sentQualityInvestigationIdsInStatusActive,EQUAL,6,AND"; + final String filter = "sentQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; // When @@ -460,7 +459,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveReceivedInvestigationC investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null, RECEIVER); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, RECEIVER); - final String filter = "receivedQualityInvestigationIdsInStatusActive,EQUAL,7,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,7,AND"; // When @@ -492,7 +491,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityInvestigationIdsInStatusActive,EQUAL,2,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When @@ -507,6 +506,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt .assertThat() .body("totalItems", equalTo(1)); } + @Test void givenAssetsWithAlerts_whenGetAssetSortedBySentActiveAlertsDesc_thenReturnProperAssets() throws JoseException { // Given @@ -515,7 +515,7 @@ void givenAssetsWithAlerts_whenGetAssetSortedBySentActiveAlertsDesc_thenReturnPr List assets = jpaAssetAsBuiltRepository.findAll(); for (int i = 0; i < assets.size(); i++) { - for ( int j = i; j >0;j--){ + for (int j = i; j > 0; j--) { alertsSupport.storeAlertWithStatusAndAssets(CREATED, List.of(assets.get(i)), null, SENDER); } } @@ -553,7 +553,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityInvestigationIdsInStatusActive,EQUAL,0,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; // When @@ -585,7 +585,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "receivedQualityAlertIdsInStatusActive,EQUAL,0,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; // When @@ -617,8 +617,8 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter1 = "receivedQualityAlertIdsInStatusActive,EQUAL,0,AND"; - final String filter2 = "receivedQualityInvestigationIdsInStatusActive,EQUAL,2,AND"; + final String filter1 = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; + final String filter2 = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When @@ -659,10 +659,10 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); - final String filter1 = "receivedQualityAlertIdsInStatusActive,EQUAL,3,AND"; - final String filter2 = "receivedQualityInvestigationIdsInStatusActive,EQUAL,4,AND"; - final String filter3 = "sentQualityAlertIdsInStatusActive,EQUAL,1,AND"; - final String filter4 = "sentQualityInvestigationIdsInStatusActive,EQUAL,2,AND"; + final String filter1 = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,3,AND"; + final String filter2 = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,4,AND"; + final String filter3 = "sentQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,1,AND"; + final String filter4 = "sentQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When given() From f66a5b3498c99f7d7ffcd902a8df4b11bbee3360 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Tue, 12 Dec 2023 23:06:24 +0100 Subject: [PATCH 05/22] feature(tx-backend): TRACEFOSS-2701 cleanup unused specification --- .../repository/AssetAsPlannedRepository.java | 5 + .../service/AssetAsPlannedServiceImpl.java | 9 ++ .../assets/domain/base/AssetRepository.java | 5 - .../service/AbstractAssetBaseService.java | 8 -- .../repository/AssetAsBuildSpecification.java | 117 ------------------ .../AssetAsBuiltRepositoryImpl.java | 13 -- .../service/AbstractAssetBaseServiceTest.java | 9 ++ 7 files changed, 23 insertions(+), 143 deletions(-) delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/repository/AssetAsPlannedRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/repository/AssetAsPlannedRepository.java index c136c46010..b567c4bf2b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/repository/AssetAsPlannedRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/repository/AssetAsPlannedRepository.java @@ -20,8 +20,13 @@ package org.eclipse.tractusx.traceability.assets.domain.asplanned.repository; import org.eclipse.tractusx.traceability.assets.domain.base.AssetRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.springframework.data.domain.Pageable; public interface AssetAsPlannedRepository extends AssetRepository { + PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/service/AssetAsPlannedServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/service/AssetAsPlannedServiceImpl.java index ac5683bfe2..fd73734410 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/service/AssetAsPlannedServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asplanned/service/AssetAsPlannedServiceImpl.java @@ -24,9 +24,13 @@ import org.eclipse.tractusx.traceability.assets.domain.asplanned.repository.AssetAsPlannedRepository; import org.eclipse.tractusx.traceability.assets.domain.base.AssetRepository; import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.domain.base.service.AbstractAssetBaseService; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.request.BomLifecycle; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.relationship.Aspect; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; import java.util.Collections; @@ -65,4 +69,9 @@ protected BomLifecycle getBomLifecycle() { protected IrsRepository getIrsRepository() { return irsRepository; } + + @Override + public PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria) { + return assetAsPlannedRepository.getAssets(pageable, searchCriteria); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java index a3b93a8ae5..12c06745f2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java @@ -22,9 +22,6 @@ import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.AssetBaseEntity; -import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.model.SearchCriteria; -import org.springframework.data.domain.Pageable; import java.util.List; @@ -37,8 +34,6 @@ public interface AssetRepository { AssetBase getAssetByChildId(String childId); - PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria); - List getAssets(); AssetBase save(AssetBase asset); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java index 3fe32eb8b8..5477ac919b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java @@ -31,11 +31,8 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.Direction; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.relationship.Aspect; import org.eclipse.tractusx.traceability.common.config.AssetsAsyncConfig; -import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.springframework.data.domain.Pageable; import org.springframework.scheduling.annotation.Async; import java.util.Arrays; @@ -127,11 +124,6 @@ public AssetBase updateQualityType(String assetId, QualityType qualityType) { return getAssetRepository().save(foundAsset); } - @Override - public PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria) { - return getAssetRepository().getAssets(pageable, searchCriteria); - } - @Override public AssetBase getAssetById(String assetId) { return getAssetRepository().getAssetById(assetId); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java deleted file mode 100644 index dd6b4b2676..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************** - * 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.assets.infrastructure.asbuilt.repository; - -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.Join; -import jakarta.persistence.criteria.JoinType; -import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Root; -import jakarta.persistence.criteria.Subquery; -import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; -import org.eclipse.tractusx.traceability.common.model.SearchCriteriaStrategy; -import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -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.jetbrains.annotations.NotNull; -import org.springframework.data.jpa.domain.Specification; - -import java.util.List; - - -public class AssetAsBuildSpecification extends BaseSpecification implements Specification { - public AssetAsBuildSpecification(SearchCriteriaFilter criteria) { - super(criteria); - } - - @Override - public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { - if (SearchCriteriaStrategy.NOTIFICATION_COUNT_EQUAL.equals(getSearchCriteriaFilter().getStrategy())) { - return activeNotificationCountEqualPredicate(getSearchCriteriaFilter(), root, builder, getSearchCriteriaFilter().getValue()); - } - - return createPredicate(getSearchCriteriaFilter(), root, builder); - } - - - private static Predicate activeNotificationCountEqualPredicate(SearchCriteriaFilter criteria, Root root, CriteriaBuilder builder, String expectedFieldValue) { - String joinTableName; - Class notificationClass; - NotificationSideBaseEntity side; - switch (criteria.getKey()) { - case "sentActiveAlertsCount" -> { - notificationClass = AlertEntity.class; - joinTableName = "alerts"; - side = NotificationSideBaseEntity.SENDER; - } - case "sentActiveInvestigationsCount" -> { - notificationClass = InvestigationEntity.class; - joinTableName = "investigations"; - side = NotificationSideBaseEntity.SENDER; - } - case "receivedActiveAlertsCount" -> { - notificationClass = AlertEntity.class; - joinTableName = "alerts"; - side = NotificationSideBaseEntity.RECEIVER; - - } - case "receivedActiveInvestigationsCount" -> { - notificationClass = InvestigationEntity.class; - joinTableName = "investigations"; - side = NotificationSideBaseEntity.RECEIVER; - } - default -> throw new UnsupportedOperationException(); - } - - CriteriaQuery cq = builder.createQuery(); - - Subquery sub = cq.subquery(Long.class); - Root subRoot = sub.from(notificationClass); - Join assetJoin = subRoot.join("assets"); - sub.select(builder.count(subRoot.get("id"))); - root.join(joinTableName, JoinType.LEFT); - sub.where( - builder.and( - builder.or( - activeNotificationPredicates(builder, subRoot) - ), - notificationSidePredicate(builder, subRoot, side), - builder.equal(assetJoin.get("id"), root.get("id"))) - - ); - return builder.equal(sub, Integer.parseInt(expectedFieldValue)); - } - - private static Predicate[] activeNotificationPredicates(CriteriaBuilder builder, Root root) { - List predicates = QualityNotificationStatus.getActiveStates().stream() - .map(state -> builder.equal(root.get("status").as(String.class), state.name())) - .toList(); - - return predicates.toArray(new Predicate[0]); - } - - private static Predicate notificationSidePredicate(CriteriaBuilder builder, Root root, NotificationSideBaseEntity side) { - return builder.equal(root.get("side").as(String.class), side.name()); - } -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java index 4a49d93874..104f2c0751 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java @@ -30,17 +30,11 @@ import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.common.repository.CriteriaUtility; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; import java.util.List; -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - @RequiredArgsConstructor @Component public class AssetAsBuiltRepositoryImpl implements AssetAsBuiltRepository { @@ -77,13 +71,6 @@ public AssetBase getAssetByChildId(String childId) { .orElseThrow(() -> new AssetNotFoundException("Child Asset Not Found")); } - @Override - public PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria) { - List assetAsBuildSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream().map(AssetAsBuildSpecification::new).toList(); - Specification specification = AssetAsBuildSpecification.toSpecification(assetAsBuildSpecifications); - return new PageResult<>(jpaAssetAsBuiltRepository.findAll(specification, pageable), AssetAsBuiltEntity::toDomain); - } - @Override public List getFieldValues(String fieldName, String startWith, Integer resultLimit, Owner owner) { return CriteriaUtility.getDistinctAssetFieldValues(fieldName, startWith, resultLimit, owner, AssetAsBuiltEntity.class, entityManager); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseServiceTest.java index f419c22a94..f79d135be7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseServiceTest.java @@ -2,11 +2,15 @@ import org.eclipse.tractusx.traceability.assets.domain.base.AssetRepository; import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.request.BomLifecycle; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.springframework.data.domain.Pageable; import java.util.List; import java.util.stream.Stream; @@ -89,6 +93,11 @@ protected List getUpwardAspects() { protected BomLifecycle getBomLifecycle() { return null; } + + @Override + public PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria) { + return null; + } } } From 95ccad09618865b6e6ce66d2bed23cc04ffa6bc7 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Wed, 13 Dec 2023 16:15:29 +0100 Subject: [PATCH 06/22] feature(tx-backend): TRACEFOSS-XXXX after review changes --- .../AssetAsBuiltViewRepository.java | 10 ++++ .../service/AssetAsBuiltServiceImpl.java | 26 +++++++++ .../assets/domain/base/AssetRepository.java | 3 - .../asbuilt/model/AssetAsBuiltEntity.java | 51 +++++++--------- .../asbuilt/model/AssetAsBuiltViewEntity.java | 58 +++++++------------ .../AssetAsBuiltRepositoryImpl.java | 15 +++-- .../AssetAsBuiltViewRepositoryImpl.java | 31 ++++++++++ .../repository/JpaAssetAsBuiltRepository.java | 4 -- .../JpaAssetAsBuiltViewRepository.java | 3 + .../AssetAsPlannedRepositoryImpl.java | 6 -- .../JpaAssetAsPlannedRepository.java | 3 - ...PersistentAssetsAsBuiltRepositoryTest.java | 2 +- 12 files changed, 122 insertions(+), 90 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java index 974bce3de7..d52f07b640 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/repository/AssetAsBuiltViewRepository.java @@ -24,6 +24,16 @@ import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.springframework.data.domain.Pageable; +import java.util.List; + public interface AssetAsBuiltViewRepository { PageResult getAssets(Pageable pageable, SearchCriteria searchCriteria); + + List getAssets(); + + AssetBase getAssetByChildId(String childId); + + List getAssetsById(List assetIds); + + AssetBase getAssetById(String assetId); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java index 07d1a882db..59ebc5cc0e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/asbuilt/service/AssetAsBuiltServiceImpl.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.domain.base.service.AbstractAssetBaseService; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.ManufacturingInfo; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.request.BomLifecycle; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.relationship.Aspect; import org.eclipse.tractusx.traceability.common.model.PageResult; @@ -35,6 +36,8 @@ import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Slf4j @Component @@ -77,4 +80,27 @@ public PageResult getAssets(Pageable pageable, SearchCriteria searchC return assetAsBuiltViewRepository.getAssets(pageable, searchCriteria); } + @Override + public Map getAssetsCountryMap() { + return assetAsBuiltViewRepository.getAssets().stream() + .collect(Collectors.groupingBy( + asset -> ManufacturingInfo.from(asset.getDetailAspectModels()).getManufacturingCountry(), Collectors.counting())); + } + + @Override + public AssetBase getAssetByChildId(String assetId, String childId) { + return assetAsBuiltViewRepository.getAssetByChildId(childId); + } + + @Override + public List getAssetsById(List assetIds) { + return assetAsBuiltViewRepository.getAssetsById(assetIds); + } + + @Override + public AssetBase getAssetById(String assetId) { + return assetAsBuiltViewRepository.getAssetById(assetId); + } + + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java index 12c06745f2..df0f3b61d7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java @@ -21,7 +21,6 @@ import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; -import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.AssetBaseEntity; import java.util.List; @@ -47,6 +46,4 @@ public interface AssetRepository { long countAssetsByOwner(Owner owner); List getFieldValues(String fieldName, String startWith, Integer resultLimit, Owner owner); - - List findByOwner(Owner owner); } 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 f00c708c07..34ec0bacd2 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 @@ -120,43 +120,36 @@ public static AssetAsBuiltEntity from(AssetBase asset) { .build(); } - public static AssetBase toDomain(AssetAsBuiltEntity entity) { + public AssetBase toDomain() { return AssetBase.builder() - .id(entity.getId()) - .idShort(entity.getIdShort()) - .semanticDataModel(SemanticDataModelEntity.toDomain(entity.getSemanticDataModel())) - .semanticModelId(entity.getSemanticModelId()) - .manufacturerId(entity.getManufacturerId()) - .manufacturerName(entity.getManufacturerName()) - .nameAtManufacturer(entity.getNameAtManufacturer()) - .manufacturerPartId(entity.getManufacturerPartId()) - .owner(entity.getOwner()) - .childRelations(entity.getChildDescriptors().stream() + .id(this.getId()) + .idShort(this.getIdShort()) + .semanticDataModel(SemanticDataModelEntity.toDomain(this.getSemanticDataModel())) + .semanticModelId(this.getSemanticModelId()) + .manufacturerId(this.getManufacturerId()) + .manufacturerName(this.getManufacturerName()) + .nameAtManufacturer(this.getNameAtManufacturer()) + .manufacturerPartId(this.getManufacturerPartId()) + .owner(this.getOwner()) + .childRelations(this.getChildDescriptors().stream() .map(child -> new Descriptions(child.getId(), child.getIdShort())) .toList()) - .parentRelations(entity.getParentDescriptors().stream() + .parentRelations(this.getParentDescriptors().stream() .map(parent -> new Descriptions(parent.getId(), parent.getIdShort())) .toList()) - .inInvestigation(entity.isInInvestigation()) - .activeAlert(entity.isActiveAlert()) - .qualityType(entity.getQualityType()) - .van(entity.getVan()) - .classification(entity.getClassification()) - .detailAspectModels(DetailAspectModel.from(entity)) - .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) - .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) - .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) - .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) - + .inInvestigation(this.isInInvestigation()) + .activeAlert(this.isActiveAlert()) + .qualityType(this.getQualityType()) + .van(this.getVan()) + .classification(this.getClassification()) + .detailAspectModels(DetailAspectModel.from(this)) + .sentQualityAlerts(emptyIfNull(this.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .receivedQualityAlerts(emptyIfNull(this.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .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()) .build(); } - public static List toDomainList(List entities) { - return entities.stream() - .map(AssetAsBuiltEntity::toDomain) - .toList(); - } - public static List fromList(List assets) { return assets.stream() .map(AssetAsBuiltEntity::from) 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 826a445ef0..0b2843e6dd 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 @@ -49,7 +49,6 @@ import java.util.List; import static org.apache.commons.collections4.ListUtils.emptyIfNull; -import static org.eclipse.tractusx.traceability.common.date.DateUtil.toInstant; @Getter @Setter @@ -98,49 +97,36 @@ public class AssetAsBuiltViewEntity extends AssetBaseEntity { inverseJoinColumns = @JoinColumn(name = "alert_id")) private List alerts = new ArrayList<>(); - public static AssetBase toDomain(AssetAsBuiltViewEntity entity) { + public AssetBase toDomain() { return AssetBase.builder() - .id(entity.getId()) - .idShort(entity.getIdShort()) - .semanticDataModel(SemanticDataModelEntity.toDomain(entity.getSemanticDataModel())) - .semanticModelId(entity.getSemanticModelId()) - .manufacturerId(entity.getManufacturerId()) - .manufacturerName(entity.getManufacturerName()) - .nameAtManufacturer(entity.getNameAtManufacturer()) - .manufacturerPartId(entity.getManufacturerPartId()) - .owner(entity.getOwner()) - .childRelations(entity.getChildDescriptors().stream() + .id(this.getId()) + .idShort(this.getIdShort()) + .semanticDataModel(SemanticDataModelEntity.toDomain(this.getSemanticDataModel())) + .semanticModelId(this.getSemanticModelId()) + .manufacturerId(this.getManufacturerId()) + .manufacturerName(this.getManufacturerName()) + .nameAtManufacturer(this.getNameAtManufacturer()) + .manufacturerPartId(this.getManufacturerPartId()) + .owner(this.getOwner()) + .childRelations(this.getChildDescriptors().stream() .map(child -> new Descriptions(child.getId(), child.getIdShort())) .toList()) - .parentRelations(entity.getParentDescriptors().stream() + .parentRelations(this.getParentDescriptors().stream() .map(parent -> new Descriptions(parent.getId(), parent.getIdShort())) .toList()) - .inInvestigation(entity.isInInvestigation()) - .activeAlert(entity.isActiveAlert()) - .qualityType(entity.getQualityType()) - .van(entity.getVan()) - .classification(entity.getClassification()) - .detailAspectModels(DetailAspectModel.from(entity)) - .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) - .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) - .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) - .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) - + .inInvestigation(this.isInInvestigation()) + .activeAlert(this.isActiveAlert()) + .qualityType(this.getQualityType()) + .van(this.getVan()) + .classification(this.getClassification()) + .detailAspectModels(DetailAspectModel.from(this)) + .sentQualityAlerts(emptyIfNull(this.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .receivedQualityAlerts(emptyIfNull(this.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .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()) .build(); } - public static List toDomainList(List entities) { - return entities.stream() - .map(AssetAsBuiltEntity::toDomain) - .toList(); - } - - public static List fromList(List assets) { - return assets.stream() - .map(AssetAsBuiltEntity::from) - .toList(); - } - @Builder @NoArgsConstructor diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java index 104f2c0751..ab724dbdb1 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java @@ -79,18 +79,22 @@ public List getFieldValues(String fieldName, String startWith, Integer r @Override @Transactional public List getAssets() { - return AssetAsBuiltEntity.toDomainList(jpaAssetAsBuiltRepository.findAll()); + return jpaAssetAsBuiltRepository.findAll().stream() + .map(AssetAsBuiltEntity::toDomain) + .toList(); } @Override public AssetBase save(AssetBase asset) { - return AssetAsBuiltEntity.toDomain(jpaAssetAsBuiltRepository.save(AssetAsBuiltEntity.from(asset))); + return jpaAssetAsBuiltRepository.save(AssetAsBuiltEntity.from(asset)).toDomain(); } @Override @Transactional public List saveAll(List assets) { - return AssetAsBuiltEntity.toDomainList(jpaAssetAsBuiltRepository.saveAll(AssetAsBuiltEntity.fromList(assets))); + return jpaAssetAsBuiltRepository.saveAll(AssetAsBuiltEntity.fromList(assets)).stream() + .map(AssetAsBuiltEntity::toDomain) + .toList(); } @@ -115,9 +119,4 @@ public long countAssets() { public long countAssetsByOwner(Owner owner) { return jpaAssetAsBuiltRepository.countAssetsByOwner(owner); } - - @Override - public List findByOwner(Owner owner) { - return jpaAssetAsBuiltRepository.findByOwner(owner); - } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java index e92cddec7e..7f5970cba2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltViewRepositoryImpl.java @@ -20,6 +20,7 @@ package org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository; import lombok.RequiredArgsConstructor; +import org.eclipse.tractusx.traceability.assets.domain.asbuilt.exception.AssetNotFoundException; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltViewRepository; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltViewEntity; @@ -28,6 +29,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -35,6 +37,7 @@ @RequiredArgsConstructor @Component +@Transactional(readOnly = true) public class AssetAsBuiltViewRepositoryImpl implements AssetAsBuiltViewRepository { private final JpaAssetAsBuiltViewRepository jpaAssetAsBuiltViewRepository; @@ -45,4 +48,32 @@ public PageResult getAssets(Pageable pageable, SearchCriteria searchC Specification specification = AssetAsBuiltViewSpecification.toSpecification(assetAsBuildSpecifications); return new PageResult<>(jpaAssetAsBuiltViewRepository.findAll(specification, pageable), AssetAsBuiltViewEntity::toDomain); } + + @Override + public List getAssets() { + return jpaAssetAsBuiltViewRepository.findAll().stream() + .map(AssetAsBuiltViewEntity::toDomain).toList(); + + } + + @Override + public AssetBase getAssetByChildId(String childId) { + return jpaAssetAsBuiltViewRepository.findById(childId) + .map(AssetAsBuiltViewEntity::toDomain) + .orElseThrow(() -> new AssetNotFoundException("Child Asset Not Found")); + } + + @Override + public List getAssetsById(List assetIds) { + return jpaAssetAsBuiltViewRepository.findByIdIn(assetIds).stream() + .map(AssetAsBuiltViewEntity::toDomain) + .toList(); + } + + @Override + public AssetBase getAssetById(String assetId) { + return jpaAssetAsBuiltViewRepository.findById(assetId) + .map(AssetAsBuiltViewEntity::toDomain) + .orElseThrow(() -> new AssetNotFoundException("Asset with id %s was not found.".formatted(assetId))); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java index 8ef38ce04f..6d592c574f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java @@ -33,10 +33,6 @@ @Repository public interface JpaAssetAsBuiltRepository extends JpaRepository, JpaSpecificationExecutor { - - @Query("SELECT asset FROM AssetAsBuiltEntity asset WHERE asset.owner = :owner") - List findByOwner(@Param("owner") Owner owner); - List findByIdIn(List assetIds); @Query("SELECT COUNT(asset) FROM AssetAsBuiltEntity asset WHERE asset.owner = :owner") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java index 4f3bbb4a47..89559894c8 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltViewRepository.java @@ -24,6 +24,9 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface JpaAssetAsBuiltViewRepository extends JpaRepository, JpaSpecificationExecutor { + List findByIdIn(List assetIds); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java index 60a158ac23..20f34c577e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java @@ -119,12 +119,6 @@ public long countAssetsByOwner(Owner owner) { return jpaAssetAsPlannedRepository.countAssetsByOwner(owner); } - - @Override - public List findByOwner(Owner owner) { - return jpaAssetAsPlannedRepository.findByOwner(owner); - } - @Override public List getFieldValues(String fieldName, String startWith, Integer resultLimit, Owner owner) { return CriteriaUtility.getDistinctAssetFieldValues(fieldName, startWith, resultLimit, owner, AssetAsPlannedEntity.class, entityManager); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java index 6319d1ebcd..bcbfcfa074 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java @@ -28,9 +28,6 @@ import java.util.List; public interface JpaAssetAsPlannedRepository extends JpaRepository, JpaSpecificationExecutor { - @Query("SELECT asset FROM AssetAsPlannedEntity asset WHERE asset.owner = :owner") - List findByOwner(@Param("owner") Owner owner); - List findByIdIn(List assetIds); @Query("SELECT COUNT(asset) FROM AssetAsPlannedEntity asset WHERE asset.owner = :owner") diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/infrastructure/repository/jpa/PersistentAssetsAsBuiltRepositoryTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/infrastructure/repository/jpa/PersistentAssetsAsBuiltRepositoryTest.java index 07276bd694..1918f83a56 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/infrastructure/repository/jpa/PersistentAssetsAsBuiltRepositoryTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/infrastructure/repository/jpa/PersistentAssetsAsBuiltRepositoryTest.java @@ -80,7 +80,7 @@ void testToAsset() { .build(); // when - AssetBase asset = AssetAsBuiltEntity.toDomain(entity); + AssetBase asset = entity.toDomain(); // then From b2eb31f28ee3c0173cf1d5c83a60e39e65fb34dd Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 13 Dec 2023 16:20:16 +0100 Subject: [PATCH 07/22] feat(investigation): TRACEFOSS-2857 refactoring notification request --- .../alerts/detail/alert-detail.component.html | 5 +- .../alerts/detail/alert-detail.component.ts | 3 +- .../investigation-detail.component.html | 5 +- .../detail/investigation-detail.component.ts | 3 +- .../supplier-parts.component.html | 5 +- .../supplier-parts.component.ts | 2 + .../parts/presentation/parts.component.html | 5 +- .../parts/presentation/parts.component.ts | 2 + .../components/request-notification/index.ts | 2 +- ...ml => notification-request.component.html} | 0 ...=> notification-request.component.spec.ts} | 31 ++-- .../request-alert.component.ts | 78 --------- .../request-investigation.component.ts | 79 --------- .../request-notification.base.ts | 127 --------------- .../request-notification.component.ts | 154 ++++++++++++++++++ .../start-investigation.component.html | 5 +- .../start-investigation.component.scss | 2 +- .../start-investigation.component.ts | 3 + .../src/app/modules/shared/shared.module.ts | 9 +- 19 files changed, 203 insertions(+), 317 deletions(-) rename frontend/src/app/modules/shared/components/request-notification/{request-notification.base.html => notification-request.component.html} (100%) rename frontend/src/app/modules/shared/components/request-notification/{request-notification.base.spec.ts => notification-request.component.spec.ts} (87%) delete mode 100644 frontend/src/app/modules/shared/components/request-notification/request-alert.component.ts delete mode 100644 frontend/src/app/modules/shared/components/request-notification/request-investigation.component.ts delete mode 100644 frontend/src/app/modules/shared/components/request-notification/request-notification.base.ts create mode 100644 frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts diff --git a/frontend/src/app/modules/page/alerts/detail/alert-detail.component.html b/frontend/src/app/modules/page/alerts/detail/alert-detail.component.html index f901a7a880..f406ede10a 100644 --- a/frontend/src/app/modules/page/alerts/detail/alert-detail.component.html +++ b/frontend/src/app/modules/page/alerts/detail/alert-detail.component.html @@ -228,12 +228,13 @@

{{ 'dataLoading.error' | i18n }}

- + > diff --git a/frontend/src/app/modules/page/alerts/detail/alert-detail.component.ts b/frontend/src/app/modules/page/alerts/detail/alert-detail.component.ts index a9afd6032e..054991a0da 100644 --- a/frontend/src/app/modules/page/alerts/detail/alert-detail.component.ts +++ b/frontend/src/app/modules/page/alerts/detail/alert-detail.component.ts @@ -27,7 +27,7 @@ import { Part } from '@page/parts/model/parts.model'; import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component'; import { CreateHeaderFromColumns, TableConfig, TableEventConfig } from '@shared/components/table/table.model'; import { ToastService } from '@shared/components/toasts/toast.service'; -import { Notification } from '@shared/model/notification.model'; +import {Notification, NotificationType} from '@shared/model/notification.model'; import { TranslationContext } from '@shared/model/translation-context.model'; import { View } from '@shared/model/view.model'; import { StaticIdService } from '@shared/service/staticId.service'; @@ -204,4 +204,5 @@ export class AlertDetailComponent implements AfterViewInit, OnDestroy { } protected readonly TranslationContext = TranslationContext; + protected readonly NotificationType = NotificationType; } diff --git a/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.html b/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.html index 2711fb5f30..9ac3db03c2 100644 --- a/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.html +++ b/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.html @@ -230,12 +230,13 @@

{{ 'dataLoading.error' | i18n }}

- + > diff --git a/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.ts b/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.ts index 1cf62ae46c..5b66fd1880 100644 --- a/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.ts +++ b/frontend/src/app/modules/page/investigations/detail/investigation-detail.component.ts @@ -29,7 +29,7 @@ import { Part } from '@page/parts/model/parts.model'; import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component'; import { CreateHeaderFromColumns, TableConfig, TableEventConfig } from '@shared/components/table/table.model'; import { ToastService } from '@shared/components/toasts/toast.service'; -import { Notification } from '@shared/model/notification.model'; +import { Notification, NotificationType } from '@shared/model/notification.model'; import { TranslationContext } from '@shared/model/translation-context.model'; import { View } from '@shared/model/view.model'; import { StaticIdService } from '@shared/service/staticId.service'; @@ -207,4 +207,5 @@ export class InvestigationDetailComponent implements AfterViewInit, OnDestroy { } protected readonly TranslationContext = TranslationContext; + protected readonly NotificationType = NotificationType; } diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html index 73422250a8..58d6e2a919 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html @@ -89,13 +89,14 @@ - + > diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.ts b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.ts index f83c64483f..57ecd54899 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.ts @@ -32,6 +32,7 @@ import { View } from '@shared/model/view.model'; import { PartDetailsFacade } from '@shared/modules/part-details/core/partDetails.facade'; import { StaticIdService } from '@shared/service/staticId.service'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; +import {NotificationType} from "@shared/model/notification.model"; @Component({ selector: 'app-supplier-parts', @@ -131,4 +132,5 @@ export class SupplierPartsComponent implements OnInit, OnDestroy { protected readonly MainAspectType = MainAspectType; protected readonly TableType = TableType; + protected readonly NotificationType = NotificationType; } diff --git a/frontend/src/app/modules/page/parts/presentation/parts.component.html b/frontend/src/app/modules/page/parts/presentation/parts.component.html index a9f5f48ec0..6dcb833dae 100644 --- a/frontend/src/app/modules/page/parts/presentation/parts.component.html +++ b/frontend/src/app/modules/page/parts/presentation/parts.component.html @@ -104,14 +104,15 @@ - + > diff --git a/frontend/src/app/modules/page/parts/presentation/parts.component.ts b/frontend/src/app/modules/page/parts/presentation/parts.component.ts index 0b10b2cdae..9f29488264 100644 --- a/frontend/src/app/modules/page/parts/presentation/parts.component.ts +++ b/frontend/src/app/modules/page/parts/presentation/parts.component.ts @@ -37,6 +37,7 @@ import { PartDetailsFacade } from '@shared/modules/part-details/core/partDetails import { BomLifecycleSettingsService, UserSettingView } from '@shared/service/bom-lifecycle-settings.service'; import { StaticIdService } from '@shared/service/staticId.service'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; +import {NotificationType} from "@shared/model/notification.model"; @Component({ @@ -225,4 +226,5 @@ export class PartsComponent implements OnInit, OnDestroy, AfterViewInit { protected readonly UserSettingView = UserSettingView; protected readonly TableType = TableType; protected readonly MainAspectType = MainAspectType; + protected readonly NotificationType = NotificationType; } diff --git a/frontend/src/app/modules/shared/components/request-notification/index.ts b/frontend/src/app/modules/shared/components/request-notification/index.ts index 74dd8f4030..9983d52ea7 100644 --- a/frontend/src/app/modules/shared/components/request-notification/index.ts +++ b/frontend/src/app/modules/shared/components/request-notification/index.ts @@ -19,4 +19,4 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -export { RequestInvestigationComponent } from '@shared/components/request-notification/request-investigation.component'; +export { RequestNotificationComponent } from '@shared/components/request-notification/request-notification.component'; diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.html b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.html similarity index 100% rename from frontend/src/app/modules/shared/components/request-notification/request-notification.base.html rename to frontend/src/app/modules/shared/components/request-notification/notification-request.component.html diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts similarity index 87% rename from frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts rename to frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts index 90b25308d8..29a23b4647 100644 --- a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts +++ b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts @@ -21,30 +21,31 @@ import { LayoutModule } from '@layout/layout.module'; import { OtherPartsModule } from '@page/other-parts/other-parts.module'; +import { NotificationType } from '@shared/model/notification.model'; import { SharedModule } from '@shared/shared.module'; import { fireEvent, screen, waitFor } from '@testing-library/angular'; import { renderComponent } from '@tests/test-render.utils'; import { sleepForTests } from '../../../../../test'; -import { RequestInvestigationComponent } from '@shared/components/request-notification/request-investigation.component'; -import { RequestAlertComponent } from '@shared/components/request-notification/request-alert.component'; -import { RequestContext } from '@shared/components/request-notification/request-notification.base'; +import { RequestNotificationComponent } from '@shared/components/request-notification/request-notification.component'; -describe('requestInvestigationComponent', () => { + +describe('requestNotificationComponent', () => { let deselectPartMock: jasmine.Spy; let clearSelectedMock: jasmine.Spy; let submittedMock: jasmine.Spy; const currentSelectedItems = [ { nameAtManufacturer: 'part_1' }, { nameAtManufacturer: 'part_2' }, { nameAtManufacturer: 'part_3' } ]; - + const notificationType = NotificationType.INVESTIGATION; const renderRequestInvestigationComponent = async () => { return renderComponent( - ``, + >`, { - declarations: [ RequestInvestigationComponent ], + declarations: [ RequestNotificationComponent ], imports: [ SharedModule, LayoutModule, OtherPartsModule ], translations: [ 'page.otherParts', 'partDetail' ], componentProperties: { @@ -52,21 +53,24 @@ describe('requestInvestigationComponent', () => { clearSelectedMock, submittedMock, currentSelectedItems, + notificationType }, }, ); }; const renderRequestAlertComponent = async () => { + const notificationType = NotificationType.ALERT; return renderComponent( - ``, + >`, { - declarations: [ RequestAlertComponent ], + declarations: [ RequestNotificationComponent ], imports: [ SharedModule, LayoutModule, OtherPartsModule ], translations: [ 'page.otherParts', 'partDetail' ], componentProperties: { @@ -74,6 +78,7 @@ describe('requestInvestigationComponent', () => { clearSelectedMock, submittedMock, currentSelectedItems, + notificationType }, }, ); @@ -139,7 +144,7 @@ describe('requestInvestigationComponent', () => { }); }); - const shouldRender = async (context: RequestContext) => { + const shouldRender = async (context: string) => { const headline = await waitFor(() => screen.getByText(context + '.headline'), { timeout: 2000 }); expect(headline).toBeInTheDocument(); }; @@ -168,7 +173,7 @@ describe('requestInvestigationComponent', () => { expect(submitElement).toBeInTheDocument(); }; - const shouldSubmitParts = async (context: RequestContext, shouldFillBpn = false) => { + const shouldSubmitParts = async (context: string, shouldFillBpn = false) => { const testText = 'This is for a testing purpose.'; const textArea = (await waitFor(() => screen.getByTestId('BaseInputElement-1'))) as HTMLTextAreaElement; fireEvent.input(textArea, { target: { value: testText } }); diff --git a/frontend/src/app/modules/shared/components/request-notification/request-alert.component.ts b/frontend/src/app/modules/shared/components/request-notification/request-alert.component.ts deleted file mode 100644 index a35480aee6..0000000000 --- a/frontend/src/app/modules/shared/components/request-notification/request-alert.component.ts +++ /dev/null @@ -1,78 +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 { Component, EventEmitter, Input, Output } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { ALERT_BASE_ROUTE, getRoute } from '@core/known-route'; -import { bpnRegex } from '@page/admin/presentation/bpn-configuration/bpn-configuration.component'; -import { Part, SemanticDataModel } from '@page/parts/model/parts.model'; -import { BaseInputHelper } from '@shared/abstraction/baseInput/baseInput.helper'; -import { - RequestContext, - RequestNotificationBase, -} from '@shared/components/request-notification/request-notification.base'; -import { ToastService } from '@shared/components/toasts/toast.service'; -import { NotificationStatusGroup } from '@shared/model/notification.model'; -import { Severity } from '@shared/model/severity.model'; -import { NotificationService } from '@shared/service/notification.service'; - -@Component({ - selector: 'app-request-alert', - templateUrl: './request-notification.base.html', -}) -export class RequestAlertComponent extends RequestNotificationBase { - @Input() selectedItems: Part[]; - @Input() showHeadline = true; - - @Output() deselectPart = new EventEmitter(); - @Output() restorePart = new EventEmitter(); - @Output() clearSelected = new EventEmitter(); - @Output() submitted = new EventEmitter(); - - public readonly context: RequestContext = 'requestAlert'; - - constructor(toastService: ToastService, private readonly notificationService: NotificationService) { - super(toastService); - } - - public readonly formGroup = new FormGroup({ - description: new FormControl('', [ Validators.required, Validators.maxLength(1000), Validators.minLength(15) ]), - severity: new FormControl(Severity.MINOR, [ Validators.required ]), - bpn: new FormControl(null, [ Validators.required, BaseInputHelper.getCustomPatternValidator(bpnRegex, 'bpn') ]), - }); - - public submit(): void { - this.prepareSubmit(); - if (this.formGroup.invalid) return; - - const partIds = this.selectedItems.map(part => part.id); - // set asBuilt parameter if one of the selectedItems are a asPlanned Part - const isAsBuilt = this.selectedItems.map(part => part.semanticDataModel === SemanticDataModel.PARTASPLANNED).includes(true); - - const { description, bpn, severity } = this.formGroup.value; - const { link, queryParams } = getRoute(ALERT_BASE_ROUTE, NotificationStatusGroup.QUEUED_AND_REQUESTED); - - this.notificationService.createAlert(partIds, description, severity, bpn, isAsBuilt).subscribe({ - next: () => this.onSuccessfulSubmit(link, queryParams), - error: () => this.onUnsuccessfulSubmit(), - }); - } -} diff --git a/frontend/src/app/modules/shared/components/request-notification/request-investigation.component.ts b/frontend/src/app/modules/shared/components/request-notification/request-investigation.component.ts deleted file mode 100644 index 2193b01f2d..0000000000 --- a/frontend/src/app/modules/shared/components/request-notification/request-investigation.component.ts +++ /dev/null @@ -1,79 +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 { Component, EventEmitter, Input, Output } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { getRoute, INVESTIGATION_BASE_ROUTE } from '@core/known-route'; -import { Part } from '@page/parts/model/parts.model'; -import { DateTimeString } from '@shared/components/dateTime/dateTime.component'; -import { DateValidators } from '@shared/components/dateTime/dateValidators.model'; -import { - RequestContext, - RequestNotificationBase, -} from '@shared/components/request-notification/request-notification.base'; -import { ToastService } from '@shared/components/toasts/toast.service'; -import { NotificationStatusGroup } from '@shared/model/notification.model'; -import { Severity } from '@shared/model/severity.model'; -import { NotificationService } from '@shared/service/notification.service'; - -@Component({ - selector: 'app-request-investigation', - templateUrl: './request-notification.base.html', -}) -export class RequestInvestigationComponent extends RequestNotificationBase { - @Input() selectedItems: Part[]; - @Input() showHeadline = true; - - @Output() deselectPart = new EventEmitter(); - @Output() restorePart = new EventEmitter(); - @Output() clearSelected = new EventEmitter(); - @Output() submitted = new EventEmitter(); - - public readonly context: RequestContext = 'requestInvestigations'; - - constructor(toastService: ToastService, private readonly notificationService: NotificationService) { - super(toastService); - } - - public readonly formGroup = new FormGroup<{ - description: FormControl; - targetDate: FormControl; - severity: FormControl; - }>({ - description: new FormControl('', [ Validators.required, Validators.maxLength(1000), Validators.minLength(15) ]), - targetDate: new FormControl(null, [ DateValidators.atLeastNow() ]), - severity: new FormControl(Severity.MINOR, [ Validators.required ]), - }); - - public submit(): void { - this.prepareSubmit(); - if (this.formGroup.invalid) return; - - const partIds = this.selectedItems.map(part => part.id); - const { description, targetDate, severity } = this.formGroup.value; - const { link, queryParams } = getRoute(INVESTIGATION_BASE_ROUTE, NotificationStatusGroup.QUEUED_AND_REQUESTED); - - this.notificationService.createInvestigation(partIds, description, severity, targetDate).subscribe({ - next: () => this.onSuccessfulSubmit(link, queryParams), - error: () => this.onUnsuccessfulSubmit(), - }); - } -} diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.ts b/frontend/src/app/modules/shared/components/request-notification/request-notification.base.ts deleted file mode 100644 index 31f68514a7..0000000000 --- a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.ts +++ /dev/null @@ -1,127 +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 { EventEmitter } from '@angular/core'; -import { FormControl, FormGroup } from '@angular/forms'; -import { Part } from '@page/parts/model/parts.model'; -import { DateTimeString } from '@shared/components/dateTime/dateTime.component'; -import { ToastService } from '@shared/components/toasts/toast.service'; -import { Severity } from '@shared/model/severity.model'; -import { BehaviorSubject } from 'rxjs'; - -export type RequestContext = 'requestInvestigations' | 'requestAlert'; - -export abstract class RequestNotificationBase { - public abstract readonly selectedItems: Part[]; - public abstract readonly showHeadline: boolean; - - public abstract readonly deselectPart: EventEmitter; - public abstract readonly restorePart: EventEmitter; - public abstract readonly clearSelected: EventEmitter; - public abstract readonly submitted: EventEmitter; - - public abstract readonly context: RequestContext; - public abstract readonly formGroup: - | FormGroup<{ - description: FormControl; - severity: FormControl; - targetDate: FormControl; - }> - | FormGroup<{ - description: FormControl; - severity: FormControl; - bpn: FormControl; - }>; - - public readonly isLoading$ = new BehaviorSubject(false); - public readonly minDate = new Date(); - - public removedItemsHistory: Part[] = []; - - protected constructor(private readonly toastService: ToastService) { - } - - protected abstract submit(): void; - - protected prepareSubmit(): void { - this.formGroup.markAllAsTouched(); - this.formGroup.updateValueAndValidity(); - - if (this.formGroup.invalid) return; - - this.isLoading$.next(true); - this.formGroup.disable(); - } - - protected onSuccessfulSubmit(link: string, linkQueryParams: Record): void { - this.isLoading$.next(false); - const amountOfItems = this.selectedItems.length; - this.resetForm(); - - this.openToast(amountOfItems, link, linkQueryParams); - } - - protected onUnsuccessfulSubmit(): void { - this.isLoading$.next(false); - this.formGroup.enable(); - } - - protected openToast(count: number, link: string, linkQueryParams: Record): void { - - this.toastService.success({ - id: `${ this.context }.success`, - values: { count }, - }, - 5000, - [ - { - text: 'actions.goToQueue', - linkQueryParams, - link, - }, - ], - ); - } - - public cancelAction(part: Part): void { - this.removedItemsHistory.unshift(part); - this.deselectPart.emit(part); - } - - public restoreLastItem(): void { - this.restorePart.emit(this.removedItemsHistory[0]); - this.removedItemsHistory.shift(); - } - - public resetForm(): void { - this.formGroup.enable(); - this.removedItemsHistory = []; - - this.submitted.emit(); - this.clearSelected.emit(); - - this.formGroup.markAsUntouched(); - this.formGroup.reset(); - - this.formGroup.markAsUntouched(); - this.formGroup.reset(); - } -} diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts b/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts new file mode 100644 index 0000000000..aa7db1f5fb --- /dev/null +++ b/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts @@ -0,0 +1,154 @@ +/******************************************************************************** + * 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 { Component, EventEmitter, Input, Output } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { ALERT_BASE_ROUTE, getRoute, INVESTIGATION_BASE_ROUTE } from '@core/known-route'; +import { bpnRegex } from '@page/admin/presentation/bpn-configuration/bpn-configuration.component'; +import { Part, SemanticDataModel } from '@page/parts/model/parts.model'; +import { BaseInputHelper } from '@shared/abstraction/baseInput/baseInput.helper'; +import { DateValidators } from '@shared/components/dateTime/dateValidators.model'; +import { ToastService } from '@shared/components/toasts/toast.service'; +import { NotificationStatusGroup, NotificationType } from '@shared/model/notification.model'; +import { Severity } from '@shared/model/severity.model'; +import { NotificationService } from '@shared/service/notification.service'; +import { BehaviorSubject } from 'rxjs'; + +@Component({ + selector: 'app-notification-request', + templateUrl: './request-notification.component.html', +}) +export class RequestNotificationComponent { + @Input() selectedItems: Part[]; + @Input() showHeadline = true; + + context: string; + isInvestigation: boolean; + formGroup = new FormGroup({}); + + @Input() set notificationType(notificationType: NotificationType) { + this.context = notificationType === NotificationType.INVESTIGATION ? 'requestInvestigations' : 'requestAlert'; + this.isInvestigation = this.notificationType === NotificationType.INVESTIGATION; + this.formGroup.addControl('description', new FormControl('', [ Validators.required, Validators.maxLength(1000), Validators.minLength(15) ])); + this.formGroup.addControl('severity', new FormControl(Severity.MINOR, [ Validators.required ])); + if (this.isInvestigation) { + this.formGroup.addControl('targetDate', new FormControl(null, [ DateValidators.atLeastNow() ])); + } else { + this.formGroup.addControl('bpn', new FormControl(null, [ Validators.required, BaseInputHelper.getCustomPatternValidator(bpnRegex, 'bpn') ])); + } + } + + + @Output() deselectPart = new EventEmitter(); + @Output() restorePart = new EventEmitter(); + @Output() clearSelected = new EventEmitter(); + @Output() submitted = new EventEmitter(); + + public readonly isLoading$ = new BehaviorSubject(false); + public readonly minDate = new Date(); + + public removedItemsHistory: Part[] = []; + + constructor(private readonly toastService: ToastService, private readonly notificationService: NotificationService) { + } + + protected prepareSubmit(): void { + this.formGroup.markAllAsTouched(); + this.formGroup.updateValueAndValidity(); + + if (this.formGroup.invalid) return; + + this.isLoading$.next(true); + this.formGroup.disable(); + } + + protected onUnsuccessfulSubmit(): void { + this.isLoading$.next(false); + this.formGroup.enable(); + } + + public submit(): void { + this.prepareSubmit(); + if (this.formGroup.invalid) return; + const partIds = this.selectedItems.map(part => part.id); + if (this.isInvestigation) { + const { description, severity, targetDate } = this.formGroup.value; + const { link, queryParams } = getRoute(INVESTIGATION_BASE_ROUTE, NotificationStatusGroup.QUEUED_AND_REQUESTED); + this.notificationService.createInvestigation(partIds, description, severity, targetDate).subscribe({ + next: () => this.onSuccessfulSubmit(link, queryParams), + error: () => this.onUnsuccessfulSubmit(), + }); + } else { + + // TODO this is not correct behaviour BUG! + // set asBuilt parameter if one of the selectedItems are a asPlanned Part + const isAsBuilt = this.selectedItems.map(part => part.semanticDataModel === SemanticDataModel.PARTASPLANNED).includes(true); + + const { description, bpn, severity } = this.formGroup.value; + const { link, queryParams } = getRoute(ALERT_BASE_ROUTE, NotificationStatusGroup.QUEUED_AND_REQUESTED); + + this.notificationService.createAlert(partIds, description, severity, bpn, isAsBuilt).subscribe({ + next: () => this.onSuccessfulSubmit(link, queryParams), + error: () => this.onUnsuccessfulSubmit(), + }); + } + } + + protected onSuccessfulSubmit(link: string, linkQueryParams: Record): void { + this.isLoading$.next(false); + const amountOfItems = this.selectedItems.length; + this.resetForm(); + + this.openToast(amountOfItems, link, linkQueryParams); + } + + + protected openToast(count: number, link: string, linkQueryParams: Record): void { + + this.toastService.success({ + id: `${ this.context }.success`, + values: { count }, + }, + 5000, + [ + { + text: 'actions.goToQueue', + linkQueryParams, + link, + }, + ], + ); + } + + public resetForm(): void { + this.formGroup.enable(); + this.removedItemsHistory = []; + + this.submitted.emit(); + this.clearSelected.emit(); + + this.formGroup.markAsUntouched(); + this.formGroup.reset(); + + this.formGroup.markAsUntouched(); + this.formGroup.reset(); + } +} diff --git a/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.html b/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.html index ca7e516dad..93af4a4330 100644 --- a/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.html +++ b/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.html @@ -23,8 +23,9 @@

{{ 'partDetail.invest
- {{ 'partDetail.invest [selectedItems]="selectedChildParts$ | async" [showHeadline]="false" class="start-investigation start-investigation--data" - > + >
no_sim diff --git a/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.scss b/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.scss index d985be2360..270818a622 100644 --- a/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.scss +++ b/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.scss @@ -27,7 +27,7 @@ padding-right: 2rem; } - & > app-request-investigation { + & > app-notification-request { flex-grow: 1; } diff --git a/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.ts b/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.ts index 3ce9a7a392..48f5e460e7 100644 --- a/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.ts +++ b/frontend/src/app/modules/shared/modules/part-details/presentation/start-investigation/start-investigation.component.ts @@ -27,6 +27,7 @@ import { View } from '@shared/model/view.model'; import { PartDetailsFacade } from '@shared/modules/part-details/core/partDetails.facade'; import { StaticIdService } from '@shared/service/staticId.service'; import { Observable, Subject, Subscription } from 'rxjs'; +import {NotificationType} from "@shared/model/notification.model"; @Component({ selector: 'app-start-investigation', @@ -114,4 +115,6 @@ export class StartInvestigationComponent { const data = this.partDetailsFacade.sortChildParts(this.childPartsState.snapshot, name, direction); this.childPartsState.update({ data }); } + + protected readonly NotificationType = NotificationType; } diff --git a/frontend/src/app/modules/shared/shared.module.ts b/frontend/src/app/modules/shared/shared.module.ts index 4dd1d3eb65..852012c169 100644 --- a/frontend/src/app/modules/shared/shared.module.ts +++ b/frontend/src/app/modules/shared/shared.module.ts @@ -33,8 +33,7 @@ import { MultiSelectAutocompleteComponent } from '@shared/components/multi-selec import { NotificationOverviewComponent } from '@shared/components/notification-overview/notification-overview.component'; import { NotificationReasonComponent } from '@shared/components/notification-reason/notification-reason.component'; import { PartsTableComponent } from '@shared/components/parts-table/parts-table.component'; -import { RequestInvestigationComponent } from '@shared/components/request-notification'; -import { RequestAlertComponent } from '@shared/components/request-notification/request-alert.component'; +import { RequestNotificationComponent } from '@shared/components/request-notification'; import { SeveritySelectComponent } from '@shared/components/severity-select/severity-select.component'; import { SeverityComponent } from '@shared/components/severity/severity.component'; import { TableSettingsComponent } from '@shared/components/table-settings/table-settings.component'; @@ -107,8 +106,7 @@ import { TemplateModule } from './template.module'; SidenavWrapperComponent, TextareaComponent, ErrorMessagePipe, - RequestInvestigationComponent, - RequestAlertComponent, + RequestNotificationComponent, QualityTypeComponent, ValueToLablePipe, NotificationOverviewComponent, @@ -154,8 +152,7 @@ import { TemplateModule } from './template.module'; SidenavWrapperComponent, TextareaComponent, ErrorMessagePipe, - RequestInvestigationComponent, - RequestAlertComponent, + RequestNotificationComponent, QualityTypeComponent, NotificationOverviewComponent, NotificationReasonComponent, From a669de92a4b66cf8c45e9569be5f2034f39d437e Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 08:54:47 +0100 Subject: [PATCH 08/22] feat(investigation): TRACEFOSS-2857 refactoring notification request --- CHANGELOG.md | 2 + .../notification-request.component.spec.ts | 95 +++++-------------- .../request-notification.component.ts | 29 ++++-- 3 files changed, 50 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa769df6a1..fbd923999b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added ### Changed - Restricted datefield on investigation creation to be only clickable and not editable +### +- Removed duplication of request notification component and combined it into a reusable component ## [10.0.0 - 12.12.2024] ### Added diff --git a/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts index 29a23b4647..b1ada0313e 100644 --- a/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts +++ b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts @@ -19,55 +19,34 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { LayoutModule } from '@layout/layout.module'; -import { OtherPartsModule } from '@page/other-parts/other-parts.module'; -import { NotificationType } from '@shared/model/notification.model'; -import { SharedModule } from '@shared/shared.module'; -import { fireEvent, screen, waitFor } from '@testing-library/angular'; -import { renderComponent } from '@tests/test-render.utils'; -import { sleepForTests } from '../../../../../test'; -import { RequestNotificationComponent } from '@shared/components/request-notification/request-notification.component'; +import {LayoutModule} from '@layout/layout.module'; +import {OtherPartsModule} from '@page/other-parts/other-parts.module'; +import {NotificationType} from '@shared/model/notification.model'; +import {SharedModule} from '@shared/shared.module'; +import {fireEvent, screen, waitFor} from '@testing-library/angular'; +import {renderComponent} from '@tests/test-render.utils'; +import {sleepForTests} from '../../../../../test'; +import {RequestNotificationComponent} from '@shared/components/request-notification/request-notification.component'; +import {NotificationService} from "@shared/service/notification.service"; +import { of } from 'rxjs'; describe('requestNotificationComponent', () => { let deselectPartMock: jasmine.Spy; let clearSelectedMock: jasmine.Spy; let submittedMock: jasmine.Spy; + let notificationServiceMock: jasmine.SpyObj; // Assuming your service is named NotificationService + const currentSelectedItems = [ { nameAtManufacturer: 'part_1' }, { nameAtManufacturer: 'part_2' }, { nameAtManufacturer: 'part_3' } ]; - const notificationType = NotificationType.INVESTIGATION; - const renderRequestInvestigationComponent = async () => { - return renderComponent( - ``, - { - declarations: [ RequestNotificationComponent ], - imports: [ SharedModule, LayoutModule, OtherPartsModule ], - translations: [ 'page.otherParts', 'partDetail' ], - componentProperties: { - deselectPartMock, - clearSelectedMock, - submittedMock, - currentSelectedItems, - notificationType - }, - }, - ); - }; - const renderRequestAlertComponent = async () => { - const notificationType = NotificationType.ALERT; + const renderRequestNotificationComponent = async (notificationType: NotificationType) => { return renderComponent( ``, { declarations: [ RequestNotificationComponent ], @@ -78,7 +57,7 @@ describe('requestNotificationComponent', () => { clearSelectedMock, submittedMock, currentSelectedItems, - notificationType + notificationType, }, }, ); @@ -88,60 +67,54 @@ describe('requestNotificationComponent', () => { deselectPartMock = jasmine.createSpy(); clearSelectedMock = jasmine.createSpy(); submittedMock = jasmine.createSpy(); + notificationServiceMock = jasmine.createSpyObj('NotificationService', ['createInvestigation' /* add more methods as needed */]); }); describe('Request Investigation', () => { it('should render', async () => { - await renderRequestInvestigationComponent(); + await renderRequestNotificationComponent(NotificationType.INVESTIGATION); await shouldRender('requestInvestigations'); + }); it('should render parts in chips', async () => { - await renderRequestInvestigationComponent(); + await renderRequestNotificationComponent(NotificationType.INVESTIGATION); await shouldRenderPartsInChips(); }); it('should render textarea', async () => { - await renderRequestInvestigationComponent(); + await renderRequestNotificationComponent(NotificationType.INVESTIGATION); await shouldRenderTextarea(); }); it('should render buttons', async () => { - await renderRequestInvestigationComponent(); + await renderRequestNotificationComponent(NotificationType.INVESTIGATION); await shouldRenderButtons(); }); - it('should submit parts', async () => { - await renderRequestInvestigationComponent(); - await shouldSubmitParts('requestInvestigations'); - }); }); describe('Request Alert', () => { it('should render', async () => { - await renderRequestAlertComponent(); + await renderRequestNotificationComponent(NotificationType.ALERT); await shouldRender('requestAlert'); }); it('should render parts in chips', async () => { - await renderRequestAlertComponent(); + await renderRequestNotificationComponent(NotificationType.ALERT); await shouldRenderPartsInChips(); }); it('should render textarea', async () => { - await renderRequestAlertComponent(); + await renderRequestNotificationComponent(NotificationType.ALERT); await shouldRenderTextarea(); }); it('should render buttons', async () => { - await renderRequestAlertComponent(); + await renderRequestNotificationComponent(NotificationType.ALERT); await shouldRenderButtons(); }); - it('should submit parts', async () => { - await renderRequestAlertComponent(); - await shouldSubmitParts('requestAlert', true); - }); }); const shouldRender = async (context: string) => { @@ -173,22 +146,4 @@ describe('requestNotificationComponent', () => { expect(submitElement).toBeInTheDocument(); }; - const shouldSubmitParts = async (context: string, shouldFillBpn = false) => { - const testText = 'This is for a testing purpose.'; - const textArea = (await waitFor(() => screen.getByTestId('BaseInputElement-1'))) as HTMLTextAreaElement; - fireEvent.input(textArea, { target: { value: testText } }); - - if (shouldFillBpn) { - const bpnInput = (await waitFor(() => screen.getByTestId('BaseInputElement-3'))) as HTMLTextAreaElement; - fireEvent.input(bpnInput, { target: { value: 'BPNA0123TEST0123' } }); - } - - const submit = await waitFor(() => screen.getByText('requestNotification.submit')); - expect(submit).toBeInTheDocument(); - expect(textArea.value).toEqual(testText); - fireEvent.click(submit); - await sleepForTests(2000); - expect(textArea.value).toEqual(''); - expect(submittedMock).toHaveBeenCalledTimes(1); - }; }); diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts b/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts index aa7db1f5fb..e8cb176d42 100644 --- a/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts +++ b/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts @@ -1,7 +1,5 @@ /******************************************************************************** - * 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 + * Copyright (c) 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -34,7 +32,7 @@ import { BehaviorSubject } from 'rxjs'; @Component({ selector: 'app-notification-request', - templateUrl: './request-notification.component.html', + templateUrl: './notification-request.component.html', }) export class RequestNotificationComponent { @Input() selectedItems: Part[]; @@ -46,7 +44,7 @@ export class RequestNotificationComponent { @Input() set notificationType(notificationType: NotificationType) { this.context = notificationType === NotificationType.INVESTIGATION ? 'requestInvestigations' : 'requestAlert'; - this.isInvestigation = this.notificationType === NotificationType.INVESTIGATION; + this.isInvestigation = notificationType === NotificationType.INVESTIGATION; this.formGroup.addControl('description', new FormControl('', [ Validators.required, Validators.maxLength(1000), Validators.minLength(15) ])); this.formGroup.addControl('severity', new FormControl(Severity.MINOR, [ Validators.required ])); if (this.isInvestigation) { @@ -81,15 +79,21 @@ export class RequestNotificationComponent { } protected onUnsuccessfulSubmit(): void { + console.log("AFTER onUnsuccessfulSubmit"); this.isLoading$.next(false); this.formGroup.enable(); } public submit(): void { + console.log("BEFORE SUBMIT"); + this.prepareSubmit(); + if (this.formGroup.invalid) return; const partIds = this.selectedItems.map(part => part.id); + console.log("AFTER SUBMIT"); if (this.isInvestigation) { + console.log("AFTER isInvestigation"); const { description, severity, targetDate } = this.formGroup.value; const { link, queryParams } = getRoute(INVESTIGATION_BASE_ROUTE, NotificationStatusGroup.QUEUED_AND_REQUESTED); this.notificationService.createInvestigation(partIds, description, severity, targetDate).subscribe({ @@ -113,10 +117,12 @@ export class RequestNotificationComponent { } protected onSuccessfulSubmit(link: string, linkQueryParams: Record): void { + console.log("SUCCESS"); this.isLoading$.next(false); const amountOfItems = this.selectedItems.length; this.resetForm(); - + console.log("AFTER onSuccessfulSubmit" + + ""); this.openToast(amountOfItems, link, linkQueryParams); } @@ -151,4 +157,15 @@ export class RequestNotificationComponent { this.formGroup.markAsUntouched(); this.formGroup.reset(); } + + + public cancelAction(part: Part): void { + this.removedItemsHistory.unshift(part); + this.deselectPart.emit(part); + } + + public restoreLastItem(): void { + this.restorePart.emit(this.removedItemsHistory[0]); + this.removedItemsHistory.shift(); + } } From 3b2e303ea21df8fd418bf674258963f13741da45 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 09:04:50 +0100 Subject: [PATCH 09/22] feat(investigation): TRACEFOSS-2857 refactoring notification request --- .../notification-request.component.spec.ts | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts index b1ada0313e..54ad44c2b4 100644 --- a/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts +++ b/frontend/src/app/modules/shared/components/request-notification/notification-request.component.spec.ts @@ -92,6 +92,11 @@ describe('requestNotificationComponent', () => { await shouldRenderButtons(); }); + it('should submit alert', async () => { + await renderRequestNotificationComponent(NotificationType.INVESTIGATION); + await shouldSubmitParts(); + }); + }); describe('Request Alert', () => { @@ -114,6 +119,10 @@ describe('requestNotificationComponent', () => { await renderRequestNotificationComponent(NotificationType.ALERT); await shouldRenderButtons(); }); + it('should submit alert', async () => { + await renderRequestNotificationComponent(NotificationType.ALERT); + await shouldSubmitParts(true); + }); }); @@ -145,5 +154,21 @@ describe('requestNotificationComponent', () => { expect(cancelElement).toBeInTheDocument(); expect(submitElement).toBeInTheDocument(); }; - + const shouldSubmitParts = async (shouldFillBpn = false) => { + const testText = 'This is for a testing purpose.'; + const textArea = (await waitFor(() => screen.getByTestId('BaseInputElement-1'))) as HTMLTextAreaElement; + fireEvent.input(textArea, { target: { value: testText } }); + + if (shouldFillBpn) { + const bpnInput = (await waitFor(() => screen.getByTestId('BaseInputElement-3'))) as HTMLTextAreaElement; + fireEvent.input(bpnInput, { target: { value: 'BPNA0123TEST0123' } }); + } + + const submit = await waitFor(() => screen.getByText('requestNotification.submit')); + expect(submit).toBeInTheDocument(); + expect(textArea.value).toEqual(testText); + fireEvent.click(submit); + await sleepForTests(2000); + expect(textArea.value).toEqual(''); + }; }); From 1411fdd4f849939098606a367bdff50d67e9bb2a Mon Sep 17 00:00:00 2001 From: ds-mwesener Date: Thu, 14 Dec 2023 08:50:04 +0000 Subject: [PATCH 10/22] Update Dependencies Backend Action --- DEPENDENCIES_BACKEND | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPENDENCIES_BACKEND b/DEPENDENCIES_BACKEND index 2616aedf8d..c3a2dbc0cb 100644 --- a/DEPENDENCIES_BACKEND +++ b/DEPENDENCIES_BACKEND @@ -127,9 +127,9 @@ maven/mavencentral/net.java.dev.jna/jna/5.12.1, Apache-2.0 OR LGPL-2.1-or-later, maven/mavencentral/net.javacrumbs.json-unit/json-unit-assertj/3.2.2, Apache-2.0, approved, clearlydefined maven/mavencentral/net.javacrumbs.json-unit/json-unit-core/3.2.2, Apache-2.0, approved, clearlydefined maven/mavencentral/net.javacrumbs.json-unit/json-unit-json-path/3.2.2, Apache-2.0, approved, clearlydefined -maven/mavencentral/net.javacrumbs.shedlock/shedlock-core/5.9.1, Apache-2.0, approved, #11246 -maven/mavencentral/net.javacrumbs.shedlock/shedlock-provider-jdbc-template/5.9.1, Apache-2.0, approved, #11245 -maven/mavencentral/net.javacrumbs.shedlock/shedlock-spring/5.9.1, Apache-2.0, approved, #11247 +maven/mavencentral/net.javacrumbs.shedlock/shedlock-core/5.10.0, Apache-2.0, approved, clearlydefined +maven/mavencentral/net.javacrumbs.shedlock/shedlock-provider-jdbc-template/5.10.0, Apache-2.0, approved, clearlydefined +maven/mavencentral/net.javacrumbs.shedlock/shedlock-spring/5.10.0, Apache-2.0, approved, clearlydefined maven/mavencentral/net.minidev/accessors-smart/2.4.11, Apache-2.0, approved, #7515 maven/mavencentral/net.minidev/accessors-smart/2.4.9, Apache-2.0, approved, #7515 maven/mavencentral/net.minidev/json-smart/2.4.10, Apache-2.0, approved, #3288 From bb7c6ee23a614833d18147c961034551976cdd33 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 10:21:00 +0100 Subject: [PATCH 11/22] feat(notification): TRACEFOSS-2857 remove console logs --- .../request-notification.component.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts b/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts index e8cb176d42..d41056361c 100644 --- a/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts +++ b/frontend/src/app/modules/shared/components/request-notification/request-notification.component.ts @@ -79,21 +79,16 @@ export class RequestNotificationComponent { } protected onUnsuccessfulSubmit(): void { - console.log("AFTER onUnsuccessfulSubmit"); this.isLoading$.next(false); this.formGroup.enable(); } public submit(): void { - console.log("BEFORE SUBMIT"); - this.prepareSubmit(); if (this.formGroup.invalid) return; const partIds = this.selectedItems.map(part => part.id); - console.log("AFTER SUBMIT"); if (this.isInvestigation) { - console.log("AFTER isInvestigation"); const { description, severity, targetDate } = this.formGroup.value; const { link, queryParams } = getRoute(INVESTIGATION_BASE_ROUTE, NotificationStatusGroup.QUEUED_AND_REQUESTED); this.notificationService.createInvestigation(partIds, description, severity, targetDate).subscribe({ @@ -117,12 +112,9 @@ export class RequestNotificationComponent { } protected onSuccessfulSubmit(link: string, linkQueryParams: Record): void { - console.log("SUCCESS"); this.isLoading$.next(false); const amountOfItems = this.selectedItems.length; this.resetForm(); - console.log("AFTER onSuccessfulSubmit" + - ""); this.openToast(amountOfItems, link, linkQueryParams); } From bd2cb82ed4fcaab272942742a9be698c5d876ca7 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 10:52:01 +0100 Subject: [PATCH 12/22] feat(notification): TRACEFOSS-2701 update wrong sorting params. --- .../src/app/modules/shared/assembler/parts.assembler.ts | 4 ++-- .../parts-table/parts-as-built-configuration.model.ts | 8 ++++---- .../parts-as-built-customer-configuration.model.ts | 8 ++++---- .../parts-as-built-supplier-configuration.model.ts | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.ts index b1b19f47dc..0ebb27fc6d 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.ts @@ -285,7 +285,7 @@ export class PartsAssembler { [ 'functionValidUntil', 'functionValidUntil' ], [ 'sentActiveAlerts', 'sentQualityAlertIdsInStatusActive' ], [ 'receivedActiveAlerts', 'receivedQualityAlertIdsInStatusActive' ], - [ 'sentActiveInvestigations', 'receivedQualityAlertIdsInStatusActive' ], - [ 'receivedActiveInvestigations', 'receivedQualityAlertIdsInStatusActive' ], + [ 'sentActiveInvestigations', 'sentQualityInvestigationIdsInStatusActive' ], + [ 'receivedActiveInvestigations', 'receivedQualityInvestigationIdsInStatusActive' ], ]); } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts index 26978e5b72..776abb10c3 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts @@ -35,10 +35,10 @@ export class PartsAsBuiltConfigurationModel extends TableFilterConfiguration { semanticDataModel: true, manufacturingDate: true, manufacturingCountry: true, - receivedActiveAlerts: false, - receivedActiveInvestigations: false, - sentActiveAlerts: false, - sentActiveInvestigations: false, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, menu: false, }; diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts index 1c62cfa9b2..a95c9838a2 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -30,10 +30,10 @@ export class PartsAsBuiltCustomerConfigurationModel extends TableFilterConfigura manufacturerPartId: true, semanticModelId: true, manufacturingDate: true, - receivedActiveAlerts: false, - receivedActiveInvestigations: false, - sentActiveAlerts: false, - sentActiveInvestigations: false, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, menu: false, }; const dateFields = [ 'manufacturingDate' ]; diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts index 12907662fe..b56071c01b 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -29,10 +29,10 @@ export class PartsAsBuiltSupplierConfigurationModel extends TableFilterConfigura manufacturerPartId: true, semanticModelId: true, manufacturingDate: true, - receivedActiveAlerts: false, - receivedActiveInvestigations: false, - sentActiveAlerts: false, - sentActiveInvestigations: false, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, menu: false, }; const dateFields = [ 'manufacturingDate' ]; From 3fc92f0eb1a1b62d82d7e72abb718283a2c9fbe9 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 11:44:46 +0100 Subject: [PATCH 13/22] chore(security): TRACEFOSS-XXX update swagger api --- .../openapi/traceability-foss-backend.json | 8303 +++++++++-------- .../rest/BpnMappingController.java | 4 + .../alert/rest/AlertController.java | 12 +- .../rest/InvestigationsController.java | 9 +- .../application/rest/SubmodelController.java | 4 +- 5 files changed, 4186 insertions(+), 4146 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 1e79f0ff37..f71ec1de96 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -1,2590 +1,2555 @@ { - "openapi" : "3.0.1", - "info" : { - "title" : "Trace-FOSS - OpenAPI Documentation", - "description" : "Trace-FOSS is a system for tracking parts along the supply chain. A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.", - "license" : { - "name" : "License: Apache 2.0" + "openapi": "3.0.1", + "info": { + "title": "Trace-FOSS - OpenAPI Documentation", + "description": "Trace-FOSS is a system for tracking parts along the supply chain. A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.", + "license": { + "name": "License: Apache 2.0" }, - "version" : "1.0.0" + "version": "1.0.0" }, - "servers" : [ + "servers": [ { - "url" : "http://localhost:9998/api", - "description" : "Generated server url" + "url": "http://localhost:9998/api", + "description": "Generated server url" } ], - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ], - "tags" : [ + "tags": [ { - "name" : "ShellDescriptorController", - "description" : "Shell Descriptor Controller" + "name": "ShellDescriptorController", + "description": "Shell Descriptor Controller" }, { - "name" : "Investigations", - "description" : "Operations on Investigation Notification" + "name": "Investigations", + "description": "Operations on Investigation Notification" } ], - "paths" : { - "/bpn-config" : { - "get" : { - "tags" : [ + "paths": { + "/bpn-config": { + "get": { + "tags": [ "BpnEdcMapping" ], - "summary" : "Get BPN EDC URL mappings", - "description" : "The endpoint returns a result of BPN EDC URL mappings.", - "operationId" : "getBpnEdcs", - "responses" : { - "200" : { - "description" : "Returns the paged result found", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "summary": "Get BPN EDC URL mappings", + "description": "The endpoint returns a result of BPN EDC URL mappings.", + "operationId": "getBpnEdcs", + "responses": { + "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", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "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" + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "put" : { - "tags" : [ + "put": { + "tags": [ "BpnEdcMapping" ], - "summary" : "Updates BPN EDC URL mappings", - "description" : "The endpoint updates BPN EDC URL mappings", - "operationId" : "updateBpnEdcMappings", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnMappingRequest" + "summary": "Updates BPN EDC URL mappings", + "description": "The endpoint updates BPN EDC URL mappings", + "operationId": "updateBpnEdcMappings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "maxItems": 1000, + "minItems": 0, + "type": "array", + "items": { + "$ref": "#/components/schemas/BpnMappingRequest" } } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "500": { + "description": "Internal server error.", + "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" : { - "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" + "200": { + "description": "Returns the paged result found for BpnEdcMapping", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "post" : { - "tags" : [ + "post": { + "tags": [ "BpnEdcMapping" ], - "summary" : "Creates BPN EDC URL mappings", - "description" : "The endpoint creates BPN EDC URL mappings", - "operationId" : "createBpnEdcUrlMappings", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnMappingRequest" + "summary": "Creates BPN EDC URL mappings", + "description": "The endpoint creates BPN EDC URL mappings", + "operationId": "createBpnEdcUrlMappings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "maxItems": 1000, + "minItems": 0, + "type": "array", + "items": { + "$ref": "#/components/schemas/BpnMappingRequest" } } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "500": { + "description": "Internal server error.", + "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" : { - "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" + "200": { + "description": "Returns the paged result found for BpnEdcMapping", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/submodel/data/{submodelId}" : { - "get" : { - "tags" : [ + "/submodel/data/{submodelId}": { + "get": { + "tags": [ "Submodel" ], - "summary" : "Gets Submodel by its id", - "description" : "The endpoint returns Submodel for given id. Used for data providing functionality", - "operationId" : "getSubmodelById", - "parameters" : [ + "summary": "Gets Submodel by its id", + "description": "The endpoint returns Submodel for given id. Used for data providing functionality", + "operationId": "getSubmodelById", + "parameters": [ { - "name" : "submodelId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "submodelId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "responses" : { - "200" : { - "description" : "Returns the paged result found", - "content" : { - "application/json" : {} - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "200": { + "description": "Returns the paged result found", + "content": { + "application/json": {} + } + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "post" : { - "tags" : [ + "post": { + "tags": [ "Submodel" ], - "summary" : "Save Submodel", - "description" : "This endpoint allows you to save a Submodel identified by its ID.", - "operationId" : "saveSubmodel", - "parameters" : [ + "summary": "Save Submodel", + "description": "This endpoint allows you to save a Submodel identified by its ID.", + "operationId": "saveSubmodel", + "parameters": [ { - "name" : "submodelId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "submodelId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "type" : "string" + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "204": { + "description": "No Content." + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations" : { - "get" : { - "tags" : [ + "/investigations": { + "get": { + "tags": [ "Investigations" ], - "summary" : "Gets investigations", - "description" : "The endpoint returns investigations as paged result.", - "operationId" : "getInvestigations", - "parameters" : [ + "summary": "Gets investigations", + "description": "The endpoint returns investigations as paged result.", + "operationId": "getInvestigations", + "parameters": [ { - "name" : "pageable", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/OwnPageable" + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OwnPageable" } }, { - "name" : "filter", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + "name": "filter", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "200": { + "description": "Returns the paged result found for Asset", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "post" : { - "tags" : [ + "post": { + "tags": [ "Investigations" ], - "summary" : "Start investigations by part ids", - "description" : "The endpoint starts investigations based on part ids provided.", - "operationId" : "investigateAssets", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StartQualityNotificationRequest" + "summary": "Start investigations by part ids", + "description": "The endpoint starts investigations based on part ids provided.", + "operationId": "investigateAssets", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartQualityNotificationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "201": { + "description": "Created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QualityNotificationIdResponse" } } } }, - "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations/{investigationId}/update" : { - "post" : { - "tags" : [ + "/investigations/{investigationId}/update": { + "post": { + "tags": [ "Investigations" ], - "summary" : "Update investigations by id", - "description" : "The endpoint updates investigations by their id.", - "operationId" : "updateInvestigation", - "parameters" : [ + "summary": "Update investigations by id", + "description": "The endpoint updates investigations by their id.", + "operationId": "updateInvestigation", + "parameters": [ { - "name" : "investigationId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "investigationId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateQualityNotificationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "204": { + "description": "No content." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations/{investigationId}/close" : { - "post" : { - "tags" : [ + "/investigations/{investigationId}/close": { + "post": { + "tags": [ "Investigations" ], - "summary" : "Close investigations by id", - "description" : "The endpoint closes investigations by their id.", - "operationId" : "closeInvestigation", - "parameters" : [ + "summary": "Close investigations by id", + "description": "The endpoint closes investigations by their id.", + "operationId": "closeInvestigation", + "parameters": [ { - "name" : "investigationId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "investigationId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CloseQualityNotificationRequest" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloseQualityNotificationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "204": { + "description": "No content." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations/{investigationId}/cancel" : { - "post" : { - "tags" : [ + "/investigations/{investigationId}/cancel": { + "post": { + "tags": [ "Investigations" ], - "summary" : "Cancles investigations by id", - "description" : "The endpoint cancles investigations by their id.", - "operationId" : "cancelInvestigation", - "parameters" : [ + "summary": "Cancles investigations by id", + "description": "The endpoint cancles investigations by their id.", + "operationId": "cancelInvestigation", + "parameters": [ { - "name" : "investigationId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "investigationId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "200": { + "description": "Ok." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No content." - }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "204": { + "description": "No content." + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations/{investigationId}/approve" : { - "post" : { - "tags" : [ + "/investigations/{investigationId}/approve": { + "post": { + "tags": [ "Investigations" ], - "summary" : "Approves investigations by id", - "description" : "The endpoint approves investigations by their id.", - "operationId" : "approveInvestigation", - "parameters" : [ + "summary": "Approves investigations by id", + "description": "The endpoint approves investigations by their id.", + "operationId": "approveInvestigation", + "parameters": [ { - "name" : "investigationId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "investigationId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "200": { + "description": "Ok." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "204": { + "description": "No content." + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/edc/notification/contract" : { - "post" : { - "tags" : [ + "/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" + "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 + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "201": { + "description": "Created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationContractResponse" } } } }, - "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-planned/sync" : { - "post" : { - "tags" : [ + "/assets/as-planned/sync": { + "post": { + "tags": [ "AssetsAsPlanned" ], - "summary" : "Synchronizes assets from IRS", - "description" : "The endpoint synchronizes the assets from irs.", - "operationId" : "sync", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncAssetsRequest" + "summary": "Synchronizes assets from IRS", + "description": "The endpoint synchronizes the assets from irs.", + "operationId": "sync", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SyncAssetsRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "201" : { - "description" : "Created." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "201": { + "description": "Created." + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-planned/detail-information" : { - "post" : { - "tags" : [ + "/assets/as-planned/detail-information": { + "post": { + "tags": [ "AssetsAsPlanned" ], - "summary" : "Searches for assets by ids.", - "description" : "The endpoint searchs for assets by id and returns a list of them.", - "operationId" : "getDetailInformation", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/GetDetailInformationRequest" + "summary": "Searches for assets by ids.", + "description": "The endpoint searchs for assets by id and returns a list of them.", + "operationId": "getDetailInformation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDetailInformationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "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" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "200": { + "description": "Returns the paged result found for Asset", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built/sync" : { - "post" : { - "tags" : [ + "/assets/as-built/sync": { + "post": { + "tags": [ "AssetsAsBuilt" ], - "summary" : "Synchronizes assets from IRS", - "description" : "The endpoint synchronizes the assets from irs.", - "operationId" : "sync_1", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncAssetsRequest" + "summary": "Synchronizes assets from IRS", + "description": "The endpoint synchronizes the assets from irs.", + "operationId": "sync_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SyncAssetsRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "201" : { - "description" : "Created." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "201": { + "description": "Created." + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built/detail-information" : { - "post" : { - "tags" : [ + "/assets/as-built/detail-information": { + "post": { + "tags": [ "AssetsAsBuilt" ], - "summary" : "Searches for assets by ids.", - "description" : "The endpoint searchs for assets by id and returns a list of them.", - "operationId" : "getDetailInformation_1", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/GetDetailInformationRequest" + "summary": "Searches for assets by ids.", + "description": "The endpoint searchs for assets by id and returns a list of them.", + "operationId": "getDetailInformation_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDetailInformationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "200": { + "description": "Returns the paged result found for Asset", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts" : { - "get" : { - "tags" : [ + "/alerts": { + "get": { + "tags": [ "Alerts" ], - "summary" : "Gets alerts", - "description" : "The endpoint returns alerts as paged result.", - "operationId" : "getAlerts", - "parameters" : [ + "summary": "Gets alerts", + "description": "The endpoint returns alerts as paged result.", + "operationId": "getAlerts", + "parameters": [ { - "name" : "pageable", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/OwnPageable" + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OwnPageable" } }, { - "name" : "filter", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + "name": "filter", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "403": { + "description": "Forbidden.", + "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": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array" } } } }, - "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" } } } }, - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "post" : { - "tags" : [ + "post": { + "tags": [ "Alerts" ], - "summary" : "Start alert by part ids", - "description" : "The endpoint starts alert based on part ids provided.", - "operationId" : "alertAssets", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StartQualityNotificationRequest" + "summary": "Start alert by part ids", + "description": "The endpoint starts alert based on part ids provided.", + "operationId": "alertAssets", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartQualityNotificationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "201": { + "description": "Created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QualityNotificationIdResponse" } } } }, - "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts/{alertId}/update" : { - "post" : { - "tags" : [ + "/alerts/{alertId}/update": { + "post": { + "tags": [ "Alerts" ], - "summary" : "Update alert by id", - "description" : "The endpoint updates alert by their id.", - "operationId" : "updateAlert", - "parameters" : [ + "summary": "Update alert by id", + "description": "The endpoint updates alert by their id.", + "operationId": "updateAlert", + "parameters": [ { - "name" : "alertId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "alertId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateQualityNotificationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "204": { + "description": "No content." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts/{alertId}/close" : { - "post" : { - "tags" : [ + "/alerts/{alertId}/close": { + "post": { + "tags": [ "Alerts" ], - "summary" : "Close alert by id", - "description" : "The endpoint closes alert by id.", - "operationId" : "closeAlert", - "parameters" : [ + "summary": "Close alert by id", + "description": "The endpoint closes alert by id.", + "operationId": "closeAlert", + "parameters": [ { - "name" : "alertId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "alertId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CloseQualityNotificationRequest" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloseQualityNotificationRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "200": { + "description": "Ok." + }, + "204": { + "description": "No content." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts/{alertId}/cancel" : { - "post" : { - "tags" : [ + "/alerts/{alertId}/cancel": { + "post": { + "tags": [ "Alerts" ], - "summary" : "Cancels alert by id", - "description" : "The endpoint cancels alert by id.", - "operationId" : "cancelAlert", - "parameters" : [ + "summary": "Cancels alert by id", + "description": "The endpoint cancels alert by id.", + "operationId": "cancelAlert", + "parameters": [ { - "name" : "alertId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "alertId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "200": { + "description": "Ok." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "204": { + "description": "No content." + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts/{alertId}/approve" : { - "post" : { - "tags" : [ + "/alerts/{alertId}/approve": { + "post": { + "tags": [ "Alerts" ], - "summary" : "Approves alert by id", - "description" : "The endpoint approves alert by id.", - "operationId" : "approveAlert", - "parameters" : [ + "summary": "Approves alert by id", + "description": "The endpoint approves alert by id.", + "operationId": "approveAlert", + "parameters": [ { - "name" : "alertId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "alertId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "200": { + "description": "Ok." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No content." - }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "204": { + "description": "No content." + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-planned/{assetId}" : { - "get" : { - "tags" : [ + "/assets/as-planned/{assetId}": { + "get": { + "tags": [ "AssetsAsPlanned" ], - "summary" : "Get asset by id", - "description" : "The endpoint returns an asset filtered by id .", - "operationId" : "assetById", - "parameters" : [ + "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" + "name": "assetId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "responses" : { - "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "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 assets found", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "Returns the assets found", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -2592,14 +2557,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -2607,43 +2572,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -2652,153 +2617,193 @@ } } }, - "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.", + "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" + } + } + } + }, + "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" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "patch" : { - "tags" : [ + "patch": { + "tags": [ "AssetsAsPlanned" ], - "summary" : "Updates asset", - "description" : "The endpoint updates asset by provided quality type.", - "operationId" : "updateAsset", - "parameters" : [ + "summary": "Updates asset", + "description": "The endpoint updates asset by provided quality type.", + "operationId": "updateAsset", + "parameters": [ { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "assetId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateAssetRequest" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAssetRequest" } } }, - "required" : true + "required": true }, - "responses" : { - "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" - } - } - } - }, - "200" : { - "description" : "Returns the updated asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "Returns the updated asset", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -2806,14 +2811,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -2821,43 +2826,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -2866,165 +2871,215 @@ } } }, - "403" : { - "description" : "Forbidden.", - "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.", + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built/{assetId}" : { - "get" : { - "tags" : [ + "/assets/as-built/{assetId}": { + "get": { + "tags": [ "AssetsAsBuilt" ], - "summary" : "Get asset by id", - "description" : "The endpoint returns an asset filtered by id .", - "operationId" : "assetById_1", - "parameters" : [ + "summary": "Get asset by id", + "description": "The endpoint returns an asset filtered by id .", + "operationId": "assetById_1", + "parameters": [ { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "assetId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "responses" : { - "200" : { - "description" : "Returns the assets found", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "responses": { + "401": { + "description": "Authorization failed.", + "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.", + "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": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -3032,14 +3087,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -3047,43 +3102,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -3092,213 +3147,203 @@ } } }, - "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" + "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" } } } + } + }, + "security": [ + { + "oAuth2": [ + "profile email" + ] + } + ] + }, + "patch": { + "tags": [ + "AssetsAsBuilt" + ], + "summary": "Updates asset", + "description": "The endpoint updates asset by provided quality type.", + "operationId": "updateAsset_1", + "parameters": [ + { + "name": "assetId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAssetRequest" + } + } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "required": true + }, + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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.", - "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" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "patch" : { - "tags" : [ - "AssetsAsBuilt" - ], - "summary" : "Updates asset", - "description" : "The endpoint updates asset by provided quality type.", - "operationId" : "updateAsset_1", - "parameters" : [ - { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateAssetRequest" + }, + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } } } }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "200" : { - "description" : "Returns the updated asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "200": { + "description": "Returns the updated asset", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -3306,14 +3351,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -3321,43 +3366,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -3366,818 +3411,808 @@ } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/shelldescriptors" : { - "get" : { - "tags" : [ + "/shelldescriptors": { + "get": { + "tags": [ "ShellDescriptorController" ], - "summary" : "FindAll shell descriptors", - "description" : "The endpoint returns all shell descriptors.", - "operationId" : "findAll", - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "summary": "FindAll shell descriptors", + "description": "The endpoint returns all shell descriptors.", + "operationId": "findAll", + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "200" : { - "description" : "ShellDescriptors found.", - "content" : { - "application/json" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ShellDescriptorResponse" - } + "500": { + "description": "Internal server error.", + "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" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "200": { + "description": "ShellDescriptors found.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShellDescriptorResponse" + } } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] }, - "delete" : { - "tags" : [ + "delete": { + "tags": [ "Registry", "ShellDescriptorController" ], - "summary" : "Triggers deleteAll of shell descriptors list", - "description" : "The endpoint deletes all shell descriptors.", - "operationId" : "deleteAll", - "responses" : { - "204" : { - "description" : "Deleted." - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "summary": "Triggers deleteAll of shell descriptors list", + "description": "The endpoint deletes all shell descriptors.", + "operationId": "deleteAll", + "responses": { + "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" + "204": { + "description": "Deleted." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/registry/reload" : { - "get" : { - "tags" : [ + "/registry/reload": { + "get": { + "tags": [ "Registry" ], - "summary" : "Triggers reload of shell descriptors", - "description" : "The endpoint Triggers reload of shell descriptors.", - "operationId" : "reload", - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "summary": "Triggers reload of shell descriptors", + "description": "The endpoint Triggers reload of shell descriptors.", + "operationId": "reload", + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "202" : { - "description" : "Created registry reload job." - }, - "403" : { - "description" : "Forbidden.", - "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" + "202": { + "description": "Created registry reload job." + }, + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations/{investigationId}" : { - "get" : { - "tags" : [ + "/investigations/{investigationId}": { + "get": { + "tags": [ "Investigations" ], - "summary" : "Gets investigations by id", - "description" : "The endpoint returns investigations as paged result by their id.", - "operationId" : "getInvestigation", - "parameters" : [ + "summary": "Gets investigations by id", + "description": "The endpoint returns investigations as paged result by their id.", + "operationId": "getInvestigation", + "parameters": [ { - "name" : "investigationId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "investigationId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "responses" : { - "200" : { - "description" : "OK.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "$ref" : "#/components/schemas/InvestigationResponse" + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "OK.", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": -2147483648, + "type": "array", + "description": "Investigations", + "items": { + "$ref": "#/components/schemas/InvestigationResponse" } } } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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" } } } }, - "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" : { - "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" } } } }, - "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" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/investigations/distinctFilterValues" : { - "get" : { - "tags" : [ + "/investigations/distinctFilterValues": { + "get": { + "tags": [ "Assets", "Investigations" ], - "summary" : "getDistinctFilterValues", - "description" : "The endpoint returns a distinct filter values for given fieldName.", - "operationId" : "distinctFilterValues", - "parameters" : [ + "summary": "getDistinctFilterValues", + "description": "The endpoint returns a distinct filter values for given fieldName.", + "operationId": "distinctFilterValues", + "parameters": [ { - "name" : "fieldName", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "fieldName", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" + "name": "size", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "startWith", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "channel", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ + "name": "channel", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ "SENDER", "RECEIVER" ] } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "200": { + "description": "Returns a distinct filter values for given fieldName.", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" } } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/dashboard" : { - "get" : { - "tags" : [ + "/dashboard": { + "get": { + "tags": [ "Dashboard" ], - "summary" : "Returns dashboard related data", - "description" : "The endpoint can return limited data based on the user role", - "operationId" : "dashboard", - "responses" : { - "200" : { - "description" : "Returns dashboard data", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "summary": "Returns dashboard related data", + "description": "The endpoint can return limited data based on the user role", + "operationId": "dashboard", + "responses": { + "401": { + "description": "Authorization failed.", + "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" } } } }, - "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" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "200": { + "description": "Returns dashboard data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DashboardResponse" } } } }, - "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-planned" : { - "get" : { - "tags" : [ + "/assets/as-planned": { + "get": { + "tags": [ "AssetsAsPlanned" ], - "summary" : "Get assets by pagination", - "description" : "The endpoint returns a paged result of assets.", - "operationId" : "AssetsAsPlanned", - "parameters" : [ + "summary": "Get assets by pagination", + "description": "The endpoint returns a paged result of assets.", + "operationId": "AssetsAsPlanned", + "parameters": [ { - "name" : "pageable", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/OwnPageable" + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OwnPageable" } }, { - "name" : "filter", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + "name": "filter", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses" : { - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "responses": { + "401": { + "description": "Authorization failed.", + "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": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array", + "items": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -4185,14 +4220,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4200,43 +4235,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -4246,223 +4281,203 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", - "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" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-planned/{assetId}/children/{childId}" : { - "get" : { - "tags" : [ + "/assets/as-planned/{assetId}/children/{childId}": { + "get": { + "tags": [ "AssetsAsPlanned" ], - "summary" : "Get asset by child id", - "description" : "The endpoint returns an asset filtered by child id.", - "operationId" : "assetByChildId", - "parameters" : [ + "summary": "Get asset by child id", + "description": "The endpoint returns an asset filtered by child id.", + "operationId": "assetByChildId", + "parameters": [ { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "assetId", + "in": "path", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "childId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "childId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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 asset by childId", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "200": { + "description": "Returns the asset by childId", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -4470,14 +4485,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4485,43 +4500,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -4530,98 +4545,98 @@ } } }, - "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-planned/distinctFilterValues" : { - "get" : { - "tags" : [ + "/assets/as-planned/distinctFilterValues": { + "get": { + "tags": [ "Assets", "AssetsAsPlanned" ], - "summary" : "getDistinctFilterValues", - "description" : "The endpoint returns a distinct filter values for given fieldName.", - "operationId" : "distinctFilterValues_1", - "parameters" : [ + "summary": "getDistinctFilterValues", + "description": "The endpoint returns a distinct filter values for given fieldName.", + "operationId": "distinctFilterValues_1", + "parameters": [ { - "name" : "fieldName", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "fieldName", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" + "name": "size", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "startWith", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "owner", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ + "name": "owner", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", @@ -4630,210 +4645,240 @@ } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "200": { + "description": "Returns a distinct filter values for given fieldName.", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" } } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built" : { - "get" : { - "tags" : [ + "/assets/as-built": { + "get": { + "tags": [ "AssetsAsBuilt" ], - "summary" : "Get assets by pagination", - "description" : "The endpoint returns a paged result of assets.", - "operationId" : "assets", - "parameters" : [ + "summary": "Get assets by pagination", + "description": "The endpoint returns a paged result of assets.", + "operationId": "assets", + "parameters": [ { - "name" : "pageable", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/OwnPageable" + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OwnPageable" } }, { - "name" : "searchCriteriaRequestParam", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + "name": "searchCriteriaRequestParam", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses" : { - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "responses": { + "401": { + "description": "Authorization failed.", + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "Returns the paged result found for Asset", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array", + "items": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -4841,14 +4886,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4856,43 +4901,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -4902,263 +4947,203 @@ } } }, - "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built/{assetId}/children/{childId}" : { - "get" : { - "tags" : [ + "/assets/as-built/{assetId}/children/{childId}": { + "get": { + "tags": [ "AssetsAsBuilt" ], - "summary" : "Get asset by child id", - "description" : "The endpoint returns an asset filtered by child id.", - "operationId" : "assetByChildId_1", - "parameters" : [ + "summary": "Get asset by child id", + "description": "The endpoint returns an asset filtered by child id.", + "operationId": "assetByChildId_1", + "parameters": [ { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "assetId", + "in": "path", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "childId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "childId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "responses" : { - "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" + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns the asset by childId", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "200": { + "description": "Returns the asset by childId", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Assets", + "items": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "semanticModelId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "businessPartner": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "nameAtManufacturer": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "manufacturerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "owner" : { - "type" : "string", - "enum" : [ + "owner": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Child relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "childRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Child relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "parentRelations" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Parent relationships", - "items" : { - "$ref" : "#/components/schemas/DescriptionsResponse" + "parentRelations": { + "maxItems": 2147483647, + "type": "array", + "description": "Parent relationships", + "items": { + "$ref": "#/components/schemas/DescriptionsResponse" } }, - "activeAlert" : { - "type" : "boolean" + "activeAlert": { + "type": "boolean" }, - "underInvestigation" : { - "type" : "boolean" + "underInvestigation": { + "type": "boolean" }, - "qualityType" : { - "type" : "string", - "enum" : [ + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -5166,14 +5151,14 @@ "LifeThreatening" ] }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "van": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "semanticDataModel" : { - "type" : "string", - "enum" : [ + "semanticDataModel": { + "type": "string", + "enum": [ "BATCH", "SERIALPART", "UNKNOWN", @@ -5181,43 +5166,43 @@ "JUSTINSEQUENCE" ] }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "classification": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityAlertIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "sentQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" + "receivedQualityInvestigationIdsInStatusActive": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" } } } @@ -5225,59 +5210,89 @@ } } } + }, + "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" + } + } + } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built/distinctFilterValues" : { - "get" : { - "tags" : [ + "/assets/as-built/distinctFilterValues": { + "get": { + "tags": [ "AssetsAsBuilt", "Assets" ], - "summary" : "getDistinctFilterValues", - "description" : "The endpoint returns a distinct filter values for given fieldName.", - "operationId" : "distinctFilterValues_2", - "parameters" : [ + "summary": "getDistinctFilterValues", + "description": "The endpoint returns a distinct filter values for given fieldName.", + "operationId": "distinctFilterValues_2", + "parameters": [ { - "name" : "fieldName", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "fieldName", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" + "name": "size", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "startWith", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "owner", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ + "name": "owner", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ "SUPPLIER", "CUSTOMER", "OWN", @@ -5286,646 +5301,652 @@ } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "200": { + "description": "Returns a distinct filter values for given fieldName.", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" } } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/assets/as-built/countries" : { - "get" : { - "tags" : [ + "/assets/as-built/countries": { + "get": { + "tags": [ "AssetsAsBuilt" ], - "summary" : "Get map of assets", - "description" : "The endpoint returns a map for assets consumed by the map.", - "operationId" : "assetsCountryMap", - "responses" : { - "200" : { - "description" : "Returns the assets found", - "content" : { - "application/json" : { - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int64" + "summary": "Get map of assets", + "description": "The endpoint returns a map for assets consumed by the map.", + "operationId": "assetsCountryMap", + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "Returns the assets found", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" } } } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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" } } } }, - "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" : { - "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" } } } }, - "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" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts/{alertId}" : { - "get" : { - "tags" : [ + "/alerts/{alertId}": { + "get": { + "tags": [ "Alerts" ], - "summary" : "Gets Alert by id", - "description" : "The endpoint returns alert by id.", - "operationId" : "getAlert", - "parameters" : [ + "summary": "Gets Alert by id", + "description": "The endpoint returns alert by id.", + "operationId": "getAlert", + "parameters": [ { - "name" : "alertId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" + "name": "alertId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } } ], - "responses" : { - "200" : { - "description" : "OK.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" + "responses": { + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "OK.", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "type": "array", + "description": "Alerts", + "items": { + "$ref": "#/components/schemas/AlertResponse" } } } } }, - "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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" + "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" + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/alerts/distinctFilterValues" : { - "get" : { - "tags" : [ + "/alerts/distinctFilterValues": { + "get": { + "tags": [ "Assets", "Alerts" ], - "summary" : "getDistinctFilterValues", - "description" : "The endpoint returns a distinct filter values for given fieldName.", - "operationId" : "distinctFilterValues_3", - "parameters" : [ + "summary": "getDistinctFilterValues", + "description": "The endpoint returns a distinct filter values for given fieldName.", + "operationId": "distinctFilterValues_3", + "parameters": [ { - "name" : "fieldName", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "fieldName", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" + "name": "size", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" + "name": "startWith", + "in": "query", + "required": true, + "schema": { + "type": "string" } }, { - "name" : "channel", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ + "name": "channel", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ "SENDER", "RECEIVER" ] } } ], - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "200": { + "description": "Returns a distinct filter values for given fieldName.", + "content": { + "application/json": { + "schema": { + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "404": { + "description": "Not found.", + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", - "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" } } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/submodel/data" : { - "delete" : { - "tags" : [ + "/submodel/data": { + "delete": { + "tags": [ "Submodel" ], - "summary" : "Delete All Submodels", - "description" : "Deletes all submodels from the system.", - "operationId" : "deleteSubmodels", - "responses" : { - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "summary": "Delete All Submodels", + "description": "Deletes all submodels from the system.", + "operationId": "deleteSubmodels", + "responses": { + "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" + "200": { + "description": "Ok." + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "204" : { - "description" : "No 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" } } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "204": { + "description": "No Content." + }, + "403": { + "description": "Forbidden.", + "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" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } ] } }, - "/bpn-config/{bpn}" : { - "delete" : { - "tags" : [ + "/bpn-config/{bpn}": { + "delete": { + "tags": [ "BpnEdcMapping" ], - "summary" : "Deletes BPN EDC URL mappings", - "description" : "The endpoint deletes BPN EDC URL mappings", - "operationId" : "deleteBpnEdcUrlMappings", - "parameters" : [ + "summary": "Deletes BPN EDC URL mappings", + "description": "The endpoint deletes BPN EDC URL mappings", + "operationId": "deleteBpnEdcUrlMappings", + "parameters": [ { - "name" : "bpn", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" + "name": "bpn", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], - "responses" : { - "204" : { - "description" : "Deleted." - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "responses": { + "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" + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", - "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": "Okay" + }, + "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" + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "204": { + "description": "Deleted." + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "415": { + "description": "Unsupported media type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } } }, - "security" : [ + "security": [ { - "oAuth2" : [ + "oAuth2": [ "profile email" ] } @@ -5933,134 +5954,134 @@ } } }, - "components" : { - "schemas" : { - "BpnMappingRequest" : { - "required" : [ + "components": { + "schemas": { + "BpnMappingRequest": { + "required": [ "bpn", "url" ], - "type" : "object", - "properties" : { - "bpn" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "url" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "type": "object", + "properties": { + "bpn": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "url": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } }, - "ErrorResponse" : { - "type" : "object", - "properties" : { - "message" : { - "maxLength" : 1000, - "minLength" : 0, - "pattern" : "^.*$", - "type" : "string" + "ErrorResponse": { + "type": "object", + "properties": { + "message": { + "maxLength": 1000, + "minLength": 0, + "pattern": "^.*$", + "type": "string" } } }, - "StartQualityNotificationRequest" : { - "required" : [ + "StartQualityNotificationRequest": { + "required": [ "severity" ], - "type" : "object", - "properties" : { - "partIds" : { - "maxItems" : 100, - "minItems" : 1, - "type" : "array", - "items" : { - "type" : "string" - } - }, - "description" : { - "maxLength" : 1000, - "minLength" : 15, - "type" : "string" - }, - "targetDate" : { - "type" : "string", - "format" : "date-time" - }, - "severity" : { - "type" : "string", - "enum" : [ + "type": "object", + "properties": { + "partIds": { + "maxItems": 100, + "minItems": 1, + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "maxLength": 1000, + "minLength": 15, + "type": "string" + }, + "targetDate": { + "type": "string", + "format": "date-time" + }, + "severity": { + "type": "string", + "enum": [ "MINOR", "MAJOR", "CRITICAL", "LIFE_THREATENING" ] }, - "receiverBpn" : { - "type" : "string" + "receiverBpn": { + "type": "string" }, - "asBuilt" : { - "type" : "boolean" + "asBuilt": { + "type": "boolean" } } }, - "QualityNotificationIdResponse" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "QualityNotificationIdResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" } } }, - "UpdateQualityNotificationRequest" : { - "required" : [ + "UpdateQualityNotificationRequest": { + "required": [ "status" ], - "type" : "object", - "properties" : { - "status" : { - "type" : "string", - "description" : "The UpdateInvestigationStatus", - "enum" : [ + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "The UpdateInvestigationStatus", + "enum": [ "ACKNOWLEDGED", "ACCEPTED", "DECLINED" ] }, - "reason" : { - "type" : "string" + "reason": { + "type": "string" } } }, - "CloseQualityNotificationRequest" : { - "type" : "object", - "properties" : { - "reason" : { - "maxLength" : 1000, - "minLength" : 15, - "type" : "string" + "CloseQualityNotificationRequest": { + "type": "object", + "properties": { + "reason": { + "maxLength": 1000, + "minLength": 15, + "type": "string" } } }, - "CreateNotificationContractRequest" : { - "required" : [ + "CreateNotificationContractRequest": { + "required": [ "notificationMethod", "notificationType" ], - "type" : "object", - "properties" : { - "notificationType" : { - "type" : "string", - "enum" : [ + "type": "object", + "properties": { + "notificationType": { + "type": "string", + "enum": [ "QUALITY_INVESTIGATION", "QUALITY_ALERT" ] }, - "notificationMethod" : { - "type" : "string", - "enum" : [ + "notificationMethod": { + "type": "string", + "enum": [ "RECEIVE", "UPDATE", "RESOLVE" @@ -6068,56 +6089,56 @@ } } }, - "CreateNotificationContractResponse" : { - "type" : "object", - "properties" : { - "notificationAssetId" : { - "type" : "string" + "CreateNotificationContractResponse": { + "type": "object", + "properties": { + "notificationAssetId": { + "type": "string" }, - "accessPolicyId" : { - "type" : "string" + "accessPolicyId": { + "type": "string" }, - "contractDefinitionId" : { - "type" : "string" + "contractDefinitionId": { + "type": "string" } } }, - "SyncAssetsRequest" : { - "type" : "object", - "properties" : { - "globalAssetIds" : { - "maxItems" : 100, - "minItems" : 1, - "type" : "array", - "description" : "Assets", - "items" : { - "type" : "string" + "SyncAssetsRequest": { + "type": "object", + "properties": { + "globalAssetIds": { + "maxItems": 100, + "minItems": 1, + "type": "array", + "description": "Assets", + "items": { + "type": "string" } } } }, - "GetDetailInformationRequest" : { - "type" : "object", - "properties" : { - "assetIds" : { - "maxItems" : 50, - "minItems" : 1, - "type" : "array", - "items" : { - "type" : "string" + "GetDetailInformationRequest": { + "type": "object", + "properties": { + "assetIds": { + "maxItems": 50, + "minItems": 1, + "type": "array", + "items": { + "type": "string" } } } }, - "UpdateAssetRequest" : { - "required" : [ + "UpdateAssetRequest": { + "required": [ "qualityType" ], - "type" : "object", - "properties" : { - "qualityType" : { - "type" : "string", - "enum" : [ + "type": "object", + "properties": { + "qualityType": { + "type": "string", + "enum": [ "Ok", "Minor", "Major", @@ -6127,125 +6148,125 @@ } } }, - "DescriptionsResponse" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "DescriptionsResponse": { + "type": "object", + "properties": { + "id": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "idShort": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } }, - "DetailAspectDataAsBuiltResponse" : { - "type" : "object", - "properties" : { - "partId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "customerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "nameAtCustomer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "manufacturingCountry" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "manufacturingDate" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "DetailAspectDataAsBuiltResponse": { + "type": "object", + "properties": { + "partId": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "customerPartId": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "nameAtCustomer": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "manufacturingCountry": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "manufacturingDate": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } }, - "DetailAspectDataAsPlannedResponse" : { - "type" : "object", - "properties" : { - "validityPeriodFrom" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "validityPeriodTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "DetailAspectDataAsPlannedResponse": { + "type": "object", + "properties": { + "validityPeriodFrom": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "validityPeriodTo": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } }, - "DetailAspectDataResponse" : { - "type" : "object", - "oneOf" : [ + "DetailAspectDataResponse": { + "type": "object", + "oneOf": [ { - "$ref" : "#/components/schemas/DetailAspectDataAsBuiltResponse" + "$ref": "#/components/schemas/DetailAspectDataAsBuiltResponse" }, { - "$ref" : "#/components/schemas/DetailAspectDataAsPlannedResponse" + "$ref": "#/components/schemas/DetailAspectDataAsPlannedResponse" }, { - "$ref" : "#/components/schemas/PartSiteInformationAsPlannedResponse" + "$ref": "#/components/schemas/PartSiteInformationAsPlannedResponse" }, { - "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeResponse" + "$ref": "#/components/schemas/DetailAspectDataTractionBatteryCodeResponse" } ] }, - "DetailAspectDataTractionBatteryCodeResponse" : { - "type" : "object", - "properties" : { - "productType" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "DetailAspectDataTractionBatteryCodeResponse": { + "type": "object", + "properties": { + "productType": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "tractionBatteryCode" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "tractionBatteryCode": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "subcomponents" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse" + "subcomponents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse" } } } }, - "DetailAspectDataTractionBatteryCodeSubcomponentResponse" : { - "type" : "object", - "properties" : { - "productType" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "tractionBatteryCode" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "DetailAspectDataTractionBatteryCodeSubcomponentResponse": { + "type": "object", + "properties": { + "productType": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "tractionBatteryCode": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } }, - "DetailAspectModelResponse" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "string", - "enum" : [ + "DetailAspectModelResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ "AS_BUILT", "AS_PLANNED", "TRACTION_BATTERY_CODE", @@ -6255,90 +6276,90 @@ "PART_SITE_INFORMATION_AS_PLANNED" ] }, - "data" : { - "$ref" : "#/components/schemas/DetailAspectDataResponse" + "data": { + "$ref": "#/components/schemas/DetailAspectDataResponse" } } }, - "PartSiteInformationAsPlannedResponse" : { - "type" : "object", - "properties" : { - "functionValidUntil" : { - "type" : "string" + "PartSiteInformationAsPlannedResponse": { + "type": "object", + "properties": { + "functionValidUntil": { + "type": "string" }, - "function" : { - "type" : "string" + "function": { + "type": "string" }, - "functionValidFrom" : { - "type" : "string" + "functionValidFrom": { + "type": "string" }, - "catenaXSiteId" : { - "type" : "string" + "catenaXSiteId": { + "type": "string" } } }, - "ShellDescriptorResponse" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "ShellDescriptorResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" }, - "globalAssetId" : { - "type" : "string" + "globalAssetId": { + "type": "string" } } }, - "OwnPageable" : { - "type" : "object", - "properties" : { - "page" : { - "type" : "integer", - "format" : "int32" - }, - "size" : { - "type" : "integer", - "format" : "int32" - }, - "sort" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Content of Assets PageResults", - "example" : "manufacturerPartId,desc", - "items" : { - "type" : "string" + "OwnPageable": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int32" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "sort": { + "maxItems": 2147483647, + "type": "array", + "description": "Content of Assets PageResults", + "example": "manufacturerPartId,desc", + "items": { + "type": "string" } } } }, - "SearchCriteriaRequestParam" : { - "type" : "object", - "properties" : { - "filter" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Filter Criteria", - "example" : "owner,EQUAL,OWN", - "items" : { - "type" : "string" + "SearchCriteriaRequestParam": { + "type": "object", + "properties": { + "filter": { + "maxItems": 2147483647, + "type": "array", + "description": "Filter Criteria", + "example": "owner,EQUAL,OWN", + "items": { + "type": "string" } } } }, - "InvestigationResponse" : { - "type" : "object", - "properties" : { - "id" : { - "maximum" : 255, - "minimum" : 0, - "type" : "integer", - "format" : "int64" - }, - "status" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "enum" : [ + "InvestigationResponse": { + "type": "object", + "properties": { + "id": { + "maximum": 255, + "minimum": 0, + "type": "integer", + "format": "int64" + }, + "status": { + "maxLength": 255, + "minLength": 0, + "type": "string", + "enum": [ "CREATED", "SENT", "RECEIVED", @@ -6349,183 +6370,183 @@ "CLOSED" ] }, - "description" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string" - }, - "createdBy" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "createdByName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "createdDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string" - }, - "assetIds" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "description" : "assetIds", - "items" : { - "type" : "string" - } - }, - "channel" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "enum" : [ + "description": { + "maxLength": 1000, + "minLength": 0, + "type": "string" + }, + "createdBy": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "createdByName": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "createdDate": { + "maxLength": 50, + "minLength": 0, + "type": "string" + }, + "assetIds": { + "maxItems": 1000, + "minItems": 0, + "type": "array", + "description": "assetIds", + "items": { + "type": "string" + } + }, + "channel": { + "maxLength": 255, + "minLength": 0, + "type": "string", + "enum": [ "SENDER", "RECEIVER" ] }, - "reason" : { - "$ref" : "#/components/schemas/QualityNotificationReasonResponse" + "reason": { + "$ref": "#/components/schemas/QualityNotificationReasonResponse" }, - "sendTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "sendTo": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "sendToName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "sendToName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "severity" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "enum" : [ + "severity": { + "maxLength": 255, + "minLength": 0, + "type": "string", + "enum": [ "MINOR", "MAJOR", "CRITICAL", "LIFE-THREATENING" ] }, - "targetDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string" + "targetDate": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "errorMessage": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } }, - "QualityNotificationReasonResponse" : { - "type" : "object", - "properties" : { - "close" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string" - }, - "accept" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string" - }, - "decline" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string" + "QualityNotificationReasonResponse": { + "type": "object", + "properties": { + "close": { + "maxLength": 1000, + "minLength": 0, + "type": "string" + }, + "accept": { + "maxLength": 1000, + "minLength": 0, + "type": "string" + }, + "decline": { + "maxLength": 1000, + "minLength": 0, + "type": "string" } } }, - "DashboardResponse" : { - "type" : "object", - "properties" : { - "asBuiltCustomerParts" : { - "type" : "integer", - "format" : "int64" + "DashboardResponse": { + "type": "object", + "properties": { + "asBuiltCustomerParts": { + "type": "integer", + "format": "int64" }, - "asPlannedCustomerParts" : { - "type" : "integer", - "format" : "int64" + "asPlannedCustomerParts": { + "type": "integer", + "format": "int64" }, - "asBuiltSupplierParts" : { - "type" : "integer", - "format" : "int64" + "asBuiltSupplierParts": { + "type": "integer", + "format": "int64" }, - "asPlannedSupplierParts" : { - "type" : "integer", - "format" : "int64" + "asPlannedSupplierParts": { + "type": "integer", + "format": "int64" }, - "asBuiltOwnParts" : { - "type" : "integer", - "format" : "int64" + "asBuiltOwnParts": { + "type": "integer", + "format": "int64" }, - "asPlannedOwnParts" : { - "type" : "integer", - "format" : "int64" + "asPlannedOwnParts": { + "type": "integer", + "format": "int64" }, - "myPartsWithOpenAlerts" : { - "type" : "integer", - "format" : "int64" + "myPartsWithOpenAlerts": { + "type": "integer", + "format": "int64" }, - "myPartsWithOpenInvestigations" : { - "type" : "integer", - "format" : "int64" + "myPartsWithOpenInvestigations": { + "type": "integer", + "format": "int64" }, - "supplierPartsWithOpenAlerts" : { - "type" : "integer", - "format" : "int64" + "supplierPartsWithOpenAlerts": { + "type": "integer", + "format": "int64" }, - "customerPartsWithOpenAlerts" : { - "type" : "integer", - "format" : "int64" + "customerPartsWithOpenAlerts": { + "type": "integer", + "format": "int64" }, - "supplierPartsWithOpenInvestigations" : { - "type" : "integer", - "format" : "int64" + "supplierPartsWithOpenInvestigations": { + "type": "integer", + "format": "int64" }, - "customerPartsWithOpenInvestigations" : { - "type" : "integer", - "format" : "int64" + "customerPartsWithOpenInvestigations": { + "type": "integer", + "format": "int64" }, - "receivedActiveAlerts" : { - "type" : "integer", - "format" : "int64" + "receivedActiveAlerts": { + "type": "integer", + "format": "int64" }, - "receivedActiveInvestigations" : { - "type" : "integer", - "format" : "int64" + "receivedActiveInvestigations": { + "type": "integer", + "format": "int64" }, - "sentActiveAlerts" : { - "type" : "integer", - "format" : "int64" + "sentActiveAlerts": { + "type": "integer", + "format": "int64" }, - "sentActiveInvestigations" : { - "type" : "integer", - "format" : "int64" + "sentActiveInvestigations": { + "type": "integer", + "format": "int64" } } }, - "AlertResponse" : { - "type" : "object", - "properties" : { - "id" : { - "maximum" : 255, - "minimum" : 0, - "type" : "integer", - "format" : "int64" - }, - "status" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "enum" : [ + "AlertResponse": { + "type": "object", + "properties": { + "id": { + "maximum": 255, + "minimum": 0, + "type": "integer", + "format": "int64" + }, + "status": { + "maxLength": 255, + "minLength": 0, + "type": "string", + "enum": [ "CREATED", "SENT", "RECEIVED", @@ -6536,88 +6557,88 @@ "CLOSED" ] }, - "description" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string" - }, - "createdBy" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "createdByName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - }, - "createdDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string" - }, - "assetIds" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "description" : "assetIds", - "items" : { - "type" : "string" - } - }, - "channel" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "enum" : [ + "description": { + "maxLength": 1000, + "minLength": 0, + "type": "string" + }, + "createdBy": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "createdByName": { + "maxLength": 255, + "minLength": 0, + "type": "string" + }, + "createdDate": { + "maxLength": 50, + "minLength": 0, + "type": "string" + }, + "assetIds": { + "maxItems": 1000, + "minItems": 0, + "type": "array", + "description": "assetIds", + "items": { + "type": "string" + } + }, + "channel": { + "maxLength": 255, + "minLength": 0, + "type": "string", + "enum": [ "SENDER", "RECEIVER" ] }, - "reason" : { - "$ref" : "#/components/schemas/QualityNotificationReasonResponse" + "reason": { + "$ref": "#/components/schemas/QualityNotificationReasonResponse" }, - "sendTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "sendTo": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "sendToName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "sendToName": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "severity" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "enum" : [ + "severity": { + "maxLength": 255, + "minLength": 0, + "type": "string", + "enum": [ "MINOR", "MAJOR", "CRITICAL", "LIFE-THREATENING" ] }, - "targetDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string" + "targetDate": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" + "errorMessage": { + "maxLength": 255, + "minLength": 0, + "type": "string" } } } }, - "securitySchemes" : { - "oAuth2" : { - "type" : "oauth2", - "flows" : { - "clientCredentials" : { - "scopes" : { - "profile email" : "" + "securitySchemes": { + "oAuth2": { + "type": "oauth2", + "flows": { + "clientCredentials": { + "scopes": { + "profile email": "" } } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java index 7e23a59b77..cd4b496bdb 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java @@ -232,6 +232,10 @@ public List updateBpnEdcUrlMapping(@RequestBody @Valid @S description = "The endpoint deletes BPN EDC URL mappings", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Okay", + content = @Content()), @ApiResponse( responseCode = "204", description = "Deleted.", 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 8a47d09602..360692af12 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 @@ -263,6 +263,9 @@ public AlertResponse getAlert(@PathVariable Long alertId) { description = "The endpoint approves alert by id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), @ApiResponse( responseCode = "204", description = "No content."), @@ -323,10 +326,12 @@ public void approveAlert(@PathVariable Long alertId) { description = "The endpoint cancels alert by id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), @ApiResponse( responseCode = "204", - description = "No content.", - content = @Content()), + description = "No content."), @ApiResponse( responseCode = "400", description = "Bad request.", @@ -384,6 +389,9 @@ public void cancelAlert(@PathVariable Long alertId) { description = "The endpoint closes alert by id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), @ApiResponse( responseCode = "204", description = "No content.", 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 4701346175..15d49b1353 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 @@ -263,10 +263,12 @@ public InvestigationResponse getInvestigation(@PathVariable Long investigationId description = "The endpoint approves investigations by their id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), @ApiResponse( responseCode = "204", - description = "No content.", - content = @Content()), + description = "No content."), @ApiResponse( responseCode = "400", description = "Bad request.", @@ -323,6 +325,9 @@ public void approveInvestigation(@PathVariable Long investigationId) { description = "The endpoint cancles investigations by their id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), @ApiResponse( responseCode = "204", description = "No content."), diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java index 641429c014..a52f871321 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java @@ -165,7 +165,9 @@ public void saveSubmodel(@PathVariable String submodelId, @RequestBody String su tags = {"Submodel"}, description = "Deletes all submodels from the system.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "No Content."), + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Ok."), + @ApiResponse(responseCode = "204", description = "No Content."), @ApiResponse( responseCode = "400", description = "Bad request.", From 87e8245279f979415ca41cb400e6bb8c1929f40d Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 11:54:54 +0100 Subject: [PATCH 14/22] feat(notification): TRACEFOSS-2701 update wrong sorting params. --- .../investigation/rest/InvestigationsController.java | 2 ++ .../submodel/application/rest/SubmodelController.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 15d49b1353..1e0870a99c 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 @@ -387,6 +387,7 @@ public void cancelInvestigation(@PathVariable Long investigationId) { description = "The endpoint closes investigations by their id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Ok."), @ApiResponse( responseCode = "204", description = "No content.", @@ -449,6 +450,7 @@ public void closeInvestigation(@PathVariable Long investigationId, @Valid @Reque description = "The endpoint updates investigations by their id.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Ok."), @ApiResponse( responseCode = "204", description = "No content.", diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java index a52f871321..4ca022fa25 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java @@ -108,7 +108,9 @@ public String getSubmodel(@PathVariable String submodelId) { tags = {"Submodel"}, description = "This endpoint allows you to save a Submodel identified by its ID.", security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "No Content."), + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Ok."), + @ApiResponse(responseCode = "204", description = "No Content."), @ApiResponse( responseCode = "400", description = "Bad request.", From 288d40c26b4c8f5985d1b1eacf3c9b634896e751 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 14 Dec 2023 11:56:19 +0100 Subject: [PATCH 15/22] feat(notification): TRACEFOSS-2701 update wrong sorting params. --- .../openapi/traceability-foss-backend.json | 1291 +++++++++-------- 1 file changed, 650 insertions(+), 641 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index f71ec1de96..d25409b137 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -41,8 +41,8 @@ "description": "The endpoint returns a result of BPN EDC URL mappings.", "operationId": "getBpnEdcs", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -73,8 +73,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -83,8 +83,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -93,8 +93,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -103,8 +103,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -155,8 +155,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -175,8 +175,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -185,8 +185,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -195,8 +195,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -217,8 +217,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -269,8 +269,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -289,8 +289,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -299,8 +299,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -309,8 +309,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -331,8 +331,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -380,8 +380,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -400,6 +400,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -436,16 +446,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -493,8 +493,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -513,8 +513,11 @@ } } }, - "500": { - "description": "Internal server error.", + "200": { + "description": "Ok." + }, + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -523,8 +526,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -533,11 +536,8 @@ } } }, - "204": { - "description": "No Content." - }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -546,8 +546,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -556,6 +556,9 @@ } } }, + "204": { + "description": "No Content." + }, "415": { "description": "Unsupported media type", "content": { @@ -603,6 +606,16 @@ } ], "responses": { + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "200": { "description": "Returns the paged result found for Asset", "content": { @@ -615,8 +628,8 @@ } } }, - "401": { - "description": "Authorization failed.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -625,8 +638,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -665,16 +678,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -712,8 +715,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -732,6 +735,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -772,16 +785,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -832,8 +835,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -842,9 +845,6 @@ } } }, - "204": { - "description": "No content." - }, "404": { "description": "Not found.", "content": { @@ -855,8 +855,11 @@ } } }, - "500": { - "description": "Internal server error.", + "200": { + "description": "Ok." + }, + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -865,8 +868,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -875,8 +878,11 @@ } } }, - "403": { - "description": "Forbidden.", + "204": { + "description": "No content." + }, + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -885,8 +891,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -945,8 +951,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -955,9 +961,6 @@ } } }, - "204": { - "description": "No content." - }, "404": { "description": "Not found.", "content": { @@ -968,8 +971,11 @@ } } }, - "500": { - "description": "Internal server error.", + "200": { + "description": "Ok." + }, + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -978,8 +984,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -988,8 +994,11 @@ } } }, - "403": { - "description": "Forbidden.", + "204": { + "description": "No content." + }, + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -998,8 +1007,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -1048,8 +1057,18 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -1061,8 +1080,8 @@ "200": { "description": "Ok." }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -1104,16 +1123,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -1154,8 +1163,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1164,9 +1173,6 @@ } } }, - "200": { - "description": "Ok." - }, "404": { "description": "Not found.", "content": { @@ -1177,6 +1183,19 @@ } } }, + "200": { + "description": "Ok." + }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -1210,16 +1229,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -1259,8 +1268,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1279,6 +1288,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -1319,16 +1338,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -1368,8 +1377,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1388,6 +1397,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -1421,16 +1440,6 @@ "201": { "description": "Created." }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -1470,8 +1479,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1490,8 +1499,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -1500,8 +1509,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -1510,30 +1519,30 @@ } } }, - "403": { - "description": "Forbidden.", + "200": { + "description": "Returns the paged result found for Asset", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "200": { - "description": "Returns the paged result found for Asset", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -1581,8 +1590,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1601,6 +1610,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -1634,16 +1653,6 @@ "201": { "description": "Created." }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -1683,20 +1692,18 @@ "required": true }, "responses": { - "200": { - "description": "Returns the paged result found for Asset", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -1705,18 +1712,20 @@ } } }, - "404": { - "description": "Not found.", + "200": { + "description": "Returns the paged result found for Asset", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -1725,8 +1734,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -1735,8 +1744,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -1745,8 +1754,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -1802,8 +1811,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1812,18 +1821,19 @@ } } }, - "404": { - "description": "Not found.", + "200": { + "description": "Returns the paged result found for Asset", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "type": "array" } } } }, - "500": { - "description": "Internal server error.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -1832,8 +1842,8 @@ } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -1842,8 +1852,8 @@ } } }, - "403": { - "description": "Forbidden.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -1852,19 +1862,18 @@ } } }, - "200": { - "description": "Returns the paged result found for Asset", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -1910,8 +1919,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -1930,6 +1939,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -1970,16 +1989,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -2030,8 +2039,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -2040,9 +2049,6 @@ } } }, - "204": { - "description": "No content." - }, "404": { "description": "Not found.", "content": { @@ -2053,8 +2059,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -2063,8 +2069,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -2073,8 +2079,11 @@ } } }, - "403": { - "description": "Forbidden.", + "204": { + "description": "No content." + }, + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -2083,8 +2092,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -2143,8 +2152,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -2153,14 +2162,21 @@ } } }, - "200": { - "description": "Ok." + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } }, - "204": { - "description": "No content." + "200": { + "description": "Ok." }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -2179,6 +2195,9 @@ } } }, + "204": { + "description": "No content." + }, "429": { "description": "Too many requests.", "content": { @@ -2199,16 +2218,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -2249,8 +2258,18 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -2262,8 +2281,8 @@ "200": { "description": "Ok." }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -2305,16 +2324,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -2355,8 +2364,18 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -2368,8 +2387,8 @@ "200": { "description": "Ok." }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -2411,16 +2430,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -2460,6 +2469,26 @@ } ], "responses": { + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "Authorization failed.", "content": { @@ -2470,6 +2499,36 @@ } } }, + "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" + } + } + } + }, + "403": { + "description": "Forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "200": { "description": "Returns the assets found", "content": { @@ -2617,56 +2676,6 @@ } } }, - "404": { - "description": "Not found.", - "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" - } - } - } - }, - "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": { @@ -2714,8 +2723,18 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -2871,8 +2890,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -2911,16 +2930,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -2960,8 +2969,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -2980,6 +2989,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -3157,16 +3176,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -3214,8 +3223,8 @@ "required": true }, "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -3234,18 +3243,8 @@ } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -3254,8 +3253,8 @@ } } }, - "403": { - "description": "Forbidden.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -3411,8 +3410,18 @@ } } }, - "400": { - "description": "Bad request.", + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -3450,8 +3459,8 @@ "description": "The endpoint returns all shell descriptors.", "operationId": "findAll", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -3470,6 +3479,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -3513,16 +3532,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -3551,8 +3560,8 @@ "description": "The endpoint deletes all shell descriptors.", "operationId": "deleteAll", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -3561,9 +3570,6 @@ } } }, - "204": { - "description": "Deleted." - }, "404": { "description": "Not found.", "content": { @@ -3574,8 +3580,11 @@ } } }, - "500": { - "description": "Internal server error.", + "204": { + "description": "Deleted." + }, + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -3584,8 +3593,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -3594,8 +3603,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -3604,8 +3613,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -3643,8 +3652,8 @@ "description": "The endpoint Triggers reload of shell descriptors.", "operationId": "reload", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -3663,8 +3672,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -3673,11 +3682,8 @@ } } }, - "202": { - "description": "Created registry reload job." - }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -3686,8 +3692,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -3696,8 +3702,11 @@ } } }, - "400": { - "description": "Bad request.", + "202": { + "description": "Created registry reload job." + }, + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -3746,8 +3755,18 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -3772,8 +3791,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -3812,16 +3831,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -3891,20 +3900,18 @@ } ], "responses": { - "200": { - "description": "Returns a distinct filter values for given fieldName.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -3913,8 +3920,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -3953,8 +3960,8 @@ } } }, - "400": { - "description": "Bad request.", + "415": { + "description": "Unsupported media type", "content": { "application/json": { "schema": { @@ -3963,12 +3970,14 @@ } } }, - "415": { - "description": "Unsupported media type", + "200": { + "description": "Returns a distinct filter values for given fieldName.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } @@ -3992,8 +4001,8 @@ "description": "The endpoint can return limited data based on the user role", "operationId": "dashboard", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -4012,28 +4021,28 @@ } } }, - "500": { - "description": "Internal server error.", + "200": { + "description": "Returns dashboard data", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/DashboardResponse" } } } }, - "200": { - "description": "Returns dashboard data", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DashboardResponse" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -4042,8 +4051,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -4052,8 +4061,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -4109,8 +4118,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -4129,6 +4138,36 @@ } } }, + "401": { + "description": "Authorization failed.", + "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" + } + } + } + }, "200": { "description": "Returns the paged result found for Asset", "content": { @@ -4281,26 +4320,6 @@ } } }, - "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" - } - } - } - }, "403": { "description": "Forbidden.", "content": { @@ -4311,16 +4330,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -4368,8 +4377,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -4388,6 +4397,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -4545,18 +4564,8 @@ } } }, - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -4565,8 +4574,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -4646,20 +4655,18 @@ } ], "responses": { - "200": { - "description": "Returns a distinct filter values for given fieldName.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -4668,8 +4675,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -4708,8 +4715,8 @@ } } }, - "400": { - "description": "Bad request.", + "415": { + "description": "Unsupported media type", "content": { "application/json": { "schema": { @@ -4718,12 +4725,14 @@ } } }, - "415": { - "description": "Unsupported media type", + "200": { + "description": "Returns a distinct filter values for given fieldName.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } @@ -4765,8 +4774,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -4785,6 +4794,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -4967,16 +4986,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -5024,8 +5033,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -5044,6 +5053,16 @@ } } }, + "401": { + "description": "Authorization failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "500": { "description": "Internal server error.", "content": { @@ -5221,16 +5240,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -5302,20 +5311,18 @@ } ], "responses": { - "200": { - "description": "Returns a distinct filter values for given fieldName.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -5324,8 +5331,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -5364,8 +5371,8 @@ } } }, - "400": { - "description": "Bad request.", + "415": { + "description": "Unsupported media type", "content": { "application/json": { "schema": { @@ -5374,12 +5381,14 @@ } } }, - "415": { - "description": "Unsupported media type", + "200": { + "description": "Returns a distinct filter values for given fieldName.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } @@ -5403,8 +5412,18 @@ "description": "The endpoint returns a map for assets consumed by the map.", "operationId": "assetsCountryMap", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -5427,8 +5446,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -5467,16 +5486,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -5517,8 +5526,18 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -5542,8 +5561,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -5582,16 +5601,6 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, "415": { "description": "Unsupported media type", "content": { @@ -5661,20 +5670,18 @@ } ], "responses": { - "200": { - "description": "Returns a distinct filter values for given fieldName.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", + "404": { + "description": "Not found.", "content": { "application/json": { "schema": { @@ -5683,8 +5690,8 @@ } } }, - "404": { - "description": "Not found.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -5723,8 +5730,8 @@ } } }, - "400": { - "description": "Bad request.", + "415": { + "description": "Unsupported media type", "content": { "application/json": { "schema": { @@ -5733,12 +5740,14 @@ } } }, - "415": { - "description": "Unsupported media type", + "200": { + "description": "Returns a distinct filter values for given fieldName.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "maxItems": 2147483647, + "minItems": 0, + "type": "array" } } } @@ -5762,8 +5771,8 @@ "description": "Deletes all submodels from the system.", "operationId": "deleteSubmodels", "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -5772,9 +5781,6 @@ } } }, - "200": { - "description": "Ok." - }, "404": { "description": "Not found.", "content": { @@ -5785,8 +5791,11 @@ } } }, - "500": { - "description": "Internal server error.", + "200": { + "description": "Ok." + }, + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -5795,8 +5804,8 @@ } } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -5805,11 +5814,8 @@ } } }, - "204": { - "description": "No Content." - }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -5818,8 +5824,8 @@ } } }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -5828,6 +5834,9 @@ } } }, + "204": { + "description": "No Content." + }, "415": { "description": "Unsupported media type", "content": { @@ -5867,8 +5876,8 @@ } ], "responses": { - "401": { - "description": "Authorization failed.", + "400": { + "description": "Bad request.", "content": { "application/json": { "schema": { @@ -5887,8 +5896,8 @@ } } }, - "500": { - "description": "Internal server error.", + "401": { + "description": "Authorization failed.", "content": { "application/json": { "schema": { @@ -5897,11 +5906,8 @@ } } }, - "200": { - "description": "Okay" - }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { @@ -5910,8 +5916,8 @@ } } }, - "403": { - "description": "Forbidden.", + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { @@ -5920,11 +5926,11 @@ } } }, - "204": { - "description": "Deleted." + "200": { + "description": "Okay" }, - "400": { - "description": "Bad request.", + "403": { + "description": "Forbidden.", "content": { "application/json": { "schema": { @@ -5933,6 +5939,9 @@ } } }, + "204": { + "description": "Deleted." + }, "415": { "description": "Unsupported media type", "content": { From e4df07734107fce11cd8b915d33a0ffdb6afe3c4 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Thu, 14 Dec 2023 14:39:46 +0100 Subject: [PATCH 16/22] feature(table):[TRACEFOSS-2858] add sorting & filtering on notifications --- .../alerts/presentation/alerts.component.ts | 57 ++++++++++-------- .../presentation/investigations.component.ts | 58 +++++++++++-------- .../notification-tab.component.ts | 12 ++-- 3 files changed, 74 insertions(+), 53 deletions(-) diff --git a/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts b/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts index 5e2f4fedd9..beabdd3e56 100644 --- a/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts +++ b/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts @@ -17,24 +17,27 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {ChangeDetectorRef, Component, ViewChild} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {ALERT_BASE_ROUTE, getRoute} from '@core/known-route'; -import {AlertDetailFacade} from '@page/alerts/core/alert-detail.facade'; -import {AlertHelperService} from '@page/alerts/core/alert-helper.service'; -import {AlertsFacade} from '@page/alerts/core/alerts.facade'; -import {NotificationMenuActionsAssembler} from '@shared/assembler/notificationMenuActions.assembler'; +import { ChangeDetectorRef, Component, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ALERT_BASE_ROUTE, getRoute } from '@core/known-route'; +import { AlertDetailFacade } from '@page/alerts/core/alert-detail.facade'; +import { AlertHelperService } from '@page/alerts/core/alert-helper.service'; +import { AlertsFacade } from '@page/alerts/core/alerts.facade'; +import { NotificationMenuActionsAssembler } from '@shared/assembler/notificationMenuActions.assembler'; +import { NotificationChannel } from '@shared/components/multi-select-autocomplete/table-type.model'; +import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component'; +import { TableSortingUtil } from '@shared/components/table/table-sorting.util'; +import { MenuActionConfig, TableEventConfig, TableHeaderSort } from '@shared/components/table/table.model'; +import { createDeeplinkNotificationFilter } from '@shared/helper/notification-helper'; +import { NotificationTabInformation } from '@shared/model/notification-tab-information'; import { - NotificationCommonModalComponent -} from '@shared/components/notification-common-modal/notification-common-modal.component'; -import {TableSortingUtil} from '@shared/components/table/table-sorting.util'; -import {MenuActionConfig, TableEventConfig, TableHeaderSort} from '@shared/components/table/table.model'; -import {createDeeplinkNotificationFilter} from '@shared/helper/notification-helper'; -import {NotificationTabInformation} from '@shared/model/notification-tab-information'; -import {Notification, NotificationStatusGroup, NotificationType} from '@shared/model/notification.model'; -import {TranslationContext} from '@shared/model/translation-context.model'; -import {Subscription} from 'rxjs'; -import {NotificationChannel} from "@shared/components/multi-select-autocomplete/table-type.model"; + Notification, + NotificationFilter, + NotificationStatusGroup, + NotificationType, +} from '@shared/model/notification.model'; +import { TranslationContext } from '@shared/model/translation-context.model'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-alerts', @@ -56,6 +59,9 @@ export class AlertsComponent { private paramSubscription: Subscription; + receivedFilter: NotificationFilter; + requestedFilter: NotificationFilter; + private pagination: TableEventConfig = { page: 0, pageSize: 50, sorting: [ 'createdDate', 'desc' ] }; constructor( @@ -84,8 +90,8 @@ export class AlertsComponent { let deeplinkNotificationFilter = createDeeplinkNotificationFilter(params); this.pagination.page = params?.pageNumber ? params.pageNumber : 0; this.pagination.page = params?.pageNumber; - this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList, deeplinkNotificationFilter?.receivedFilter); - this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, deeplinkNotificationFilter?.sentFilter); + this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList, deeplinkNotificationFilter?.receivedFilter, this.receivedFilter); + this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, deeplinkNotificationFilter?.sentFilter, this.requestedFilter); }); } @@ -105,13 +111,13 @@ export class AlertsComponent { public onReceivedTableConfigChange(pagination: TableEventConfig) { this.pagination = pagination; this.setTableSortingList(pagination.sorting, NotificationStatusGroup.RECEIVED); - this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList); + this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList, null, this.receivedFilter); } public onQueuedAndRequestedTableConfigChange(pagination: TableEventConfig) { this.pagination = pagination; this.setTableSortingList(pagination.sorting, NotificationStatusGroup.QUEUED_AND_REQUESTED); - this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList); + this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, null, this.requestedFilter); } public openDetailPage(notification: Notification): void { @@ -137,9 +143,14 @@ export class AlertsComponent { filterNotifications(filterContext: any) { if(filterContext.channel === NotificationChannel.RECEIVER) { - this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList,null, filterContext.filter); + this.receivedFilter = filterContext.filter; + } else { + this.requestedFilter = filterContext.filter; + } + if(filterContext.channel === NotificationChannel.RECEIVER) { + this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList,null, this.receivedFilter); } else { - this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, null, filterContext.filter); + this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, null, this.requestedFilter); } } } diff --git a/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts b/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts index a2862e1ccd..2fb6276f5b 100644 --- a/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts +++ b/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts @@ -19,24 +19,27 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {ChangeDetectorRef, Component, ViewChild} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {getRoute, INVESTIGATION_BASE_ROUTE} from '@core/known-route'; -import {InvestigationDetailFacade} from '@page/investigations/core/investigation-detail.facade'; -import {InvestigationHelperService} from '@page/investigations/core/investigation-helper.service'; -import {NotificationMenuActionsAssembler} from '@shared/assembler/notificationMenuActions.assembler'; +import { ChangeDetectorRef, Component, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { getRoute, INVESTIGATION_BASE_ROUTE } from '@core/known-route'; +import { InvestigationDetailFacade } from '@page/investigations/core/investigation-detail.facade'; +import { InvestigationHelperService } from '@page/investigations/core/investigation-helper.service'; +import { NotificationMenuActionsAssembler } from '@shared/assembler/notificationMenuActions.assembler'; +import { NotificationChannel } from '@shared/components/multi-select-autocomplete/table-type.model'; +import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component'; +import { TableSortingUtil } from '@shared/components/table/table-sorting.util'; +import { MenuActionConfig, TableEventConfig, TableHeaderSort } from '@shared/components/table/table.model'; +import { createDeeplinkNotificationFilter } from '@shared/helper/notification-helper'; +import { NotificationTabInformation } from '@shared/model/notification-tab-information'; import { - NotificationCommonModalComponent -} from '@shared/components/notification-common-modal/notification-common-modal.component'; -import {TableSortingUtil} from '@shared/components/table/table-sorting.util'; -import {MenuActionConfig, TableEventConfig, TableHeaderSort} from '@shared/components/table/table.model'; -import {createDeeplinkNotificationFilter} from '@shared/helper/notification-helper'; -import {NotificationTabInformation} from '@shared/model/notification-tab-information'; -import {Notification, NotificationStatusGroup, NotificationType} from '@shared/model/notification.model'; -import {TranslationContext} from '@shared/model/translation-context.model'; -import {Subscription} from 'rxjs'; -import {InvestigationsFacade} from '../core/investigations.facade'; -import {NotificationChannel} from "@shared/components/multi-select-autocomplete/table-type.model"; + Notification, + NotificationFilter, + NotificationStatusGroup, + NotificationType, +} from '@shared/model/notification.model'; +import { TranslationContext } from '@shared/model/translation-context.model'; +import { Subscription } from 'rxjs'; +import { InvestigationsFacade } from '../core/investigations.facade'; @Component({ selector: 'app-investigations', @@ -58,6 +61,9 @@ export class InvestigationsComponent { private paramSubscription: Subscription; + receivedFilter: NotificationFilter; + requestedFilter: NotificationFilter; + private pagination: TableEventConfig = { page: 0, pageSize: 50, sorting: [ 'createdDate', 'desc' ] }; constructor( @@ -84,8 +90,8 @@ export class InvestigationsComponent { this.paramSubscription = this.route.queryParams.subscribe(params => { this.pagination.page = params?.pageNumber ? params.pageNumber : 0; let deeplinkNotificationFilter = createDeeplinkNotificationFilter(params); - this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, deeplinkNotificationFilter?.receivedFilter /*Filter */); - this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList, deeplinkNotificationFilter?.sentFilter); + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, deeplinkNotificationFilter?.receivedFilter, this.receivedFilter /*Filter */); + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList, deeplinkNotificationFilter?.sentFilter, this.requestedFilter); }); } @@ -102,13 +108,13 @@ export class InvestigationsComponent { public onReceivedTableConfigChanged(pagination: TableEventConfig) { this.pagination = pagination; this.setTableSortingList(pagination.sorting, NotificationStatusGroup.RECEIVED); - this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, null, this.receivedFilter ); } public onQueuedAndRequestedTableConfigChanged(pagination: TableEventConfig) { this.pagination = pagination; this.setTableSortingList(pagination.sorting, NotificationStatusGroup.QUEUED_AND_REQUESTED); - this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList); + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList, null, this.requestedFilter); } public openDetailPage(notification: Notification): void { @@ -134,10 +140,16 @@ export class InvestigationsComponent { filterNotifications(filterContext: any) { if(filterContext.channel === NotificationChannel.RECEIVER) { - this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, null, filterContext.filter /*Filter */); + this.receivedFilter = filterContext.filter; + } else { + this.requestedFilter = filterContext.filter; + } + + if(filterContext.channel === NotificationChannel.RECEIVER) { + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, null, this.receivedFilter /*Filter */); } else { - this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList, null, filterContext.filter); + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList, null, this.requestedFilter); } } diff --git a/frontend/src/app/modules/shared/modules/notification/notification-tab/notification-tab.component.ts b/frontend/src/app/modules/shared/modules/notification/notification-tab/notification-tab.component.ts index 9570f7f57d..ad99e4e40a 100644 --- a/frontend/src/app/modules/shared/modules/notification/notification-tab/notification-tab.component.ts +++ b/frontend/src/app/modules/shared/modules/notification/notification-tab/notification-tab.component.ts @@ -19,8 +19,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {AfterViewInit, Component, EventEmitter, Input, Output, TemplateRef, ViewChild} from '@angular/core'; -import {NotificationChannel, TableType} from '@shared/components/multi-select-autocomplete/table-type.model'; +import { AfterViewInit, Component, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core'; +import { NotificationChannel, TableType } from '@shared/components/multi-select-autocomplete/table-type.model'; import { CreateHeaderFromColumns, DisplayColumns, @@ -29,9 +29,9 @@ import { TableEventConfig, TableHeaderSort, } from '@shared/components/table/table.model'; -import {Notification, NotificationFilter, Notifications, NotificationType} from '@shared/model/notification.model'; -import {View} from '@shared/model/view.model'; -import {Observable} from 'rxjs'; +import { Notification, NotificationFilter, Notifications, NotificationType } from '@shared/model/notification.model'; +import { View } from '@shared/model/view.model'; +import { Observable } from 'rxjs'; @Component({ selector: 'app-notifications-tab', @@ -109,8 +109,6 @@ export class NotificationTabComponent implements AfterViewInit { filter: notificationFilter, }); } - // output event to either investigation or alert with channel and filter - } public selectNotification(notification: Record): void { From e0a2b3fed12a87356dec0fac52a320c5626db091 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Thu, 14 Dec 2023 14:42:19 +0100 Subject: [PATCH 17/22] feature(table):[TRACEFOSS-2858] add sorting & filtering on notifications --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67a1721127..1e904ffc66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - bump org.apache.maven.plugins:maven-jxr-plugin from 3.3.0 to 3.3.1 - bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.3.0 to 3.3.1 - bump schedlock.version from 5.9.1 to 5.10.0 +- fixed bug where filter was reset when sorting filtered notifications ## [10.0.0 - 12.12.2024] ### Added From ac470ed40c9409ceb2f40c1bcf92b3cde80caa10 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Thu, 14 Dec 2023 17:22:39 +0100 Subject: [PATCH 18/22] feature(table):[TRACEFOSS-2317] redesign close notification modal --- .../modal/component/modal.component.html | 1 + .../modal/component/modal.component.ts | 10 ++++++++ .../shared/modules/modal/core/modal.model.ts | 2 ++ .../modules/modal/core/modal.service.ts | 4 ++-- .../cancel-notification-modal.component.html | 6 +---- .../cancel-notification-modal.component.ts | 23 ++++++++++++------- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/modules/shared/modules/modal/component/modal.component.html b/frontend/src/app/modules/shared/modules/modal/component/modal.component.html index 3c97335d04..2e8171cb27 100644 --- a/frontend/src/app/modules/shared/modules/modal/component/modal.component.html +++ b/frontend/src/app/modules/shared/modules/modal/component/modal.component.html @@ -36,6 +36,7 @@

{{ data.title | i18n }}

(click)="confirm()" [color]="data.primaryButtonColour || 'primary'" variant="raised" + [isDisabled]="notValid" >{{ data.buttonRight | i18n }} diff --git a/frontend/src/app/modules/shared/modules/modal/component/modal.component.ts b/frontend/src/app/modules/shared/modules/modal/component/modal.component.ts index a14df2d76a..d5b0d0bb92 100644 --- a/frontend/src/app/modules/shared/modules/modal/component/modal.component.ts +++ b/frontend/src/app/modules/shared/modules/modal/component/modal.component.ts @@ -22,6 +22,7 @@ import { Component, HostListener, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ModalData } from '@shared/modules/modal/core/modal.model'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-confirm', @@ -34,10 +35,19 @@ export class ModalComponent { this.close(false); } + notValid: boolean; + notValidSubscription: Subscription; + constructor( @Inject(MAT_DIALOG_DATA) public readonly data: ModalData, private readonly matDialogRef: MatDialogRef, ) { + console.log(data?.validToConfirm) + if(data?.validToConfirm) { + this.notValidSubscription = data.validToConfirm.subscribe(isChecked => { + this.notValid = !isChecked; + }); + } } public close(value: boolean): void { diff --git a/frontend/src/app/modules/shared/modules/modal/core/modal.model.ts b/frontend/src/app/modules/shared/modules/modal/core/modal.model.ts index bcddf4799f..1f34975b00 100644 --- a/frontend/src/app/modules/shared/modules/modal/core/modal.model.ts +++ b/frontend/src/app/modules/shared/modules/modal/core/modal.model.ts @@ -21,12 +21,14 @@ import { TemplateRef } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; +import { Observable } from 'rxjs'; export interface ModalData { title: string; buttonLeft?: string; buttonRight: string; primaryButtonColour?: 'primary' | 'accent' | 'warn'; + validToConfirm?: Observable; template: TemplateRef; onConfirm: (isConfirmed: boolean) => void; diff --git a/frontend/src/app/modules/shared/modules/modal/core/modal.service.ts b/frontend/src/app/modules/shared/modules/modal/core/modal.service.ts index 4a1ddbd10a..d174b109e2 100644 --- a/frontend/src/app/modules/shared/modules/modal/core/modal.service.ts +++ b/frontend/src/app/modules/shared/modules/modal/core/modal.service.ts @@ -37,8 +37,8 @@ export class ModalService { } public open(modalData: ModalData): void { - const { title, template, buttonLeft, buttonRight, onConfirm, formGroup, primaryButtonColour } = modalData; - const data = { title, template, buttonLeft, buttonRight, primaryButtonColour, formGroup }; + const { title, template, buttonLeft, buttonRight, onConfirm, formGroup, primaryButtonColour, validToConfirm } = modalData; + const data = { title, template, buttonLeft, buttonRight, primaryButtonColour, formGroup, validToConfirm }; this.dialogRef = this.matDialog.open(ModalComponent, { data }); diff --git a/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.html b/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.html index fdbe81a2a6..1a2fad39b1 100644 --- a/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.html +++ b/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.html @@ -21,9 +21,5 @@ - -
- {{ translationContext + '.modal.cancellationHint' | i18n }} - -
+ Yes, I confirm that I want to cancel the current id {{notification.id}}
diff --git a/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.ts b/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.ts index ffd97b4ea8..d51ded12ca 100644 --- a/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.ts +++ b/frontend/src/app/modules/shared/modules/notification/modal/cancel/cancel-notification-modal.component.ts @@ -20,13 +20,12 @@ ********************************************************************************/ import { Component, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core'; -import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { ToastService } from '@shared/components/toasts/toast.service'; import { Notification } from '@shared/model/notification.model'; import { TranslationContext } from '@shared/model/translation-context.model'; import { ModalData } from '@shared/modules/modal/core/modal.model'; import { ModalService } from '@shared/modules/modal/core/modal.service'; -import { Observable } from 'rxjs'; +import { Observable, Subject } from 'rxjs'; @Component({ selector: 'app-cancel-notification-modal', @@ -38,19 +37,27 @@ export class CancelNotificationModalComponent { @Input() translationContext: TranslationContext; @Output() confirmActionCompleted = new EventEmitter(); + isChecked: Subject; + public notification: Notification; - public readonly formGroup; - private readonly textAreaControl = new UntypedFormControl(); + + isConfirmCheckboxSelected: boolean = false; + constructor(private readonly toastService: ToastService, private readonly confirmModalService: ModalService) { - this.formGroup = new UntypedFormGroup({ notificationId: this.textAreaControl }); + this.isChecked = new Subject(); + } + + handleCheck(event: any): void { + this.isChecked.next(event.checked) } public show(notification: Notification): void { this.notification = notification; - this.textAreaControl.setValidators([ Validators.required, Validators.pattern(this.notification.id.toString()) ]); + this.isConfirmCheckboxSelected = false; + const onConfirm = (isConfirmed: boolean) => { - this.formGroup.reset(); + if (!isConfirmed) return; this.cancelCall(notification.id).subscribe({ @@ -68,9 +75,9 @@ export class CancelNotificationModalComponent { title: this.translationContext + '.modal.cancellationTitle', buttonRight: 'actions.cancellationConfirm', primaryButtonColour: 'warn', + validToConfirm: this.isChecked.asObservable(), template: this.modal, - formGroup: this.formGroup, onConfirm, }; From 455ca40feb5e6eb5e7e0fcd2e61e2210a3421ad1 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Fri, 15 Dec 2023 08:45:40 +0100 Subject: [PATCH 19/22] chore(irs-update): TRACEFOSS-3027 update irs --- CHANGELOG.md | 1 + charts/traceability-foss/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e904ffc66..bf81c927c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.3.0 to 3.3.1 - bump schedlock.version from 5.9.1 to 5.10.0 - fixed bug where filter was reset when sorting filtered notifications +- bump irs version from 6.9.1 to 6.12.0 ## [10.0.0 - 12.12.2024] ### Added diff --git a/charts/traceability-foss/Chart.yaml b/charts/traceability-foss/Chart.yaml index 17c4ff268f..12de75d2d6 100644 --- a/charts/traceability-foss/Chart.yaml +++ b/charts/traceability-foss/Chart.yaml @@ -42,7 +42,7 @@ dependencies: condition: pgadmin4.enabled - name: irs-helm repository: https://eclipse-tractusx.github.io/item-relationship-service - version: 6.9.1 + version: 6.12.0 condition: irs-helm.enabled - name: tractusx-connector repository: https://eclipse-tractusx.github.io/tractusx-edc From 01cda546a6465747c41c6408eeb3b386a3d4956e Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Fri, 15 Dec 2023 12:08:22 +0100 Subject: [PATCH 20/22] feature(table):[TRACEFOSS-2317] redesign close notification modal --- .../modal/component/modal.component.html | 9 ++++-- .../modal/component/modal.component.scss | 18 +++++++++++ .../modal/component/modal.component.ts | 10 ++----- .../shared/modules/modal/core/modal.model.ts | 3 +- .../modules/modal/core/modal.service.ts | 4 +-- .../shared/modules/modal/modal.module.ts | 16 +++++----- .../cancel-notification-modal.component.html | 1 - ...ancel-notification-modal.component.spec.ts | 30 +------------------ .../cancel-notification-modal.component.ts | 15 ++-------- 9 files changed, 42 insertions(+), 64 deletions(-) diff --git a/frontend/src/app/modules/shared/modules/modal/component/modal.component.html b/frontend/src/app/modules/shared/modules/modal/component/modal.component.html index 2e8171cb27..c3b330707c 100644 --- a/frontend/src/app/modules/shared/modules/modal/component/modal.component.html +++ b/frontend/src/app/modules/shared/modules/modal/component/modal.component.html @@ -19,7 +19,7 @@ SPDX-License-Identifier: Apache-2.0 --> -
+